This is the mail archive of the 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: [PATCH] Fix duplicate output section statement lookup

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

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