This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Don't attempt to place symbols into a discarded .dynsym
- From: Alan Modra <amodra at gmail dot com>
- To: Egeyar Bagcioglu <egeyar dot bagcioglu at oracle dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 9 Oct 2018 17:37:47 +1030
- Subject: Re: [PATCH] Don't attempt to place symbols into a discarded .dynsym
- References: <35738930-849b-d2ee-498d-befbd99dddb4@oracle.com>
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