Message ID | 20210330031829.GO5425@bubble.grove.modra.org |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
diff --git a/bfd/elflink.c b/bfd/elflink.c index 6be14e7c333..c7102e691f1 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4968,13 +4968,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + *sym_hash = h; + /* Setting the index to -3 tells elf_link_output_extsym that this symbol is defined in a discarded section. */ - if (discarded) + if (discarded && is_elf_hash_table (htab)) h->indx = -3; - *sym_hash = h; - new_weak = (flags & BSF_WEAK) != 0; if (dynamic && definition