summaryrefslogtreecommitdiffstats
path: root/libdwfl/open.c
diff options
context:
space:
mode:
authorJosh Stone <[email protected]>2015-10-09 10:10:37 -0700
committerJosh Stone <[email protected]>2015-10-09 10:10:37 -0700
commit3425454a10d307fae891fb667cf7969e945cde79 (patch)
treeba30fbaff59ca353f4dad8759770600853fb00c1 /libdwfl/open.c
parentf17d101232d6d40e192e61441aa02a12ee8cf9b8 (diff)
Trust AC_SYS_LARGEFILE to provide large file support
AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS in config.h if needed for LFS, and this automatically maps things like open to open64. But quite a few places used explicit 64-bit names, which won't work on platforms like FreeBSD where off_t is always 64-bit and there are no foo64 names. It's better to just trust that AC_SYS_LARGEFILE is doing it correctly. But we can verify this too, as some file could easily forget to include config.h. The new tests/run-lfs-symbols.sh checks all build targets against lfs-symbols (taken from lintian) to make sure everything was implicitly mapped to 64-bit variants when _FILE_OFFSET_BITS is set. Signed-off-by: Josh Stone <[email protected]>
Diffstat (limited to 'libdwfl/open.c')
-rw-r--r--libdwfl/open.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdwfl/open.c b/libdwfl/open.c
index 40aac388..c1d0ed2b 100644
--- a/libdwfl/open.c
+++ b/libdwfl/open.c
@@ -53,7 +53,7 @@ decompress (int fd __attribute__ ((unused)), Elf **elf)
size_t size = 0;
#if USE_ZLIB || USE_BZLIB || USE_LZMA
- const off64_t offset = (*elf)->start_offset;
+ const off_t offset = (*elf)->start_offset;
void *const mapped = ((*elf)->map_address == NULL ? NULL
: (*elf)->map_address + offset);
const size_t mapped_size = (*elf)->maximum_size;
@@ -132,7 +132,7 @@ __libdw_open_file (int *fdp, Elf **elfp, bool close_on_fail, bool archive_ok)
/* It's not an ELF file or a compressed file.
See if it's an image with a header preceding the real file. */
- off64_t offset = elf->start_offset;
+ off_t offset = elf->start_offset;
error = __libdw_image_header (*fdp, &offset,
(elf->map_address == NULL ? NULL
: elf->map_address + offset),