1 diff -rup binutils.orig/bfd/Makefile.am binutils-2.35/bfd/Makefile.am
2 --- binutils.orig/bfd/Makefile.am 2020-07-30 08:41:25.057236290 +0100
3 +++ binutils-2.35/bfd/Makefile.am 2020-07-30 09:05:24.474019185 +0100
4 @@ -946,8 +946,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD
5 bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
7 @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
8 - bfd_version_string="\"$(VERSION)-3.fc33\"" ;\
9 - bfd_soversion="$(VERSION)-3.fc33" ;\
10 + bfd_version_string="\"$(VERSION)-4.fc33\"" ;\
11 + bfd_soversion="$(VERSION)-4.fc33" ;\
12 bfd_version_package="\"$(PKGVERSION)\"" ;\
13 report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
14 . $(srcdir)/development.sh ;\
15 diff -rup binutils.orig/bfd/Makefile.in binutils-2.35/bfd/Makefile.in
16 --- binutils.orig/bfd/Makefile.in 2020-07-30 08:41:25.043236381 +0100
17 +++ binutils-2.35/bfd/Makefile.in 2020-07-30 09:05:24.476019172 +0100
18 @@ -2058,8 +2058,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
19 bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
21 @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
22 - bfd_version_string="\"$(VERSION)-3.fc33\"" ;\
23 - bfd_soversion="$(VERSION)-3.fc33" ;\
24 + bfd_version_string="\"$(VERSION)-4.fc33\"" ;\
25 + bfd_soversion="$(VERSION)-4.fc33" ;\
26 bfd_version_package="\"$(PKGVERSION)\"" ;\
27 report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
28 . $(srcdir)/development.sh ;\
29 diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.35/bfd/elf-bfd.h
30 --- binutils.orig/bfd/elf-bfd.h 2020-07-30 08:41:25.041236395 +0100
31 +++ binutils-2.35/bfd/elf-bfd.h 2020-07-30 09:06:39.392533879 +0100
32 @@ -224,6 +224,10 @@ struct elf_link_hash_entry
33 a strong defined symbol alias. U.ALIAS points to a list of aliases,
34 the definition having is_weakalias clear. */
35 unsigned int is_weakalias : 1;
36 + /* There is relocation against symbol in the object. NB: It is only
37 + set and used by elf_link_add_object_symbols after all LTO IR symbols
39 + unsigned int has_reloc_after_lto_all_symbols_read : 1;
41 /* String table index in .dynstr if this is a dynamic symbol. */
42 unsigned long dynstr_index;
43 @@ -549,6 +553,16 @@ enum elf_target_os
44 is_nacl /* Native Client. */
47 +/* Used by bfd_sym_from_r_symndx to cache a small number of local
49 +#define LOCAL_SYM_CACHE_SIZE 32
53 + unsigned long indx[LOCAL_SYM_CACHE_SIZE];
54 + Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE];
57 /* ELF linker hash table. */
59 struct elf_link_hash_table
60 @@ -676,6 +690,9 @@ struct elf_link_hash_table
61 /* A linked list of dynamic BFD's loaded in the link. */
62 struct elf_link_loaded_list *dyn_loaded;
64 + /* Small local sym cache. */
65 + struct sym_cache sym_cache;
67 /* Short-cuts to get to dynamic linker sections. */
70 @@ -717,16 +734,6 @@ struct elf_link_hash_table
71 /* Returns TRUE if the hash table is a struct elf_link_hash_table. */
72 #define is_elf_hash_table(htab) \
73 (((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table)
75 -/* Used by bfd_sym_from_r_symndx to cache a small number of local
77 -#define LOCAL_SYM_CACHE_SIZE 32
81 - unsigned long indx[LOCAL_SYM_CACHE_SIZE];
82 - Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE];
85 /* Constant information held for an ELF backend. */
87 diff -rup binutils.orig/bfd/elf32-arm.c binutils-2.35/bfd/elf32-arm.c
88 --- binutils.orig/bfd/elf32-arm.c 2020-07-30 08:41:25.051236329 +0100
89 +++ binutils-2.35/bfd/elf32-arm.c 2020-07-30 09:06:39.393533872 +0100
90 @@ -3390,9 +3390,6 @@ struct elf32_arm_link_hash_table
94 - /* Small local sym cache. */
95 - struct sym_cache sym_cache;
97 /* For convenience in allocate_dynrelocs. */
100 @@ -15316,7 +15313,7 @@ elf32_arm_check_relocs (bfd *abfd, struc
101 if (r_symndx < symtab_hdr->sh_info)
103 /* A local symbol. */
104 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
105 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
109 @@ -16871,7 +16868,8 @@ elf32_arm_size_dynamic_sections (bfd * o
113 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, symndx);
114 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ibfd,
119 diff -rup binutils.orig/bfd/elf32-bfin.c binutils-2.35/bfd/elf32-bfin.c
120 --- binutils.orig/bfd/elf32-bfin.c 2020-07-30 08:41:25.051236329 +0100
121 +++ binutils-2.35/bfd/elf32-bfin.c 2020-07-30 09:06:39.394533866 +0100
122 @@ -4791,16 +4791,6 @@ struct bfin_link_hash_entry
123 struct bfin_pcrel_relocs_copied *pcrel_relocs_copied;
126 -/* bfin ELF linker hash table. */
128 -struct bfin_link_hash_table
130 - struct elf_link_hash_table root;
132 - /* Small local sym cache. */
133 - struct sym_cache sym_cache;
136 #define bfin_hash_entry(ent) ((struct bfin_link_hash_entry *) (ent))
138 static struct bfd_hash_entry *
139 @@ -4829,15 +4819,14 @@ bfin_link_hash_newfunc (struct bfd_hash_
140 static struct bfd_link_hash_table *
141 bfin_link_hash_table_create (bfd * abfd)
143 - struct bfin_link_hash_table *ret;
144 - size_t amt = sizeof (struct bfin_link_hash_table);
145 + struct elf_link_hash_table *ret;
146 + size_t amt = sizeof (struct elf_link_hash_table);
148 ret = bfd_zmalloc (amt);
152 - if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
153 - bfin_link_hash_newfunc,
154 + if (!_bfd_elf_link_hash_table_init (ret, abfd, bfin_link_hash_newfunc,
155 sizeof (struct elf_link_hash_entry),
158 @@ -4845,9 +4834,7 @@ bfin_link_hash_table_create (bfd * abfd)
162 - ret->sym_cache.abfd = NULL;
164 - return &ret->root.root;
168 /* The size in bytes of an entry in the procedure linkage table. */
169 @@ -5418,10 +5405,6 @@ struct bfd_elf_special_section const elf
171 #define bfd_elf32_bfd_is_local_label_name \
172 bfin_is_local_label_name
173 -#define bfin_hash_table(p) \
174 - ((struct bfin_link_hash_table *) (p)->hash)
178 #define elf_backend_create_dynamic_sections \
179 _bfd_elf_create_dynamic_sections
180 diff -rup binutils.orig/bfd/elf32-csky.c binutils-2.35/bfd/elf32-csky.c
181 --- binutils.orig/bfd/elf32-csky.c 2020-07-30 08:41:25.053236316 +0100
182 +++ binutils-2.35/bfd/elf32-csky.c 2020-07-30 09:06:39.394533866 +0100
183 @@ -1208,9 +1208,6 @@ struct csky_elf_link_hash_table
185 struct elf_link_hash_table elf;
187 - /* Small local sym cache. */
188 - struct sym_cache sym_cache;
190 /* Data for R_CKCORE_TLS_LDM32 relocations. */
193 @@ -2477,7 +2474,7 @@ csky_elf_check_relocs (bfd * abfd,
194 if (r_symndx < symtab_hdr->sh_info)
196 /* A local symbol. */
197 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
198 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
202 @@ -2584,7 +2581,7 @@ csky_elf_check_relocs (bfd * abfd,
204 Elf_Internal_Sym *loc_isym;
206 - loc_isym = bfd_sym_from_r_symndx (&htab->sym_cache,
207 + loc_isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
209 if (loc_isym == NULL)
211 diff -rup binutils.orig/bfd/elf32-hppa.c binutils-2.35/bfd/elf32-hppa.c
212 --- binutils.orig/bfd/elf32-hppa.c 2020-07-30 08:41:25.043236381 +0100
213 +++ binutils-2.35/bfd/elf32-hppa.c 2020-07-30 09:06:39.394533866 +0100
214 @@ -286,9 +286,6 @@ struct elf32_hppa_link_hash_table
215 /* Set if we need a .plt stub to support lazy dynamic linking. */
216 unsigned int need_plt_stub:1;
218 - /* Small local sym cache. */
219 - struct sym_cache sym_cache;
221 /* Data for LDM relocations. */
224 @@ -1465,7 +1462,7 @@ elf32_hppa_check_relocs (bfd *abfd,
226 Elf_Internal_Sym *isym;
228 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
229 + isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache,
233 @@ -4038,7 +4035,7 @@ elf32_hppa_relocate_section (bfd *output
236 Elf_Internal_Sym *isym
237 - = bfd_sym_from_r_symndx (&htab->sym_cache,
238 + = bfd_sym_from_r_symndx (&htab->etab.sym_cache,
239 input_bfd, r_symndx);
242 diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.35/bfd/elf32-i386.c
243 --- binutils.orig/bfd/elf32-i386.c 2020-07-30 08:41:25.055236303 +0100
244 +++ binutils-2.35/bfd/elf32-i386.c 2020-07-30 09:06:39.395533860 +0100
245 @@ -1158,7 +1158,7 @@ elf_i386_tls_transition (struct bfd_link
247 Elf_Internal_Sym *isym;
249 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
250 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
252 name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
254 @@ -1251,7 +1251,7 @@ elf_i386_convert_load_reloc (bfd *abfd,
258 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd,
259 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd,
261 abs_symbol = isym->st_shndx == SHN_ABS;
263 @@ -1529,7 +1529,7 @@ elf_i386_check_relocs (bfd *abfd,
264 if (r_symndx < symtab_hdr->sh_info)
266 /* A local symbol. */
267 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
268 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
272 @@ -1859,7 +1859,7 @@ elf_i386_check_relocs (bfd *abfd,
276 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
277 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
281 diff -rup binutils.orig/bfd/elf32-m32r.c binutils-2.35/bfd/elf32-m32r.c
282 --- binutils.orig/bfd/elf32-m32r.c 2020-07-30 08:41:25.045236368 +0100
283 +++ binutils-2.35/bfd/elf32-m32r.c 2020-07-30 09:06:39.395533860 +0100
284 @@ -1498,20 +1498,6 @@ struct elf_m32r_pcrel_relocs_copied
288 -/* m32r ELF linker hash table. */
290 -struct elf_m32r_link_hash_table
292 - struct elf_link_hash_table root;
294 - /* Short-cuts to get to dynamic linker sections. */
298 - /* Small local sym cache. */
299 - struct sym_cache sym_cache;
302 /* Traverse an m32r ELF linker hash table. */
304 #define m32r_elf_link_hash_traverse(table, func, info) \
305 @@ -1524,21 +1510,21 @@ struct elf_m32r_link_hash_table
307 #define m32r_elf_hash_table(p) \
308 (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
309 - == M32R_ELF_DATA ? ((struct elf_m32r_link_hash_table *) ((p)->hash)) : NULL)
310 + == M32R_ELF_DATA ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL)
312 /* Create an m32r ELF linker hash table. */
314 static struct bfd_link_hash_table *
315 m32r_elf_link_hash_table_create (bfd *abfd)
317 - struct elf_m32r_link_hash_table *ret;
318 - size_t amt = sizeof (struct elf_m32r_link_hash_table);
319 + struct elf_link_hash_table *ret;
320 + size_t amt = sizeof (struct elf_link_hash_table);
322 ret = bfd_zmalloc (amt);
326 - if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
327 + if (!_bfd_elf_link_hash_table_init (ret, abfd,
328 _bfd_elf_link_hash_newfunc,
329 sizeof (struct elf_link_hash_entry),
331 @@ -1547,7 +1533,7 @@ m32r_elf_link_hash_table_create (bfd *ab
335 - return &ret->root.root;
339 /* Create dynamic sections when linking against a dynamic object. */
340 @@ -1555,7 +1541,7 @@ m32r_elf_link_hash_table_create (bfd *ab
342 m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
344 - struct elf_m32r_link_hash_table *htab;
345 + struct elf_link_hash_table *htab;
346 flagword flags, pltflags;
348 const struct elf_backend_data *bed = get_elf_backend_data (abfd);
349 @@ -1578,7 +1564,7 @@ m32r_elf_create_dynamic_sections (bfd *a
350 pltflags |= SEC_READONLY;
352 s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
353 - htab->root.splt = s;
356 || !bfd_set_section_alignment (s, bed->plt_alignment))
358 @@ -1598,7 +1584,7 @@ m32r_elf_create_dynamic_sections (bfd *a
359 h = (struct elf_link_hash_entry *) bh;
361 h->type = STT_OBJECT;
362 - htab->root.hplt = h;
365 if (bfd_link_pic (info)
366 && ! bfd_elf_link_record_dynamic_symbol (info, h))
367 @@ -1609,12 +1595,12 @@ m32r_elf_create_dynamic_sections (bfd *a
368 bed->default_use_rela_p
369 ? ".rela.plt" : ".rel.plt",
370 flags | SEC_READONLY);
371 - htab->root.srelplt = s;
374 || !bfd_set_section_alignment (s, ptralign))
377 - if (htab->root.sgot == NULL
378 + if (htab->sgot == NULL
379 && !_bfd_elf_create_got_section (abfd, info))
382 @@ -1669,7 +1655,7 @@ static bfd_boolean
383 m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
384 struct elf_link_hash_entry *h)
386 - struct elf_m32r_link_hash_table *htab;
387 + struct elf_link_hash_table *htab;
391 @@ -1796,7 +1782,7 @@ static bfd_boolean
392 allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
394 struct bfd_link_info *info;
395 - struct elf_m32r_link_hash_table *htab;
396 + struct elf_link_hash_table *htab;
397 struct elf_dyn_relocs *p;
399 if (h->root.type == bfd_link_hash_indirect)
400 @@ -1807,7 +1793,7 @@ allocate_dynrelocs (struct elf_link_hash
404 - if (htab->root.dynamic_sections_created
405 + if (htab->dynamic_sections_created
406 && h->plt.refcount > 0)
408 /* Make sure this symbol is output as a dynamic symbol.
409 @@ -1821,7 +1807,7 @@ allocate_dynrelocs (struct elf_link_hash
411 if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
413 - asection *s = htab->root.splt;
414 + asection *s = htab->splt;
416 /* If this is the first .plt entry, make room for the special
418 @@ -1847,10 +1833,10 @@ allocate_dynrelocs (struct elf_link_hash
420 /* We also need to make an entry in the .got.plt section, which
421 will be placed in the .got section by the linker script. */
422 - htab->root.sgotplt->size += 4;
423 + htab->sgotplt->size += 4;
425 /* We also need to make an entry in the .rel.plt section. */
426 - htab->root.srelplt->size += sizeof (Elf32_External_Rela);
427 + htab->srelplt->size += sizeof (Elf32_External_Rela);
431 @@ -1878,13 +1864,13 @@ allocate_dynrelocs (struct elf_link_hash
435 - s = htab->root.sgot;
438 h->got.offset = s->size;
440 - dyn = htab->root.dynamic_sections_created;
441 + dyn = htab->dynamic_sections_created;
442 if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h))
443 - htab->root.srelgot->size += sizeof (Elf32_External_Rela);
444 + htab->srelgot->size += sizeof (Elf32_External_Rela);
447 h->got.offset = (bfd_vma) -1;
448 @@ -1944,7 +1930,7 @@ allocate_dynrelocs (struct elf_link_hash
452 - || (htab->root.dynamic_sections_created
453 + || (htab->dynamic_sections_created
454 && (h->root.type == bfd_link_hash_undefweak
455 || h->root.type == bfd_link_hash_undefined))))
457 @@ -1984,7 +1970,7 @@ static bfd_boolean
458 m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
459 struct bfd_link_info *info)
461 - struct elf_m32r_link_hash_table *htab;
462 + struct elf_link_hash_table *htab;
466 @@ -1998,10 +1984,10 @@ m32r_elf_size_dynamic_sections (bfd *out
470 - dynobj = htab->root.dynobj;
471 + dynobj = htab->dynobj;
472 BFD_ASSERT (dynobj != NULL);
474 - if (htab->root.dynamic_sections_created)
475 + if (htab->dynamic_sections_created)
477 /* Set the contents of the .interp section to the interpreter. */
478 if (bfd_link_executable (info) && !info->nointerp)
479 @@ -2060,8 +2046,8 @@ m32r_elf_size_dynamic_sections (bfd *out
480 symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
481 locsymcount = symtab_hdr->sh_info;
482 end_local_got = local_got + locsymcount;
483 - s = htab->root.sgot;
484 - srel = htab->root.srelgot;
486 + srel = htab->srelgot;
487 for (; local_got < end_local_got; ++local_got)
490 @@ -2078,7 +2064,7 @@ m32r_elf_size_dynamic_sections (bfd *out
492 /* Allocate global sym .plt and .got entries, and space for global
493 sym dynamic relocs. */
494 - elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info);
495 + elf_link_hash_traverse (htab, allocate_dynrelocs, info);
497 /* We now have determined the sizes of the various dynamic sections.
498 Allocate memory for them. */
499 @@ -2088,9 +2074,9 @@ m32r_elf_size_dynamic_sections (bfd *out
500 if ((s->flags & SEC_LINKER_CREATED) == 0)
503 - if (s == htab->root.splt
504 - || s == htab->root.sgot
505 - || s == htab->root.sgotplt
506 + if (s == htab->splt
508 + || s == htab->sgotplt
509 || s == htab->sdynbss)
511 /* Strip this section if we don't need it; see the
512 @@ -2098,7 +2084,7 @@ m32r_elf_size_dynamic_sections (bfd *out
514 else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
516 - if (s->size != 0 && s != htab->root.srelplt)
517 + if (s->size != 0 && s != htab->srelplt)
520 /* We use the reloc_count field as a counter if we need
521 @@ -2188,7 +2174,7 @@ m32r_elf_relocate_section (bfd *output_b
522 Elf_Internal_Rela *rel, *relend;
523 /* Assume success. */
524 bfd_boolean ret = TRUE;
525 - struct elf_m32r_link_hash_table *htab = m32r_elf_hash_table (info);
526 + struct elf_link_hash_table *htab = m32r_elf_hash_table (info);
527 bfd_vma *local_got_offsets;
528 asection *sgot, *splt, *sreloc;
529 bfd_vma high_address = bfd_get_section_limit (input_bfd, input_section);
530 @@ -2198,8 +2184,8 @@ m32r_elf_relocate_section (bfd *output_b
532 local_got_offsets = elf_local_got_offsets (input_bfd);
534 - sgot = htab->root.sgot;
535 - splt = htab->root.splt;
541 @@ -2295,7 +2281,7 @@ m32r_elf_relocate_section (bfd *output_b
543 sec = h->root.u.def.section;
545 - dyn = htab->root.dynamic_sections_created;
546 + dyn = htab->dynamic_sections_created;
547 sec = h->root.u.def.section;
548 if (r_type == R_M32R_GOTPC24
549 || (r_type == R_M32R_GOTPC_HI_ULO
550 @@ -2516,7 +2502,7 @@ m32r_elf_relocate_section (bfd *output_b
552 BFD_ASSERT (off != (bfd_vma) -1);
554 - dyn = htab->root.dynamic_sections_created;
555 + dyn = htab->dynamic_sections_created;
556 if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
559 @@ -2576,7 +2562,7 @@ m32r_elf_relocate_section (bfd *output_b
561 /* We need to generate a R_M32R_RELATIVE reloc
562 for the dynamic linker. */
563 - srelgot = htab->root.srelgot;
564 + srelgot = htab->srelgot;
565 BFD_ASSERT (srelgot != NULL);
567 outrel.r_offset = (sgot->output_section->vma
568 @@ -2892,7 +2878,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out
569 struct elf_link_hash_entry *h,
570 Elf_Internal_Sym *sym)
572 - struct elf_m32r_link_hash_table *htab;
573 + struct elf_link_hash_table *htab;
577 @@ -2918,9 +2904,9 @@ m32r_elf_finish_dynamic_symbol (bfd *out
579 BFD_ASSERT (h->dynindx != -1);
581 - splt = htab->root.splt;
582 - sgot = htab->root.sgotplt;
583 - srela = htab->root.srelplt;
585 + sgot = htab->sgotplt;
586 + srela = htab->srelplt;
587 BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
589 /* Get the index in the procedure linkage table which
590 @@ -3014,8 +3000,8 @@ m32r_elf_finish_dynamic_symbol (bfd *out
591 /* This symbol has an entry in the global offset table. Set it
594 - sgot = htab->root.sgot;
595 - srela = htab->root.srelgot;
597 + srela = htab->srelgot;
598 BFD_ASSERT (sgot != NULL && srela != NULL);
600 rela.r_offset = (sgot->output_section->vma
601 @@ -3063,7 +3049,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out
602 && (h->root.type == bfd_link_hash_defined
603 || h->root.type == bfd_link_hash_defweak));
605 - s = bfd_get_linker_section (htab->root.dynobj, ".rela.bss");
606 + s = bfd_get_linker_section (htab->dynobj, ".rela.bss");
607 BFD_ASSERT (s != NULL);
609 rela.r_offset = (h->root.u.def.value
610 @@ -3078,7 +3064,7 @@ m32r_elf_finish_dynamic_symbol (bfd *out
613 /* Mark some specially defined symbols as absolute. */
614 - if (h == htab->root.hdynamic || h == htab->root.hgot)
615 + if (h == htab->hdynamic || h == htab->hgot)
616 sym->st_shndx = SHN_ABS;
619 @@ -3091,7 +3077,7 @@ static bfd_boolean
620 m32r_elf_finish_dynamic_sections (bfd *output_bfd,
621 struct bfd_link_info *info)
623 - struct elf_m32r_link_hash_table *htab;
624 + struct elf_link_hash_table *htab;
628 @@ -3104,12 +3090,12 @@ m32r_elf_finish_dynamic_sections (bfd *o
632 - dynobj = htab->root.dynobj;
633 + dynobj = htab->dynobj;
635 - sgot = htab->root.sgotplt;
636 + sgot = htab->sgotplt;
637 sdyn = bfd_get_linker_section (dynobj, ".dynamic");
639 - if (htab->root.dynamic_sections_created)
640 + if (htab->dynamic_sections_created)
643 Elf32_External_Dyn *dyncon, *dynconend;
644 @@ -3132,17 +3118,17 @@ m32r_elf_finish_dynamic_sections (bfd *o
648 - s = htab->root.sgotplt;
652 - s = htab->root.srelplt;
655 dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
656 bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
660 - s = htab->root.srelplt;
662 dyn.d_un.d_val = s->size;
663 bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
665 @@ -3150,7 +3136,7 @@ m32r_elf_finish_dynamic_sections (bfd *o
668 /* Fill in the first entry in the procedure linkage table. */
669 - splt = htab->root.splt;
671 if (splt && splt->size > 0)
673 if (bfd_link_pic (info))
674 @@ -3369,7 +3355,7 @@ m32r_elf_check_relocs (bfd *abfd,
675 struct elf_link_hash_entry **sym_hashes;
676 const Elf_Internal_Rela *rel;
677 const Elf_Internal_Rela *rel_end;
678 - struct elf_m32r_link_hash_table *htab;
679 + struct elf_link_hash_table *htab;
683 @@ -3384,7 +3370,7 @@ m32r_elf_check_relocs (bfd *abfd,
687 - dynobj = htab->root.dynobj;
688 + dynobj = htab->dynobj;
690 rel_end = relocs + sec->reloc_count;
691 for (rel = relocs; rel < rel_end; rel++)
692 @@ -3406,7 +3392,7 @@ m32r_elf_check_relocs (bfd *abfd,
695 /* Some relocs require a global offset table. */
696 - if (htab->root.sgot == NULL)
697 + if (htab->sgot == NULL)
701 @@ -3423,7 +3409,7 @@ m32r_elf_check_relocs (bfd *abfd,
702 case R_M32R_GOTPC_LO:
705 - htab->root.dynobj = dynobj = abfd;
706 + htab->dynobj = dynobj = abfd;
707 if (!_bfd_elf_create_got_section (dynobj, info))
710 @@ -3540,7 +3526,7 @@ m32r_elf_check_relocs (bfd *abfd,
711 struct elf_dyn_relocs **head;
714 - htab->root.dynobj = dynobj = abfd;
715 + htab->dynobj = dynobj = abfd;
717 /* When creating a shared object, we must copy these
718 relocs into the output file. We create a reloc
719 diff -rup binutils.orig/bfd/elf32-m68hc1x.h binutils-2.35/bfd/elf32-m68hc1x.h
720 --- binutils.orig/bfd/elf32-m68hc1x.h 2020-07-30 08:41:25.053236316 +0100
721 +++ binutils-2.35/bfd/elf32-m68hc1x.h 2020-07-30 09:06:39.395533860 +0100
722 @@ -120,9 +120,6 @@ struct m68hc11_elf_link_hash_table
724 asection **input_list;
726 - /* Small local sym cache. */
727 - struct sym_cache sym_cache;
729 bfd_boolean (* size_one_stub) (struct bfd_hash_entry*, void*);
730 bfd_boolean (* build_one_stub) (struct bfd_hash_entry*, void*);
732 diff -rup binutils.orig/bfd/elf32-m68k.c binutils-2.35/bfd/elf32-m68k.c
733 --- binutils.orig/bfd/elf32-m68k.c 2020-07-30 08:41:25.038236414 +0100
734 +++ binutils-2.35/bfd/elf32-m68k.c 2020-07-30 09:06:39.395533860 +0100
735 @@ -889,9 +889,6 @@ struct elf_m68k_link_hash_table
737 struct elf_link_hash_table root;
739 - /* Small local sym cache. */
740 - struct sym_cache sym_cache;
742 /* The PLT format used by this link, or NULL if the format has not
744 const struct elf_m68k_plt_info *plt_info;
745 @@ -2836,7 +2833,7 @@ elf_m68k_check_relocs (bfd *abfd,
747 Elf_Internal_Sym *isym;
749 - isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->sym_cache,
750 + isym = bfd_sym_from_r_symndx (&elf_m68k_hash_table (info)->root.sym_cache,
754 diff -rup binutils.orig/bfd/elf32-metag.c binutils-2.35/bfd/elf32-metag.c
755 --- binutils.orig/bfd/elf32-metag.c 2020-07-30 08:41:25.054236309 +0100
756 +++ binutils-2.35/bfd/elf32-metag.c 2020-07-30 09:06:39.396533853 +0100
757 @@ -823,9 +823,6 @@ struct elf_metag_link_hash_table
758 asection **input_list;
759 Elf_Internal_Sym **all_local_syms;
761 - /* Small local sym cache. */
762 - struct sym_cache sym_cache;
764 /* Data for LDM relocations. */
767 @@ -2098,7 +2095,7 @@ elf_metag_check_relocs (bfd *abfd,
768 if (r_symndx < symtab_hdr->sh_info)
770 /* A local symbol. */
771 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
772 + isym = bfd_sym_from_r_symndx (&htab->etab.sym_cache,
776 diff -rup binutils.orig/bfd/elf32-microblaze.c binutils-2.35/bfd/elf32-microblaze.c
777 --- binutils.orig/bfd/elf32-microblaze.c 2020-07-30 08:41:25.042236388 +0100
778 +++ binutils-2.35/bfd/elf32-microblaze.c 2020-07-30 09:06:39.396533853 +0100
779 @@ -744,9 +744,6 @@ struct elf32_mb_link_hash_table
781 struct elf_link_hash_table elf;
783 - /* Small local sym to section mapping cache. */
784 - struct sym_cache sym_sec;
786 /* TLS Local Dynamic GOT Entry */
788 bfd_signed_vma refcount;
789 @@ -2523,7 +2520,7 @@ microblaze_elf_check_relocs (bfd * abfd,
790 Elf_Internal_Sym *isym;
793 - isym = bfd_sym_from_r_symndx (&htab->sym_sec,
794 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
798 diff -rup binutils.orig/bfd/elf32-nds32.c binutils-2.35/bfd/elf32-nds32.c
799 --- binutils.orig/bfd/elf32-nds32.c 2020-07-30 08:41:25.040236401 +0100
800 +++ binutils-2.35/bfd/elf32-nds32.c 2020-07-30 09:06:39.397533847 +0100
801 @@ -3696,8 +3696,6 @@ nds32_elf_link_hash_table_create (bfd *a
805 - ret->sdynbss = NULL;
806 - ret->srelbss = NULL;
807 ret->sym_ld_script = NULL;
809 return &ret->root.root;
810 @@ -3833,7 +3831,7 @@ nds32_elf_create_dynamic_sections (bfd *
811 initialize them at run time. The linker script puts the .dynbss
812 section into the .bss section of the final image. */
813 s = bfd_make_section (abfd, ".dynbss");
815 + htab->root.sdynbss = s;
817 || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED))
819 @@ -3852,7 +3850,7 @@ nds32_elf_create_dynamic_sections (bfd *
821 s = bfd_make_section (abfd, (bed->default_use_rela_p
822 ? ".rela.bss" : ".rel.bss"));
824 + htab->root.srelbss = s;
826 || !bfd_set_section_flags (s, flags | SEC_READONLY)
827 || !bfd_set_section_alignment (s, ptralign))
828 @@ -3988,7 +3986,7 @@ nds32_elf_adjust_dynamic_symbol (struct
829 same memory location for the variable. */
831 htab = nds32_elf_hash_table (info);
833 + s = htab->root.sdynbss;
834 BFD_ASSERT (s != NULL);
836 /* We must generate a R_NDS32_COPY reloc to tell the dynamic linker
837 @@ -3999,7 +3997,7 @@ nds32_elf_adjust_dynamic_symbol (struct
841 - srel = htab->srelbss;
842 + srel = htab->root.srelbss;
843 BFD_ASSERT (srel != NULL);
844 srel->size += sizeof (Elf32_External_Rela);
846 @@ -7277,7 +7275,8 @@ nds32_elf_check_relocs (bfd *abfd, struc
849 Elf_Internal_Sym *isym;
850 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
851 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
856 diff -rup binutils.orig/bfd/elf32-nds32.h binutils-2.35/bfd/elf32-nds32.h
857 --- binutils.orig/bfd/elf32-nds32.h 2020-07-30 08:41:25.053236316 +0100
858 +++ binutils-2.35/bfd/elf32-nds32.h 2020-07-30 09:06:39.397533847 +0100
859 @@ -122,13 +122,6 @@ struct elf_nds32_link_hash_table
861 struct elf_link_hash_table root;
863 - /* Short-cuts to get to dynamic linker sections. */
867 - /* Small local sym to section mapping cache. */
868 - struct sym_cache sym_cache;
870 /* Target dependent options. */
871 int relax_fp_as_gp; /* --mrelax-omit-fp. */
872 int eliminate_gc_relocs; /* --meliminate-gc-relocs. */
873 diff -rup binutils.orig/bfd/elf32-nios2.c binutils-2.35/bfd/elf32-nios2.c
874 --- binutils.orig/bfd/elf32-nios2.c 2020-07-30 08:41:25.049236342 +0100
875 +++ binutils-2.35/bfd/elf32-nios2.c 2020-07-30 09:06:39.397533847 +0100
876 @@ -1808,9 +1808,6 @@ struct elf32_nios2_link_hash_table
880 - /* Small local sym cache. */
881 - struct sym_cache sym_cache;
886 @@ -4902,7 +4899,7 @@ nios2_elf32_check_relocs (bfd *abfd, str
888 Elf_Internal_Sym *isym;
890 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
891 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
895 diff -rup binutils.orig/bfd/elf32-or1k.c binutils-2.35/bfd/elf32-or1k.c
896 --- binutils.orig/bfd/elf32-or1k.c 2020-07-30 08:41:25.046236362 +0100
897 +++ binutils-2.35/bfd/elf32-or1k.c 2020-07-30 09:06:39.397533847 +0100
898 @@ -916,9 +916,6 @@ struct elf_or1k_link_hash_table
900 struct elf_link_hash_table root;
902 - /* Small local sym to section mapping cache. */
903 - struct sym_cache sym_sec;
905 bfd_boolean saw_plta;
908 @@ -2151,7 +2148,7 @@ or1k_elf_check_relocs (bfd *abfd,
909 Elf_Internal_Sym *isym;
912 - isym = bfd_sym_from_r_symndx (&htab->sym_sec,
913 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
917 diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.35/bfd/elf32-ppc.c
918 --- binutils.orig/bfd/elf32-ppc.c 2020-07-30 08:41:25.054236309 +0100
919 +++ binutils-2.35/bfd/elf32-ppc.c 2020-07-30 09:06:39.398533840 +0100
920 @@ -2212,9 +2212,6 @@ struct ppc_elf_link_hash_table
922 /* The size of the first PLT entry. */
923 int plt_initial_entry_size;
925 - /* Small local sym cache. */
926 - struct sym_cache sym_cache;
929 /* Rename some of the generic section flags to better document how they
930 @@ -2952,7 +2949,7 @@ ppc_elf_check_relocs (bfd *abfd,
932 if (h == NULL && htab->elf.target_os != is_vxworks)
934 - Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache,
935 + Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
939 @@ -3335,7 +3332,7 @@ ppc_elf_check_relocs (bfd *abfd,
941 Elf_Internal_Sym *isym;
943 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
944 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
948 @@ -3495,7 +3492,7 @@ ppc_elf_check_relocs (bfd *abfd,
950 Elf_Internal_Sym *isym;
952 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
953 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
957 diff -rup binutils.orig/bfd/elf32-s390.c binutils-2.35/bfd/elf32-s390.c
958 --- binutils.orig/bfd/elf32-s390.c 2020-07-30 08:41:25.051236329 +0100
959 +++ binutils-2.35/bfd/elf32-s390.c 2020-07-30 09:06:39.398533840 +0100
960 @@ -746,9 +746,6 @@ struct elf_s390_link_hash_table
961 bfd_signed_vma refcount;
965 - /* Small local sym cache. */
966 - struct sym_cache sym_cache;
969 /* Get the s390 ELF linker hash table from a link_info structure. */
970 @@ -930,7 +927,7 @@ elf_s390_check_relocs (bfd *abfd,
971 if (r_symndx < symtab_hdr->sh_info)
973 /* A local symbol. */
974 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
975 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
979 @@ -1281,7 +1278,7 @@ elf_s390_check_relocs (bfd *abfd,
983 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
984 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
988 @@ -3722,7 +3719,7 @@ elf_s390_finish_dynamic_sections (bfd *o
989 if (local_plt[i].plt.offset != (bfd_vma) -1)
991 asection *sec = local_plt[i].sec;
992 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i);
993 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i);
997 diff -rup binutils.orig/bfd/elf32-sh.c binutils-2.35/bfd/elf32-sh.c
998 --- binutils.orig/bfd/elf32-sh.c 2020-07-30 08:41:25.050236336 +0100
999 +++ binutils-2.35/bfd/elf32-sh.c 2020-07-30 09:06:39.398533840 +0100
1000 @@ -2160,8 +2160,6 @@ struct elf_sh_link_hash_table
1001 struct elf_link_hash_table root;
1003 /* Short-cuts to get to dynamic linker sections. */
1004 - asection *sdynbss;
1005 - asection *srelbss;
1006 asection *sfuncdesc;
1007 asection *srelfuncdesc;
1009 @@ -2169,9 +2167,6 @@ struct elf_sh_link_hash_table
1010 /* The (unloaded but important) VxWorks .rela.plt.unloaded section. */
1013 - /* Small local sym cache. */
1014 - struct sym_cache sym_cache;
1016 /* A counter or offset to track a TLS got entry. */
1019 @@ -2439,7 +2434,7 @@ sh_elf_create_dynamic_sections (bfd *abf
1020 section into the .bss section of the final image. */
1021 s = bfd_make_section_anyway_with_flags (abfd, ".dynbss",
1022 SEC_ALLOC | SEC_LINKER_CREATED);
1023 - htab->sdynbss = s;
1024 + htab->root.sdynbss = s;
1028 @@ -2460,7 +2455,7 @@ sh_elf_create_dynamic_sections (bfd *abf
1029 (bed->default_use_rela_p
1030 ? ".rela.bss" : ".rel.bss"),
1031 flags | SEC_READONLY);
1032 - htab->srelbss = s;
1033 + htab->root.srelbss = s;
1035 || !bfd_set_section_alignment (s, ptralign))
1037 @@ -2580,7 +2575,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd
1038 both the dynamic object and the regular object will refer to the
1039 same memory location for the variable. */
1041 - s = htab->sdynbss;
1042 + s = htab->root.sdynbss;
1043 BFD_ASSERT (s != NULL);
1045 /* We must generate a R_SH_COPY reloc to tell the dynamic linker to
1046 @@ -2591,7 +2586,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd
1050 - srel = htab->srelbss;
1051 + srel = htab->root.srelbss;
1052 BFD_ASSERT (srel != NULL);
1053 srel->size += sizeof (Elf32_External_Rela);
1055 @@ -3151,7 +3146,7 @@ sh_elf_size_dynamic_sections (bfd *outpu
1056 || s == htab->root.sgotplt
1057 || s == htab->sfuncdesc
1058 || s == htab->srofixup
1059 - || s == htab->sdynbss)
1060 + || s == htab->root.sdynbss)
1062 /* Strip this section if we don't need it; see the
1064 @@ -5679,7 +5674,7 @@ sh_elf_check_relocs (bfd *abfd, struct b
1066 Elf_Internal_Sym *isym;
1068 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1069 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
1073 diff -rup binutils.orig/bfd/elf32-tic6x.c binutils-2.35/bfd/elf32-tic6x.c
1074 --- binutils.orig/bfd/elf32-tic6x.c 2020-07-30 08:41:25.041236395 +0100
1075 +++ binutils-2.35/bfd/elf32-tic6x.c 2020-07-30 09:06:39.399533834 +0100
1076 @@ -46,9 +46,6 @@ struct elf32_tic6x_link_hash_table
1077 /* C6X specific command line arguments. */
1078 struct elf32_tic6x_params params;
1080 - /* Small local sym cache. */
1081 - struct sym_cache sym_cache;
1083 /* The output BFD, for convenience. */
1086 @@ -2729,7 +2726,7 @@ elf32_tic6x_check_relocs (bfd *abfd, str
1087 if (r_symndx < symtab_hdr->sh_info)
1089 /* A local symbol. */
1090 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1091 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1095 diff -rup binutils.orig/bfd/elf32-tilepro.c binutils-2.35/bfd/elf32-tilepro.c
1096 --- binutils.orig/bfd/elf32-tilepro.c 2020-07-30 08:41:25.039236408 +0100
1097 +++ binutils-2.35/bfd/elf32-tilepro.c 2020-07-30 09:06:39.399533834 +0100
1098 @@ -727,19 +727,11 @@ tilepro_elf_mkobject (bfd *abfd)
1099 #include "elf/common.h"
1100 #include "elf/internal.h"
1102 -struct tilepro_elf_link_hash_table
1104 - struct elf_link_hash_table elf;
1106 - /* Small local sym to section mapping cache. */
1107 - struct sym_cache sym_cache;
1110 /* Get the Tilepro ELF linker hash table from a link_info structure. */
1111 #define tilepro_elf_hash_table(p) \
1112 (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
1113 == TILEPRO_ELF_DATA \
1114 - ? ((struct tilepro_elf_link_hash_table *) ((p)->hash)) : NULL)
1115 + ? ((struct elf_link_hash_table *) ((p)->hash)) : NULL)
1117 static reloc_howto_type *
1118 tilepro_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
1119 @@ -1184,14 +1176,14 @@ link_hash_newfunc (struct bfd_hash_entry
1120 static struct bfd_link_hash_table *
1121 tilepro_elf_link_hash_table_create (bfd *abfd)
1123 - struct tilepro_elf_link_hash_table *ret;
1124 - size_t amt = sizeof (struct tilepro_elf_link_hash_table);
1125 + struct elf_link_hash_table *ret;
1126 + size_t amt = sizeof (struct elf_link_hash_table);
1128 - ret = (struct tilepro_elf_link_hash_table *) bfd_zmalloc (amt);
1129 + ret = (struct elf_link_hash_table *) bfd_zmalloc (amt);
1133 - if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc,
1134 + if (!_bfd_elf_link_hash_table_init (ret, abfd, link_hash_newfunc,
1135 sizeof (struct tilepro_elf_link_hash_entry),
1138 @@ -1199,7 +1191,7 @@ tilepro_elf_link_hash_table_create (bfd
1142 - return &ret->elf.root;
1143 + return &ret->root;
1146 /* Create the .got section. */
1147 @@ -1402,7 +1394,7 @@ static bfd_boolean
1148 tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
1149 asection *sec, const Elf_Internal_Rela *relocs)
1151 - struct tilepro_elf_link_hash_table *htab;
1152 + struct elf_link_hash_table *htab;
1153 Elf_Internal_Shdr *symtab_hdr;
1154 struct elf_link_hash_entry **sym_hashes;
1155 const Elf_Internal_Rela *rel;
1156 @@ -1423,8 +1415,8 @@ tilepro_elf_check_relocs (bfd *abfd, str
1158 BFD_ASSERT (is_tilepro_elf (abfd) || num_relocs == 0);
1160 - if (htab->elf.dynobj == NULL)
1161 - htab->elf.dynobj = abfd;
1162 + if (htab->dynobj == NULL)
1163 + htab->dynobj = abfd;
1165 rel_end = relocs + num_relocs;
1166 for (rel = relocs; rel < rel_end; rel++)
1167 @@ -1569,9 +1561,9 @@ tilepro_elf_check_relocs (bfd *abfd, str
1171 - if (htab->elf.sgot == NULL)
1172 + if (htab->sgot == NULL)
1174 - if (!tilepro_elf_create_got_section (htab->elf.dynobj, info))
1175 + if (!tilepro_elf_create_got_section (htab->dynobj, info))
1179 @@ -1716,7 +1708,7 @@ tilepro_elf_check_relocs (bfd *abfd, str
1182 sreloc = _bfd_elf_make_dynamic_reloc_section
1183 - (sec, htab->elf.dynobj, 2, abfd, /*rela?*/ TRUE);
1184 + (sec, htab->dynobj, 2, abfd, /*rela?*/ TRUE);
1188 @@ -1754,7 +1746,7 @@ tilepro_elf_check_relocs (bfd *abfd, str
1190 size_t amt = sizeof *p;
1191 p = ((struct elf_dyn_relocs *)
1192 - bfd_alloc (htab->elf.dynobj, amt));
1193 + bfd_alloc (htab->dynobj, amt));
1197 @@ -1850,14 +1842,14 @@ static bfd_boolean
1198 tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
1199 struct elf_link_hash_entry *h)
1201 - struct tilepro_elf_link_hash_table *htab;
1202 + struct elf_link_hash_table *htab;
1205 htab = tilepro_elf_hash_table (info);
1206 BFD_ASSERT (htab != NULL);
1208 /* Make sure we know what is going on here. */
1209 - BFD_ASSERT (htab->elf.dynobj != NULL
1210 + BFD_ASSERT (htab->dynobj != NULL
1214 @@ -1947,13 +1939,13 @@ tilepro_elf_adjust_dynamic_symbol (struc
1215 .rel.bss section we are going to use. */
1216 if ((h->root.u.def.section->flags & SEC_READONLY) != 0)
1218 - s = htab->elf.sdynrelro;
1219 - srel = htab->elf.sreldynrelro;
1220 + s = htab->sdynrelro;
1221 + srel = htab->sreldynrelro;
1225 - s = htab->elf.sdynbss;
1226 - srel = htab->elf.srelbss;
1227 + s = htab->sdynbss;
1228 + srel = htab->srelbss;
1230 if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0)
1232 @@ -1971,7 +1963,7 @@ static bfd_boolean
1233 allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
1235 struct bfd_link_info *info;
1236 - struct tilepro_elf_link_hash_table *htab;
1237 + struct elf_link_hash_table *htab;
1238 struct elf_dyn_relocs *p;
1240 if (h->root.type == bfd_link_hash_indirect)
1241 @@ -1981,7 +1973,7 @@ allocate_dynrelocs (struct elf_link_hash
1242 htab = tilepro_elf_hash_table (info);
1243 BFD_ASSERT (htab != NULL);
1245 - if (htab->elf.dynamic_sections_created
1246 + if (htab->dynamic_sections_created
1247 && h->plt.refcount > 0)
1249 /* Make sure this symbol is output as a dynamic symbol.
1250 @@ -1995,7 +1987,7 @@ allocate_dynrelocs (struct elf_link_hash
1252 if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
1254 - asection *s = htab->elf.splt;
1255 + asection *s = htab->splt;
1257 /* Allocate room for the header. */
1259 @@ -2021,10 +2013,10 @@ allocate_dynrelocs (struct elf_link_hash
1260 s->size += PLT_ENTRY_SIZE;
1262 /* We also need to make an entry in the .got.plt section. */
1263 - htab->elf.sgotplt->size += GOT_ENTRY_SIZE;
1264 + htab->sgotplt->size += GOT_ENTRY_SIZE;
1266 /* We also need to make an entry in the .rela.plt section. */
1267 - htab->elf.srelplt->size += TILEPRO_ELF_RELA_BYTES;
1268 + htab->srelplt->size += TILEPRO_ELF_RELA_BYTES;
1272 @@ -2060,22 +2052,22 @@ allocate_dynrelocs (struct elf_link_hash
1276 - s = htab->elf.sgot;
1278 h->got.offset = s->size;
1279 s->size += TILEPRO_BYTES_PER_WORD;
1280 /* R_TILEPRO_IMM16_Xn_TLS_GD entries need 2 consecutive GOT slots. */
1281 if (tls_type == GOT_TLS_GD)
1282 s->size += TILEPRO_BYTES_PER_WORD;
1283 - dyn = htab->elf.dynamic_sections_created;
1284 + dyn = htab->dynamic_sections_created;
1285 /* R_TILEPRO_IMM16_Xn_TLS_IE_xxx needs one dynamic relocation,
1286 R_TILEPRO_IMM16_Xn_TLS_GD_xxx needs two if local symbol and two if
1288 if (tls_type == GOT_TLS_GD || tls_type == GOT_TLS_IE)
1289 - htab->elf.srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES;
1290 + htab->srelgot->size += 2 * TILEPRO_ELF_RELA_BYTES;
1291 else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
1292 bfd_link_pic (info),
1294 - htab->elf.srelgot->size += TILEPRO_ELF_RELA_BYTES;
1295 + htab->srelgot->size += TILEPRO_ELF_RELA_BYTES;
1298 h->got.offset = (bfd_vma) -1;
1299 @@ -2134,7 +2126,7 @@ allocate_dynrelocs (struct elf_link_hash
1303 - || (htab->elf.dynamic_sections_created
1304 + || (htab->dynamic_sections_created
1305 && (h->root.type == bfd_link_hash_undefweak
1306 || h->root.type == bfd_link_hash_undefined))))
1308 @@ -2195,14 +2187,14 @@ tilepro_elf_size_dynamic_sections (bfd *
1312 - struct tilepro_elf_link_hash_table *htab;
1313 + struct elf_link_hash_table *htab;
1318 htab = tilepro_elf_hash_table (info);
1319 BFD_ASSERT (htab != NULL);
1320 - dynobj = htab->elf.dynobj;
1321 + dynobj = htab->dynobj;
1322 BFD_ASSERT (dynobj != NULL);
1324 if (elf_hash_table (info)->dynamic_sections_created)
1325 @@ -2268,8 +2260,8 @@ tilepro_elf_size_dynamic_sections (bfd *
1326 locsymcount = symtab_hdr->sh_info;
1327 end_local_got = local_got + locsymcount;
1328 local_tls_type = _bfd_tilepro_elf_local_got_tls_type (ibfd);
1329 - s = htab->elf.sgot;
1330 - srel = htab->elf.srelgot;
1332 + srel = htab->srelgot;
1333 for (; local_got < end_local_got; ++local_got, ++local_tls_type)
1336 @@ -2290,19 +2282,19 @@ tilepro_elf_size_dynamic_sections (bfd *
1338 /* Allocate global sym .plt and .got entries, and space for global
1339 sym dynamic relocs. */
1340 - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info);
1341 + elf_link_hash_traverse (htab, allocate_dynrelocs, info);
1343 if (elf_hash_table (info)->dynamic_sections_created)
1345 /* If the .got section is more than 0x8000 bytes, we add
1346 0x8000 to the value of _GLOBAL_OFFSET_TABLE_, so that 16
1347 bit relocations have a greater chance of working. */
1348 - if (htab->elf.sgot->size >= 0x8000
1349 + if (htab->sgot->size >= 0x8000
1350 && elf_hash_table (info)->hgot->root.u.def.value == 0)
1351 elf_hash_table (info)->hgot->root.u.def.value = 0x8000;
1354 - if (htab->elf.sgotplt)
1355 + if (htab->sgotplt)
1357 struct elf_link_hash_entry *got;
1358 got = elf_link_hash_lookup (elf_hash_table (info),
1359 @@ -2313,14 +2305,14 @@ tilepro_elf_size_dynamic_sections (bfd *
1360 entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */
1362 || !got->ref_regular_nonweak)
1363 - && (htab->elf.sgotplt->size
1364 + && (htab->sgotplt->size
1365 == GOTPLT_HEADER_SIZE)
1366 - && (htab->elf.splt == NULL
1367 - || htab->elf.splt->size == 0)
1368 - && (htab->elf.sgot == NULL
1369 - || (htab->elf.sgot->size
1370 + && (htab->splt == NULL
1371 + || htab->splt->size == 0)
1372 + && (htab->sgot == NULL
1373 + || (htab->sgot->size
1374 == get_elf_backend_data (output_bfd)->got_header_size)))
1375 - htab->elf.sgotplt->size = 0;
1376 + htab->sgotplt->size = 0;
1379 /* The check_relocs and adjust_dynamic_symbol entry points have
1380 @@ -2331,11 +2323,11 @@ tilepro_elf_size_dynamic_sections (bfd *
1381 if ((s->flags & SEC_LINKER_CREATED) == 0)
1384 - if (s == htab->elf.splt
1385 - || s == htab->elf.sgot
1386 - || s == htab->elf.sgotplt
1387 - || s == htab->elf.sdynbss
1388 - || s == htab->elf.sdynrelro)
1389 + if (s == htab->splt
1390 + || s == htab->sgot
1391 + || s == htab->sgotplt
1392 + || s == htab->sdynbss
1393 + || s == htab->sdynrelro)
1395 /* Strip this section if we don't need it; see the
1397 @@ -2527,7 +2519,7 @@ tilepro_elf_relocate_section (bfd *outpu
1398 Elf_Internal_Sym *local_syms,
1399 asection **local_sections)
1401 - struct tilepro_elf_link_hash_table *htab;
1402 + struct elf_link_hash_table *htab;
1403 Elf_Internal_Shdr *symtab_hdr;
1404 struct elf_link_hash_entry **sym_hashes;
1405 bfd_vma *local_got_offsets;
1406 @@ -2758,7 +2750,7 @@ tilepro_elf_relocate_section (bfd *outpu
1407 case R_TILEPRO_IMM16_X1_GOT_HA:
1408 /* Relocation is to the entry for this symbol in the global
1410 - if (htab->elf.sgot == NULL)
1411 + if (htab->sgot == NULL)
1415 @@ -2792,7 +2784,7 @@ tilepro_elf_relocate_section (bfd *outpu
1418 bfd_put_32 (output_bfd, relocation,
1419 - htab->elf.sgot->contents + off);
1420 + htab->sgot->contents + off);
1424 @@ -2820,11 +2812,11 @@ tilepro_elf_relocate_section (bfd *outpu
1426 /* We need to generate a R_TILEPRO_RELATIVE reloc
1427 for the dynamic linker. */
1428 - s = htab->elf.srelgot;
1429 + s = htab->srelgot;
1430 BFD_ASSERT (s != NULL);
1432 - outrel.r_offset = (htab->elf.sgot->output_section->vma
1433 - + htab->elf.sgot->output_offset
1434 + outrel.r_offset = (htab->sgot->output_section->vma
1435 + + htab->sgot->output_offset
1437 outrel.r_info = ELF32_R_INFO (0, R_TILEPRO_RELATIVE);
1438 outrel.r_addend = relocation;
1439 @@ -2833,7 +2825,7 @@ tilepro_elf_relocate_section (bfd *outpu
1442 bfd_put_32 (output_bfd, relocation,
1443 - htab->elf.sgot->contents + off);
1444 + htab->sgot->contents + off);
1445 local_got_offsets[r_symndx] |= 1;
1448 @@ -2845,7 +2837,7 @@ tilepro_elf_relocate_section (bfd *outpu
1449 procedure linkage table. */
1450 BFD_ASSERT (h != NULL);
1452 - if (h->plt.offset == (bfd_vma) -1 || htab->elf.splt == NULL)
1453 + if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL)
1455 /* We didn't make a PLT entry for this symbol. This
1456 happens when statically linking PIC code, or when
1457 @@ -2853,8 +2845,8 @@ tilepro_elf_relocate_section (bfd *outpu
1461 - relocation = (htab->elf.splt->output_section->vma
1462 - + htab->elf.splt->output_offset
1463 + relocation = (htab->splt->output_section->vma
1464 + + htab->splt->output_offset
1466 unresolved_reloc = FALSE;
1468 @@ -2993,7 +2985,7 @@ tilepro_elf_relocate_section (bfd *outpu
1469 outrel.r_addend = relocation + rel->r_addend;
1472 - sec = htab->elf.splt;
1475 if (bfd_is_abs_section (sec))
1477 @@ -3016,7 +3008,7 @@ tilepro_elf_relocate_section (bfd *outpu
1481 - osec = htab->elf.text_index_section;
1482 + osec = htab->text_index_section;
1483 indx = elf_section_data (osec)->dynindx;
1486 @@ -3142,7 +3134,7 @@ tilepro_elf_relocate_section (bfd *outpu
1487 local_got_offsets[r_symndx] |= 1;
1490 - if (htab->elf.sgot == NULL)
1491 + if (htab->sgot == NULL)
1495 @@ -3153,13 +3145,13 @@ tilepro_elf_relocate_section (bfd *outpu
1497 bfd_boolean need_relocs = FALSE;
1499 - if (htab->elf.srelgot == NULL)
1500 + if (htab->srelgot == NULL)
1506 - dyn = htab->elf.dynamic_sections_created;
1507 + dyn = htab->dynamic_sections_created;
1509 if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
1510 bfd_link_pic (info),
1511 @@ -3190,18 +3182,18 @@ tilepro_elf_relocate_section (bfd *outpu
1512 case R_TILEPRO_IMM16_X0_TLS_IE_HA:
1513 case R_TILEPRO_IMM16_X1_TLS_IE_HA:
1515 - bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
1516 - outrel.r_offset = (htab->elf.sgot->output_section->vma
1517 - + htab->elf.sgot->output_offset + off);
1518 + bfd_put_32 (output_bfd, 0, htab->sgot->contents + off);
1519 + outrel.r_offset = (htab->sgot->output_section->vma
1520 + + htab->sgot->output_offset + off);
1521 outrel.r_addend = 0;
1523 outrel.r_addend = relocation - dtpoff_base (info);
1524 outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_TPOFF32);
1525 - tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
1526 + tilepro_elf_append_rela_32 (output_bfd, htab->srelgot,
1529 bfd_put_32 (output_bfd, tpoff (info, relocation),
1530 - htab->elf.sgot->contents + off);
1531 + htab->sgot->contents + off);
1535 @@ -3214,31 +3206,31 @@ tilepro_elf_relocate_section (bfd *outpu
1536 case R_TILEPRO_IMM16_X0_TLS_GD_HA:
1537 case R_TILEPRO_IMM16_X1_TLS_GD_HA:
1539 - outrel.r_offset = (htab->elf.sgot->output_section->vma
1540 - + htab->elf.sgot->output_offset + off);
1541 + outrel.r_offset = (htab->sgot->output_section->vma
1542 + + htab->sgot->output_offset + off);
1543 outrel.r_addend = 0;
1544 outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32);
1545 - bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
1546 - tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
1547 + bfd_put_32 (output_bfd, 0, htab->sgot->contents + off);
1548 + tilepro_elf_append_rela_32 (output_bfd, htab->srelgot,
1552 BFD_ASSERT (! unresolved_reloc);
1553 bfd_put_32 (output_bfd,
1554 relocation - dtpoff_base (info),
1555 - (htab->elf.sgot->contents + off +
1556 + (htab->sgot->contents + off +
1557 TILEPRO_BYTES_PER_WORD));
1561 bfd_put_32 (output_bfd, 0,
1562 - (htab->elf.sgot->contents + off +
1563 + (htab->sgot->contents + off +
1564 TILEPRO_BYTES_PER_WORD));
1565 outrel.r_info = ELF32_R_INFO (indx,
1566 R_TILEPRO_TLS_DTPOFF32);
1567 outrel.r_offset += TILEPRO_BYTES_PER_WORD;
1568 tilepro_elf_append_rela_32 (output_bfd,
1569 - htab->elf.srelgot, &outrel);
1570 + htab->srelgot, &outrel);
1574 @@ -3249,9 +3241,9 @@ tilepro_elf_relocate_section (bfd *outpu
1575 symbol binding locally. Mark it as belonging
1576 to module 1, the executable. */
1577 bfd_put_32 (output_bfd, 1,
1578 - htab->elf.sgot->contents + off );
1579 + htab->sgot->contents + off );
1580 bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
1581 - htab->elf.sgot->contents + off +
1582 + htab->sgot->contents + off +
1583 TILEPRO_BYTES_PER_WORD);
1586 @@ -3411,7 +3403,7 @@ tilepro_elf_finish_dynamic_symbol (bfd *
1587 struct elf_link_hash_entry *h,
1588 Elf_Internal_Sym *sym)
1590 - struct tilepro_elf_link_hash_table *htab;
1591 + struct elf_link_hash_table *htab;
1593 htab = tilepro_elf_hash_table (info);
1594 BFD_ASSERT (htab != NULL);
1595 @@ -3431,9 +3423,9 @@ tilepro_elf_finish_dynamic_symbol (bfd *
1597 BFD_ASSERT (h->dynindx != -1);
1599 - splt = htab->elf.splt;
1600 - srela = htab->elf.srelplt;
1601 - sgotplt = htab->elf.sgotplt;
1602 + splt = htab->splt;
1603 + srela = htab->srelplt;
1604 + sgotplt = htab->sgotplt;
1606 if (splt == NULL || srela == NULL)
1608 @@ -3481,8 +3473,8 @@ tilepro_elf_finish_dynamic_symbol (bfd *
1610 /* This symbol has an entry in the GOT. Set it up. */
1612 - sgot = htab->elf.sgot;
1613 - srela = htab->elf.srelgot;
1614 + sgot = htab->sgot;
1615 + srela = htab->srelgot;
1616 BFD_ASSERT (sgot != NULL && srela != NULL);
1618 rela.r_offset = (sgot->output_section->vma
1619 @@ -3528,16 +3520,16 @@ tilepro_elf_finish_dynamic_symbol (bfd *
1620 + h->root.u.def.section->output_offset);
1621 rela.r_info = ELF32_R_INFO (h->dynindx, R_TILEPRO_COPY);
1623 - if (h->root.u.def.section == htab->elf.sdynrelro)
1624 - s = htab->elf.sreldynrelro;
1625 + if (h->root.u.def.section == htab->sdynrelro)
1626 + s = htab->sreldynrelro;
1628 - s = htab->elf.srelbss;
1629 + s = htab->srelbss;
1630 tilepro_elf_append_rela_32 (output_bfd, s, &rela);
1633 /* Mark some specially defined symbols as absolute. */
1634 - if (h == htab->elf.hdynamic
1635 - || (h == htab->elf.hgot || h == htab->elf.hplt))
1636 + if (h == htab->hdynamic
1637 + || (h == htab->hgot || h == htab->hplt))
1638 sym->st_shndx = SHN_ABS;
1641 @@ -3551,7 +3543,7 @@ tilepro_finish_dyn (bfd *output_bfd, str
1642 asection *splt ATTRIBUTE_UNUSED)
1644 Elf32_External_Dyn *dyncon, *dynconend;
1645 - struct tilepro_elf_link_hash_table *htab;
1646 + struct elf_link_hash_table *htab;
1648 htab = tilepro_elf_hash_table (info);
1649 BFD_ASSERT (htab != NULL);
1650 @@ -3567,15 +3559,15 @@ tilepro_finish_dyn (bfd *output_bfd, str
1654 - s = htab->elf.sgotplt;
1655 + s = htab->sgotplt;
1656 dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
1659 - s = htab->elf.srelplt;
1660 + s = htab->srelplt;
1661 dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
1664 - s = htab->elf.srelplt;
1665 + s = htab->srelplt;
1666 dyn.d_un.d_val = s->size;
1669 @@ -3593,11 +3585,11 @@ tilepro_elf_finish_dynamic_sections (bfd
1673 - struct tilepro_elf_link_hash_table *htab;
1674 + struct elf_link_hash_table *htab;
1676 htab = tilepro_elf_hash_table (info);
1677 BFD_ASSERT (htab != NULL);
1678 - dynobj = htab->elf.dynobj;
1679 + dynobj = htab->dynobj;
1681 sdyn = bfd_get_linker_section (dynobj, ".dynamic");
1683 @@ -3606,7 +3598,7 @@ tilepro_elf_finish_dynamic_sections (bfd
1687 - splt = htab->elf.splt;
1688 + splt = htab->splt;
1689 BFD_ASSERT (splt != NULL && sdyn != NULL);
1691 ret = tilepro_finish_dyn (output_bfd, info, dynobj, sdyn, splt);
1692 @@ -3627,42 +3619,42 @@ tilepro_elf_finish_dynamic_sections (bfd
1696 - if (htab->elf.sgotplt)
1697 + if (htab->sgotplt)
1699 - if (bfd_is_abs_section (htab->elf.sgotplt->output_section))
1700 + if (bfd_is_abs_section (htab->sgotplt->output_section))
1703 - (_("discarded output section: `%pA'"), htab->elf.sgotplt);
1704 + (_("discarded output section: `%pA'"), htab->sgotplt);
1708 - if (htab->elf.sgotplt->size > 0)
1709 + if (htab->sgotplt->size > 0)
1711 /* Write the first two entries in .got.plt, needed for the dynamic
1713 bfd_put_32 (output_bfd, (bfd_vma) -1,
1714 - htab->elf.sgotplt->contents);
1715 + htab->sgotplt->contents);
1716 bfd_put_32 (output_bfd, (bfd_vma) 0,
1717 - htab->elf.sgotplt->contents + GOT_ENTRY_SIZE);
1718 + htab->sgotplt->contents + GOT_ENTRY_SIZE);
1721 - elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize
1722 + elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize
1726 - if (htab->elf.sgot)
1729 - if (htab->elf.sgot->size > 0)
1730 + if (htab->sgot->size > 0)
1732 /* Set the first entry in the global offset table to the address of
1733 the dynamic section. */
1734 bfd_vma val = (sdyn ?
1735 sdyn->output_section->vma + sdyn->output_offset :
1737 - bfd_put_32 (output_bfd, val, htab->elf.sgot->contents);
1738 + bfd_put_32 (output_bfd, val, htab->sgot->contents);
1741 - elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize
1742 + elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize
1746 diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.35/bfd/elf64-ppc.c
1747 --- binutils.orig/bfd/elf64-ppc.c 2020-07-30 08:41:25.038236414 +0100
1748 +++ binutils-2.35/bfd/elf64-ppc.c 2020-07-30 09:06:39.400533827 +0100
1749 @@ -3250,9 +3250,6 @@ struct ppc_link_hash_table
1751 /* Incremented every time we size stubs. */
1752 unsigned int stub_iteration;
1754 - /* Small local sym cache. */
1755 - struct sym_cache sym_cache;
1758 /* Rename some of the generic section flags to better document how they
1759 @@ -4383,7 +4380,8 @@ ppc64_elf_before_check_relocs (bfd *ibfd
1760 Elf_Internal_Sym *isym;
1763 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, r_symndx);
1764 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd,
1768 if (elf_section_data (opd)->relocs != relocs)
1769 @@ -4684,7 +4682,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
1773 - Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1774 + Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1778 @@ -4955,7 +4953,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
1780 Elf_Internal_Sym *isym;
1782 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1783 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1787 @@ -5231,7 +5229,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
1789 Elf_Internal_Sym *isym;
1791 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1792 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1796 diff -rup binutils.orig/bfd/elf64-s390.c binutils-2.35/bfd/elf64-s390.c
1797 --- binutils.orig/bfd/elf64-s390.c 2020-07-30 08:41:25.044236375 +0100
1798 +++ binutils-2.35/bfd/elf64-s390.c 2020-07-30 09:06:39.400533827 +0100
1799 @@ -663,9 +663,6 @@ struct elf_s390_link_hash_table
1803 - /* Small local sym cache. */
1804 - struct sym_cache sym_cache;
1806 /* Options passed from the linker. */
1807 struct s390_elf_params *params;
1809 @@ -852,7 +849,7 @@ elf_s390_check_relocs (bfd *abfd,
1810 if (r_symndx < symtab_hdr->sh_info)
1812 /* A local symbol. */
1813 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1814 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1818 @@ -1216,7 +1213,7 @@ elf_s390_check_relocs (bfd *abfd,
1822 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1823 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1827 @@ -2258,7 +2255,7 @@ elf_s390_relocate_section (bfd *output_b
1828 & 0xff00f000) == 0xe300c000
1829 && bfd_get_8 (input_bfd,
1830 contents + rel->r_offset + 3) == 0x04))
1831 - && (isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1832 + && (isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1833 input_bfd, r_symndx))
1834 && isym->st_shndx != SHN_ABS
1835 && h != htab->elf.hdynamic
1836 @@ -3572,7 +3569,7 @@ elf_s390_finish_dynamic_sections (bfd *o
1837 if (local_plt[i].plt.offset != (bfd_vma) -1)
1839 asection *sec = local_plt[i].sec;
1840 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, ibfd, i);
1841 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, ibfd, i);
1845 diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.35/bfd/elf64-x86-64.c
1846 --- binutils.orig/bfd/elf64-x86-64.c 2020-07-30 08:41:25.040236401 +0100
1847 +++ binutils-2.35/bfd/elf64-x86-64.c 2020-07-30 09:06:39.401533821 +0100
1848 @@ -1371,7 +1371,7 @@ elf_x86_64_tls_transition (struct bfd_li
1850 Elf_Internal_Sym *isym;
1852 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1853 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1855 name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL);
1857 @@ -1559,7 +1559,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd
1860 Elf_Internal_Sym *isym
1861 - = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
1862 + = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, r_symndx);
1864 /* Skip relocation against undefined symbols. */
1865 if (isym->st_shndx == SHN_UNDEF)
1866 @@ -1907,7 +1907,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru
1867 if (r_symndx < symtab_hdr->sh_info)
1869 /* A local symbol. */
1870 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1871 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1875 @@ -2308,7 +2308,7 @@ elf_x86_64_check_relocs (bfd *abfd, stru
1879 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
1880 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
1884 diff -rup binutils.orig/bfd/elflink.c binutils-2.35/bfd/elflink.c
1885 --- binutils.orig/bfd/elflink.c 2020-07-30 08:41:25.055236303 +0100
1886 +++ binutils-2.35/bfd/elflink.c 2020-07-30 09:06:39.401533821 +0100
1887 @@ -1228,6 +1228,17 @@ _bfd_elf_merge_symbol (bfd *abfd,
1891 + /* After all LTO IR symbols have been read, skip all undefined
1892 + symbols without relocation. */
1893 + if (info->lto_all_symbols_read
1894 + && bfd_is_und_section (sec)
1895 + && (abfd->flags & DYNAMIC) == 0
1896 + && !h->has_reloc_after_lto_all_symbols_read)
1902 /* In cases involving weak versioned symbols, we may wind up trying
1903 to merge a symbol with itself. Catch that here, to avoid the
1904 confusion that results if we try to override a symbol with
1905 @@ -4545,6 +4556,93 @@ elf_link_add_object_symbols (bfd *abfd,
1906 (_("%pB: plugin needed to handle lto object"), abfd);
1909 + /* Normally an undefined symbol is treated as a reference. Linker
1910 + will try to satisfy the reference. This feature is used to bring
1911 + a symbol definition into output without explicit relocation. If
1912 + there is no definition nor relocation, linker will remove undefined
1913 + symbol from symbol table in output (PR ld/4317). But GCC 10 LTO
1914 + may generate separate debug info files which contain undefined
1915 + symbols without relocations:
1917 + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96385
1919 + After all LTO IR symbols have been read, if there is a dinition in
1920 + LTO IR object, there is no relocation, and there is a definition
1921 + in a shared object, linker may resolve the undefined symbol to the
1922 + discarded section in LTO IR object. To avoid it, after all LTO IR
1923 + symbols have been read, skip undefined symbols without relocation.
1925 + if (info->lto_all_symbols_read
1926 + && !bfd_link_relocatable (info)
1927 + && (abfd->flags & DYNAMIC) == 0
1932 + struct elf_link_hash_entry *h;
1935 + if (bed->s->arch_size == 32)
1940 + for (s = abfd->sections; s != NULL; s = s->next)
1942 + Elf_Internal_Rela *internal_relocs;
1943 + Elf_Internal_Rela *rel, *relend;
1945 + /* Don't check relocations in excluded sections. */
1946 + if ((s->flags & SEC_RELOC) == 0
1947 + || s->reloc_count == 0
1948 + || (s->flags & SEC_EXCLUDE) != 0
1949 + || ((info->strip == strip_all
1950 + || info->strip == strip_debugger)
1951 + && (s->flags & SEC_DEBUGGING) != 0))
1954 + internal_relocs = _bfd_elf_link_read_relocs (abfd, s, NULL,
1956 + info->keep_memory);
1957 + if (internal_relocs == NULL)
1958 + goto error_free_vers;
1960 + rel = internal_relocs;
1961 + relend = rel + s->reloc_count;
1962 + for ( ; rel < relend; rel++)
1964 + unsigned long r_symndx = rel->r_info >> r_sym_shift;
1966 + /* Skip local symbols. */
1967 + if (r_symndx < extsymoff)
1970 + isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd,
1972 + if (isym->st_shndx == SHN_UNDEF)
1974 + name = bfd_elf_string_from_elf_section (abfd,
1977 + h = ((struct elf_link_hash_entry *)
1978 + bfd_wrapped_link_hash_lookup (abfd, info, name,
1983 + while (h->root.type == bfd_link_hash_indirect
1984 + || h->root.type == bfd_link_hash_warning)
1985 + h = (struct elf_link_hash_entry *) h->root.u.i.link;
1986 + h->has_reloc_after_lto_all_symbols_read = TRUE;
1991 + if (elf_section_data (s)->relocs != internal_relocs)
1992 + free (internal_relocs);
1996 for (isym = isymbuf, isymend = isymbuf + extsymcount;
1998 isym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL))
1999 diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c
2000 --- binutils.orig/bfd/elfnn-aarch64.c 2020-07-30 08:41:25.046236362 +0100
2001 +++ binutils-2.35/bfd/elfnn-aarch64.c 2020-07-30 09:06:39.402533814 +0100
2002 @@ -2643,9 +2643,6 @@ struct elf_aarch64_link_hash_table
2003 /* The bytes of the subsequent PLT entry. */
2004 const bfd_byte *plt_entry;
2006 - /* Small local sym cache. */
2007 - struct sym_cache sym_cache;
2009 /* For convenience in allocate_dynrelocs. */
2012 @@ -7611,7 +7608,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
2013 if (r_symndx < symtab_hdr->sh_info)
2015 /* A local symbol. */
2016 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2017 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2021 @@ -7838,7 +7835,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
2025 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2026 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
2030 Only in binutils-2.35/bfd: elfnn-aarch64.c.orig
2031 diff -rup binutils.orig/bfd/elfnn-riscv.c binutils-2.35/bfd/elfnn-riscv.c
2032 --- binutils.orig/bfd/elfnn-riscv.c 2020-07-30 08:41:25.039236408 +0100
2033 +++ binutils-2.35/bfd/elfnn-riscv.c 2020-07-30 09:06:39.402533814 +0100
2034 @@ -113,9 +113,6 @@ struct riscv_elf_link_hash_table
2035 /* Short-cuts to get to dynamic linker sections. */
2036 asection *sdyntdata;
2038 - /* Small local sym to section mapping cache. */
2039 - struct sym_cache sym_cache;
2041 /* The max alignment of output sections. */
2042 bfd_vma max_alignment;
2044 @@ -681,7 +678,7 @@ riscv_elf_check_relocs (bfd *abfd, struc
2046 Elf_Internal_Sym *isym;
2048 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2049 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2053 diff -rup binutils.orig/bfd/elfxx-mips.c binutils-2.35/bfd/elfxx-mips.c
2054 --- binutils.orig/bfd/elfxx-mips.c 2020-07-30 08:41:25.051236329 +0100
2055 +++ binutils-2.35/bfd/elfxx-mips.c 2020-07-30 09:06:39.403533808 +0100
2056 @@ -527,9 +527,6 @@ struct mips_elf_link_hash_table
2058 asection *(*add_stub_section) (const char *, asection *, asection *);
2060 - /* Small local sym cache. */
2061 - struct sym_cache sym_cache;
2063 /* Is the PLT header compressed? */
2064 unsigned int plt_header_is_comp : 1;
2066 @@ -4401,7 +4398,7 @@ mips_elf_resolve_got_page_ref (void **re
2067 Elf_Internal_Sym *isym;
2069 /* Read in the symbol. */
2070 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, ref->u.abfd,
2071 + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, ref->u.abfd,
2075 diff -rup binutils.orig/bfd/elfxx-sparc.c binutils-2.35/bfd/elfxx-sparc.c
2076 --- binutils.orig/bfd/elfxx-sparc.c 2020-07-30 08:41:25.035236434 +0100
2077 +++ binutils-2.35/bfd/elfxx-sparc.c 2020-07-30 09:06:39.404533801 +0100
2078 @@ -1391,7 +1391,8 @@ _bfd_sparc_elf_check_relocs (bfd *abfd,
2079 if (r_symndx < symtab_hdr->sh_info)
2081 /* A local symbol. */
2082 - isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
2083 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd,
2088 diff -rup binutils.orig/bfd/elfxx-sparc.h binutils-2.35/bfd/elfxx-sparc.h
2089 --- binutils.orig/bfd/elfxx-sparc.h 2020-07-30 08:41:25.042236388 +0100
2090 +++ binutils-2.35/bfd/elfxx-sparc.h 2020-07-30 09:06:39.404533801 +0100
2091 @@ -55,9 +55,6 @@ struct _bfd_sparc_elf_link_hash_table
2095 - /* Small local sym cache. */
2096 - struct sym_cache sym_cache;
2098 /* Used by local STT_GNU_IFUNC symbols. */
2099 htab_t loc_hash_table;
2100 void *loc_hash_memory;
2101 diff -rup binutils.orig/bfd/elfxx-tilegx.c binutils-2.35/bfd/elfxx-tilegx.c
2102 --- binutils.orig/bfd/elfxx-tilegx.c 2020-07-30 08:41:25.037236421 +0100
2103 +++ binutils-2.35/bfd/elfxx-tilegx.c 2020-07-30 09:06:39.404533801 +0100
2104 @@ -835,9 +835,6 @@ struct tilegx_elf_link_hash_table
2105 /* Whether LE transition has been disabled for some of the
2107 bfd_boolean disable_le_transition;
2109 - /* Small local sym to section mapping cache. */
2110 - struct sym_cache sym_cache;
2114 @@ -1979,7 +1976,7 @@ tilegx_elf_check_relocs (bfd *abfd, stru
2116 Elf_Internal_Sym *isym;
2118 - isym = bfd_sym_from_r_symndx (&htab->sym_cache,
2119 + isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
2123 diff -rup binutils.orig/bfd/elfxx-x86.h binutils-2.35/bfd/elfxx-x86.h
2124 --- binutils.orig/bfd/elfxx-x86.h 2020-07-30 08:41:25.052236322 +0100
2125 +++ binutils-2.35/bfd/elfxx-x86.h 2020-07-30 09:06:39.404533801 +0100
2126 @@ -468,9 +468,6 @@ struct elf_x86_link_hash_table
2127 /* The amount of space used by the jump slots in the GOT. */
2128 bfd_vma sgotplt_jump_table_size;
2130 - /* Small local sym cache. */
2131 - struct sym_cache sym_cache;
2133 /* _TLS_MODULE_BASE_ symbol. */
2134 struct bfd_link_hash_entry *tls_module_base;
2136 Only in binutils.orig: binutils-2.35
2137 diff -rup binutils.orig/gas/as.c binutils-2.35/gas/as.c
2138 --- binutils.orig/gas/as.c 2020-07-30 08:41:25.034236441 +0100
2139 +++ binutils-2.35/gas/as.c 2020-07-30 09:05:24.370019859 +0100
2140 @@ -103,7 +103,7 @@ int verbose = 0;
2141 int flag_dwarf_cie_version = -1;
2143 /* The maximum level of DWARF DEBUG information we should manufacture. */
2144 -unsigned int dwarf_level = 0;
2145 +unsigned int dwarf_level = 4;
2147 #if defined OBJ_ELF || defined OBJ_MAYBE_ELF
2148 int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON;