This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
readelf: Test for SHT_REL sections when producing a warning about unapplied relocs
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 13 Mar 2007 17:16:48 +0000
- Subject: readelf: Test for SHT_REL sections when producing a warning about unapplied relocs
Hi Guys,
As Hans-Peter recently pointed out my patch to produce a warning
message when dumping the contents of a section did not take into
account SHT_REL sections. So I am applying this patch to resolve
this problem.
Cheers
Nick
binutils/ChangeLog
2007-03-13 Nick Clifton <nickc@redhat.com>
* readelf.c (dump_section): Also test for SHT_REL sections when
producing the warning about unapplied relocs.
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.360
diff -c -3 -p -r1.360 readelf.c
*** binutils/readelf.c 17 Feb 2007 13:33:54 -0000 1.360
--- binutils/readelf.c 13 Mar 2007 17:13:48 -0000
*************** dump_section (Elf_Internal_Shdr *section
*** 7697,7703 ****
relsec < section_headers + elf_header.e_shnum;
++relsec)
{
! if (relsec->sh_type != SHT_RELA
|| SECTION_HEADER_INDEX (relsec->sh_info) >= elf_header.e_shnum
|| SECTION_HEADER (relsec->sh_info) != section
|| relsec->sh_size == 0
--- 7697,7703 ----
relsec < section_headers + elf_header.e_shnum;
++relsec)
{
! if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL)
|| SECTION_HEADER_INDEX (relsec->sh_info) >= elf_header.e_shnum
|| SECTION_HEADER (relsec->sh_info) != section
|| relsec->sh_size == 0