On Fri, 2014-01-17 at 03:32 -0800, Lei Zhang wrote:
We have a large binary on a 32-bit host where the following command
failed:
eu-strip -o foo.stripped -f foo.debug foo
eu-strip: while computing checksum for debug information: Invalid argument
Here, foo.debug is over 2 GB. The crc code called pread() with a
negative offset because crc32_file.c does not have LFS, off_t is only
32-bit, and the offset variable overflowed.
Yes, I think you are correct. We use AC_SYS_LARGEFILE which sets up
_FILE_OFFSET_BITS in config.h.
The reason it works in the other case (libdwfl) is that the file is
included as a whole in libdwfl/libdwfl_crc32_file.c which does have an
include config.h at the top before the inclusion. strip just includes
system.h and links against libeu.a instead.
Applied, with a ChangeLog entry.
BTW. It isn't necessary for trivially correct stuff like this, but
please add a Signed-off-by: line next time. See the CONTRIBUTING file.
Thanks,
Mark