[Patch]: Fix objdump breakage on systems without mmap
Mike Frysinger
vapier@gentoo.org
Tue Jun 19 00:53:00 GMT 2007
On Monday 18 June 2007, Danny Smith wrote:
> 2007-06-18 Andi Kleen <ak@suse.de>
>
> * objdump.c: Include sys/mman.h
> ...
> (slurp_file): Add.
>
>
> Breaks systems that don't HAVE_MMAP.
> here:
> ../../src/binutils/objdump.c: In function 'slurp_file':
> ../../src/binutils/objdump.c:959: error: storage size of 'st' isn't
> known
> cc1.exe: warnings being treated as errors
> ../../src/binutils/objdump.c:964: warning: implicit declaration of
> function 'fstat'
> ../../src/binutils/objdump.c:959: warning: unused variable 'st'
>
>
> This fixes:
>
>
> 2007-06-18 Danny Smith <dannysmith@users.sourceforge.net>
>
> * objdump.c: Include sys/stat.h if !HAVE_MMAP.
>
>
> *** objdump.c.orig Tue Jun 19 08:33:33 2007
> --- objdump.c Tue Jun 19 12:09:49 2007
> ***************
> *** 63,68 ****
> --- 63,70 ----
>
> #ifdef HAVE_MMAP
> #include <sys/mman.h>
> + #else
> + #include <sys/stat.h>
> #endif
>
> /* Internal headers for the ELF .stab-
you cant assume sys/mman.h includes prototypes for stat and friends, so
everyone should be including sys/stat.h somehow, not just the !HAVE_MMAP
people
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/binutils/attachments/20070619/b7de6dc6/attachment.sig>
More information about the Binutils
mailing list