[PATCH] Don't attempt to place symbols into a discarded .dynsym

Alan Modra amodra@gmail.com
Tue Oct 9 07:07:00 GMT 2018


On Wed, Oct 03, 2018 at 11:27:32PM +0200, Egeyar Bagcioglu wrote:
> diff --git a/bfd/elflink.c b/bfd/elflink.c
> index 02618be..f451309 100644
> --- a/bfd/elflink.c
> +++ b/bfd/elflink.c
> @@ -10025,6 +10025,7 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
>       there now.  We already know the symbol index.  We also fill in
>       the entry in the .hash section.  */
>    if (elf_hash_table (flinfo->info)->dynsym != NULL
> +      && !discarded_section(elf_hash_table (flinfo->info)->dynsym)
>        && h->dynindx != -1
>        && elf_hash_table (flinfo->info)->dynamic_sections_created)
>      {

I applied this patch with the conditions reordered so as to test the
most likely false condition first.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list