summaryrefslogtreecommitdiffstats
path: root/libelf
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2015-10-09 17:32:52 -0700
committerJosh Stone <jistone@redhat.com>2015-10-14 09:29:27 -0700
commitb1d0b0fc7ef850851574031851cd36d114ea30e7 (patch)
treef1e372c7a4ecb8003fd2f74b90c3d19cd8533f1f /libelf
parentbc119074c2fadf5288ab8e635a930aac496282d7 (diff)
downloadandroid_external_elfutils-b1d0b0fc7ef850851574031851cd36d114ea30e7.tar.gz
android_external_elfutils-b1d0b0fc7ef850851574031851cd36d114ea30e7.tar.bz2
android_external_elfutils-b1d0b0fc7ef850851574031851cd36d114ea30e7.zip
libelf: Use int64_t for offsets in libelf.h
Some systems don't have loff_t, like FreeBSD where off_t always supports large files. We need a standardized 64-bit signed type for the public header, without depending on configuration... OK, just use int64_t. Signed-off-by: Josh Stone <jistone@redhat.com>
Diffstat (limited to 'libelf')
-rw-r--r--libelf/ChangeLog4
-rw-r--r--libelf/libelf.h13
2 files changed, 11 insertions, 6 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index af2438b4..d8651d75 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-09 Josh Stone <jistone@redhat.com>
+
+ * libelf.h: Replace loff_t with int64_t throughout.
+
2015-10-05 Mark Wielaard <mjw@redhat.com>
* elf_update.c (write_file): Only use posix_fallocate when using
diff --git a/libelf/libelf.h b/libelf/libelf.h
index 5a2b3af8..54f7c29b 100644
--- a/libelf/libelf.h
+++ b/libelf/libelf.h
@@ -29,6 +29,7 @@
#ifndef _LIBELF_H
#define _LIBELF_H 1
+#include <stdint.h>
#include <sys/types.h>
/* Get the ELF types. */
@@ -74,7 +75,7 @@ typedef struct
Elf_Type d_type; /* Type of this piece of data. */
unsigned int d_version; /* ELF version. */
size_t d_size; /* Size in bytes. */
- loff_t d_off; /* Offset into section. */
+ int64_t d_off; /* Offset into section. */
size_t d_align; /* Alignment in section. */
} Elf_Data;
@@ -136,7 +137,7 @@ typedef struct
uid_t ar_uid; /* User ID. */
gid_t ar_gid; /* Group ID. */
mode_t ar_mode; /* File mode. */
- loff_t ar_size; /* File size. */
+ int64_t ar_size; /* File size. */
char *ar_rawname; /* Original name of archive member. */
} Elf_Arhdr;
@@ -177,13 +178,13 @@ extern Elf_Cmd elf_next (Elf *__elf);
extern int elf_end (Elf *__elf);
/* Update ELF descriptor and write file to disk. */
-extern loff_t elf_update (Elf *__elf, Elf_Cmd __cmd);
+extern int64_t elf_update (Elf *__elf, Elf_Cmd __cmd);
/* Determine what kind of file is associated with ELF. */
extern Elf_Kind elf_kind (Elf *__elf) __attribute__ ((__pure__));
/* Get the base offset for an object file. */
-extern loff_t elf_getbase (Elf *__elf);
+extern int64_t elf_getbase (Elf *__elf);
/* Retrieve file identification data. */
@@ -301,7 +302,7 @@ extern Elf_Data *elf_newdata (Elf_Scn *__scn);
would be for TYPE. The resulting Elf_Data pointer is valid until
elf_end (ELF) is called. */
extern Elf_Data *elf_getdata_rawchunk (Elf *__elf,
- loff_t __offset, size_t __size,
+ int64_t __offset, size_t __size,
Elf_Type __type);
@@ -313,7 +314,7 @@ extern char *elf_strptr (Elf *__elf, size_t __index, size_t __offset);
extern Elf_Arhdr *elf_getarhdr (Elf *__elf);
/* Return offset in archive for current file ELF. */
-extern loff_t elf_getaroff (Elf *__elf);
+extern int64_t elf_getaroff (Elf *__elf);
/* Select archive element at OFFSET. */
extern size_t elf_rand (Elf *__elf, size_t __offset);