diff options
| author | Josh Stone <[email protected]> | 2015-10-09 10:10:37 -0700 |
|---|---|---|
| committer | Josh Stone <[email protected]> | 2015-10-09 10:10:37 -0700 |
| commit | 3425454a10d307fae891fb667cf7969e945cde79 (patch) | |
| tree | ba30fbaff59ca353f4dad8759770600853fb00c1 /src/readelf.c | |
| parent | f17d101232d6d40e192e61441aa02a12ee8cf9b8 (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 'src/readelf.c')
| -rw-r--r-- | src/readelf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/readelf.c b/src/readelf.c index fe7bc392..5f6e4edd 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -764,8 +764,8 @@ process_file (int fd, const char *fname, bool only_one) dwfl->offline_next_address = 0; if (dwfl_report_offline (dwfl, fname, fname, dwfl_fd) == NULL) { - struct stat64 st; - if (fstat64 (dwfl_fd, &st) != 0) + struct stat st; + if (fstat (dwfl_fd, &st) != 0) error (0, errno, gettext ("cannot stat input file")); else if (unlikely (st.st_size == 0)) error (0, 0, gettext ("input file is empty")); @@ -848,7 +848,7 @@ process_elf_file (Dwfl_Module *dwflmod, int fd) if (ehdr->e_type == ET_REL && print_unrelocated) { /* Read the file afresh. */ - off64_t aroff = elf_getaroff (elf); + off_t aroff = elf_getaroff (elf); pure_elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); if (aroff > 0) { |
