[PATCH] another discarded DWARF issue

Bob Wilson bwilson@tensilica.com
Tue Oct 16 00:10:00 GMT 2007


Bob Wilson wrote:
> * The comparison of the kept section size in _bfd_elf_check_kept_section 
> does not account for changes in the section size due to linker 
> relaxation.  You may start with a bunch of identical linkonce sections, 
> but only the one that is kept will be relaxed.  If the kept section 
> changes size, the comparison will fail (or worse, match when it 
> shouldn't -- see below).

Replying to my own patch here....  Besides a formatting problem, I noticed that 
the change to elflink.c was comparing apples and oranges.  It probably doesn't 
matter in practice, but I revised the patch to compare the sizes from the ELF 
section headers for both sections.  I'm leaving out the Xtensa-specific part of 
the patch, in case that makes it easier for someone to review this piece.

I ran the testsuite with no regressions for an i686-pc-linux-gnu build, and when 
combined with further changes in elf32-xtensa.c, I verified that this fixes the 
problems for an xtensa-elf target with the testcase for bug 2342.

Is this OK?

2007-10-15  Bob Wilson  <bob.wilson@acm.org>

	* elflink.c (_bfd_elf_check_kept_section): Compare the section sizes
	from the ELF headers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-linkonce-dwarf-2a.patch
Type: text/x-diff
Size: 744 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20071016/8a0abea7/attachment.bin>


More information about the Binutils mailing list