1 --- binutils.orig/bfd/elflink.c 2020-07-31 10:45:48.747912761 +0100
2 +++ binutils-2.35/bfd/elflink.c 2020-07-31 10:47:26.336262770 +0100
3 @@ -505,6 +505,16 @@ bfd_elf_link_record_dynamic_symbol (stru
7 + if (h->root.type == bfd_link_hash_defined
8 + || h->root.type == bfd_link_hash_defweak)
10 + /* An IR symbol should not be made dynamic. */
11 + if (h->root.u.def.section != NULL
12 + && h->root.u.def.section->owner != NULL
13 + && (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0)
17 /* XXX: The ABI draft says the linker must turn hidden and
18 internal symbols into STB_LOCAL symbols when producing the
19 DSO. However, if ld.so honors st_other in the dynamic table,
20 @@ -5199,15 +5209,11 @@ elf_link_add_object_symbols (bfd *abfd,
24 - /* Don't add DT_NEEDED for references from the dummy bfd nor
25 - for unmatched symbol. */
30 - && h->ref_regular_nonweak
32 - || (old_bfd->flags & BFD_PLUGIN) == 0))
33 + && h->ref_regular_nonweak)
34 || (h->ref_dynamic_nonweak
35 && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
36 && !on_needed_list (elf_dt_name (abfd),