Start mass upgrade
[dragora.git] / patches / binutils / 2.35 / binutils-elf-add-objects.patch
blobfbe73bb6b3bbf396b031513a209d7c2ca6aaa152
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
4 const char *name;
5 size_t indx;
7 + if (h->root.type == bfd_link_hash_defined
8 + || h->root.type == bfd_link_hash_defweak)
9 + {
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)
14 + return TRUE;
15 + }
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,
21 break;
24 - /* Don't add DT_NEEDED for references from the dummy bfd nor
25 - for unmatched symbol. */
26 if (!add_needed
27 && matched
28 && definition
29 && ((dynsym
30 - && h->ref_regular_nonweak
31 - && (old_bfd == NULL
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),