[PATCH] Fix duplicate output section statement lookup
Alan Modra
amodra@gmail.com
Fri Jan 17 06:33:00 GMT 2014
On Thu, Jan 16, 2014 at 04:32:46PM +0100, Guy Martin wrote:
> Instead of trying to lookup the output section statement associated with
> an output section, we assign the output section statement to the section
> userdata and retreive it as needed. This also fix an issue occurring
> when multiple section with the same name exists, the wrong one was
> returned.
>
> * ldlang.h (lang_output_section_get): Define.
> * ldlang.c (lang_output_section_get): Likewise.
> (init_os): Set the output_section userdata to the output
> section statement.
> * emultempl/hppaelf.em: Use lang_output_section_get instead of
> lang_output_section_find where applicable.
> * emultempl/aarch64elf.em: Likewise.
> * emultempl/aix.em: Likewise.
> * emultempl/armelf.em: Likewise.
> * emultempl/metagelf.em: Likewise.
> * emultempl/mipself.em: Likewise.
> * emultempl/ppc64elf.em: Likewise.
> * emultempl/spuelf.em: Likewise.
> * emultempl/m68hc1xelf.em: Likewise.
This looks OK, except for the spuelf.em patch.
> if (o != NULL)
> - output_name = o->name;
> - os = lang_output_section_find (output_name);
> + os = lang_output_section_get (o);
Please keep the lookup when o is NULL. OK with that fixed.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list