This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Have readelf report unused bytes at the end of a .debug_loc section
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: nickc at redhat dot com
- Cc: binutils at sourceware dot org
- Date: Wed, 21 Nov 2007 18:51:25 +0100
- Subject: Re: PATCH: Have readelf report unused bytes at the end of a .debug_loc section
> From: Nick Clifton <nickc@redhat.com>
> Date: Wed, 21 Nov 2007 11:57:16 +0000
> + if (start < section_end)
> + warn (_("There are %ld unused bytes at the end of section %s\n"),
> + section_end - start, section->name);
> return 1;
> }
For a build of cris-elf (unimportant) this broke where long !=
int with certain gcc versions, like gcc 4.0.2-8 (RH) with
'CC=gcc -O2 -m32'. Perhaps add an iteration with -m32 to your
build variants?
I get:
gcc -O2 -m32 -DHAVE_CONFIG_H -I. -I/tmp/hpautotest-binutils/bsrc/src/binutils -I. -I. -I/tmp/hpautotest-binutils/bsrc/src/binutils -I../bfd -I/tmp/hpautotest-binutils/bsrc/src/binutils/../bfd -I/tmp/hpautotest-binutils/bsrc/src/binutils/../include -DLOCALEDIR="\"/usr/local/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c /tmp/hpautotest-binutils/bsrc/src/binutils/dwarf.c
/tmp/hpautotest-binutils/bsrc/src/binutils/dwarf.c: In function `display_debug_loc':
/tmp/hpautotest-binutils/bsrc/src/binutils/dwarf.c:2630: warning: long int format, int arg (arg 2)
make[4]: *** [dwarf.o] Error 1
Committed as obvious after testing for cris-elf. I believe this
is the same problem the other person tried to report.
* dwarf.c (display_debug_loc): Cast section_end - start to long
for output format.
Index: dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.21
diff -p -u -r1.21 dwarf.c
--- dwarf.c 21 Nov 2007 11:58:00 -0000 1.21
+++ dwarf.c 21 Nov 2007 17:46:22 -0000
@@ -2627,7 +2627,7 @@ display_debug_loc (struct dwarf_section
if (start < section_end)
warn (_("There are %ld unused bytes at the end of section %s\n"),
- section_end - start, section->name);
+ (long) (section_end - start), section->name);
return 1;
}
brgds, H-P