[PATCH] lib: Add missing config.h #include to crc32_file.c.

Mark Wielaard mjw at redhat.com
Fri Jan 17 12:42:49 UTC 2014


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-Add-missing-config.h-include-to-crc32_file.c.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/elfutils-devel/attachments/20140117/835700b2/attachment.bin>


More information about the elfutils-devel mailing list