[PATCH] bfd/ld bug when using linker plugins and dynobj is dynamic
Alan Modra
amodra@gmail.com
Sat Jun 1 03:50:00 GMT 2013
On Sat, Jun 01, 2013 at 02:09:21AM +0100, Kwok Cheung Yeung wrote:
> * elf-bfd.h (struct elf_obj_tdata): Add new field.
> (elf_dynamic): New macro.
> * elf.c (bfd_section_from_shdr): Set elf_dynamic when a dynamic section
> is encountered.
> * elflink.c (elf_link_add_object_symbols): Lookup BFD and ELF sections
> corresponding to dynamic section using elf_dynamic rather than by
> name. Do not clear section list if the current BFD is used to store
> linker-generated sections.
OK. Thanks for taking the time to write a clear description of
exactly what was going wrong. That makes reviewing easy.
Can I interest you in a followup patch? There are a number of places
in the code that call
bfd_get_section_by_name (abfd, ".dynamic").
Those that are reading input .dynamic sections ought to be converted
to use elf_dynamic. eg. bfd_elf_get_bfd_needed_list.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list