This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More rel/rela fixes for ld -r


On 09/29/2010 05:10 PM, Alan Modra wrote:
> Fair enough.  I do like the general aim of your patch, and realize
> that it's often easier to make a more comprehensive change correct,
> rather than messing around with minimal changes. 

Here's a new patch.  I've added code in elf_fake_section to
automatically generate rel and/or rela sections when doing a relocatable
link.

Most of the changes in the ports were relatively straightforward;
everything that accessed the rel_hdr member directly I've changed to use
a new function _bfd_elf_single_rel_hdr which picks either rel or rela
and asserts that the other is empty.

For three ports did I have to do something more involved:
 * elfxx-mips.c had a MIPS_RELOC_RELA_P which seemed redundant with
   mips_elf_rel_relocation_p, so I've changed its user and deleted
   the macro.
 * In elf32-m32r.c I had to delete the fake_sections function.  It
   should be unnecessary with the change in elf_fake_sections
   mentioned above.  elf32-tic6x has the same change.
 * elf64-ppc accesses an uninitialized rel_hdr structure in get_relocs.
   This happens for brlt and stub sections which the backend creates.
   I've changed it to simply allocate memory for rela.hdr; the
   testcase worked after this change.

For testing, I picked the list of targets in
http://sourceware.org/ml/binutils/2010-09/msg00287.html, built a cross
tree for each, and compared check-ld check-gas check-binutils results
before and after.  tic54x fails to build before and after; otherwise no
new failures.  The ld-elf/64ksec-r failure on tic6x that Joseph noticed
goes away.


Bernd

Attachment: relrela-1001c.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]