This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] bfd/ld bug when using linker plugins and dynobj is dynamic
- From: Alan Modra <amodra at gmail dot com>
- To: Kwok Cheung Yeung <kcy at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 1 Jun 2013 13:20:37 +0930
- Subject: Re: [PATCH] bfd/ld bug when using linker plugins and dynobj is dynamic
- References: <51A949C1 dot 1090003 at codesourcery dot com>
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