This is the mail archive of the binutils@sourceware.org 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] Don't attempt to place symbols into a discarded .dynsym


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


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