PR26580, Size and alignment of commons vs as-needed shared lib
[deliverable/binutils-gdb.git] / bfd / ChangeLog
1 2020-09-08 Alan Modra <amodra@gmail.com>
2
3 PR 13250
4 PR 26580
5 * elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**.
6 Return oldbfd in override when old common should override new
7 common.
8 (_bfd_elf_add_default_symbol): Adjust to suit.
9 (elf_link_add_object_symbols): Likewise. Pass "override" to
10 _bfd_generic_link_add_one_symbol. Save and restore common u.c.p
11 field for --as-needed shared libraries. Revert pr13250 changes.
12
13 2020-09-08 Nick Clifton <nickc@redhat.com>
14
15 * plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
16 unrecognized symbol type in a weak definition.
17
18 2020-09-04 Alan Modra <amodra@gmail.com>
19
20 PR 26574
21 * elfcode.h (elf_object_p): Sanity check section header offset.
22 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
23 sh_entsize.
24
25 2020-09-04 Alan Modra <amodra@gmail.com>
26
27 PR 15146
28 PR 26314
29 PR 26530
30 * elflink.c (elf_link_add_object_symbols): Do set def_regular
31 and ref_regular for IR symbols. Don't clear dynsym, allowing
32 IR symbols to load --as-needed shared libraries, but prevent
33 IR symbols from becoming dynamic.
34
35 2020-09-03 Nick Clifton <nickc@redhat.com>
36
37 PR 26521
38 * elf.c (_bfd_elf_write_secondary_reloc_section): Check for
39 secondary reloc sections with a zero sh_entsize field.
40
41 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
42
43 * elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
44 (riscv_merge_std_ext): Likewise.
45 (riscv_merge_arch_attr_info): Likewise.
46 (riscv_merge_attributes): Likewise and fix comment typos.
47
48 2020-09-03 Nelson Chu <nelson.chu@sifive.com>
49
50 * elfnn-riscv.c (riscv_version_mismatch): Change the return type
51 from void to bfd_boolean. Report warnings rather than errors
52 when the ISA versions are mis-matched. Afterwards, remember to
53 update the output ISA versions to the newest ones.
54 (riscv_merge_std_ext): Allow to link objects with different
55 standard ISA versions. Try to add output ISA versions to
56 merged_subsets first.
57 (riscv_merge_multi_letter_ext): Likewise. But for standard additional
58 ISA and non-standard ISA versions.
59
60 2020-09-03 Kito Cheng <kito.cheng@sifive.com>
61
62 * elfnn-riscv.c (riscv_merge_std_ext): Fix to report the correct
63 error message when the versions of extension are mis-matched.
64 * elfxx-riscv.c (riscv_parse_subset): Don't issue the error when
65 the string is empty.
66
67 2020-09-03 Alan Modra <amodra@gmail.com>
68
69 * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
70 on the output bfd objalloc memory.
71
72 2020-09-02 Alan Modra <amodra@gmail.com>
73
74 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
75 of constant shifted left.
76
77 2020-09-02 Alan Modra <amodra@gmail.com>
78
79 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
80 type for "relocation".
81
82 2020-09-01 Alan Modra <amodra@gmail.com>
83
84 * reloc.c (N_ONES): Handle N=0.
85 * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
86 for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
87
88 2020-09-01 Alan Modra <amodra@gmail.com>
89
90 PR 26429
91 * elf32-arm.c (elf32_arm_allocate_local_sym_info): Allocate arrays
92 in descending order of alignment.
93
94 2020-09-01 Alan Modra <amodra@gmail.com>
95
96 PR 26423
97 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
98
99 2020-08-31 Alan Modra <amodra@gmail.com>
100
101 PR 26493
102 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
103 unsigned when using with RISCV_ITYPE.
104 (_bfd_riscv_relax_call): Use an unsigned foff.
105
106 2020-08-31 Alan Modra <amodra@gmail.com>
107
108 PR 26476
109 PR 26477
110 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
111 (CRINFO_RELVADDR): Make unsigned.
112 (mips_elf_nullify_got_load): Use unsigned constant when shifting
113 into sign bit.
114
115 2020-08-31 Alan Modra <amodra@gmail.com>
116
117 PR 26466
118 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
119 variable and rewrite signed overflow check.
120 * elf32-mep.c: Regenerate.
121 (mep_final_link_relocate): Delete "s".
122
123 2020-08-31 Alan Modra <amodra@gmail.com>
124
125 PR 26461
126 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
127 that might shift values into sign bit.
128
129 2020-08-31 Alan Modra <amodra@gmail.com>
130
131 PR 26445
132 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
133 and similarly for variables dealing with overflow.
134
135 2020-08-31 Alan Modra <amodra@gmail.com>
136
137 PR 26442
138 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
139 without undefined behaviour. Tidy excess casts.
140
141 2020-08-31 Alan Modra <amodra@gmail.com>
142
143 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
144 alignment from reloc addend after reloc type R_MN10300_ALIGN is
145 found.
146
147 2020-08-30 Alan Modra <amodra@gmail.com>
148
149 PR 26435
150 PR 26436
151 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
152 without undefined behaviour.
153
154 2020-08-29 Nick Clifton <nickc@redhat.com>
155
156 PR 26520
157 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
158 variable table.
159
160 2020-08-29 Alan Modra <amodra@gmail.com>
161
162 PR 26459
163 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
164 element when count is zero. bfd_realloc when shrinking.
165
166 2020-08-28 Alan Modra <amodra@gmail.com>
167
168 PR 26418
169 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
170 zero size buffers.
171
172 2020-08-28 Alan Modra <amodra@gmail.com>
173
174 PR 26418
175 * ecofflink.c (WRITE): Really don't write zero size chunks.
176
177 2020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
178
179 PR 26543
180 * linker.c (bfd_generic_define_common_symbol): Force the alignment
181 to 1 if the section has now alignment requirement.
182
183 2020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
184
185 * elf32-csky.c (csky_archs): Fix arch names.
186 (csky_find_arch_with_name): New.
187 (elf32_csky_merge_attributes): New.
188 (csky_elf_merge_private_bfd_data): Add process of merge
189 attribute section.
190 (elf32_csky_obj_attrs_arg_type): New.
191 (elf32_csky_obj_attrs_handle_unknown): New.
192 (elf_backend_obj_attrs_vendor): Define.
193 (elf_backend_obj_attrs_section): Define.
194 (elf_backend_obj_attrs_arg_type): Define.
195 (elf_backend_obj_attrs_section_type): Define.
196
197 2020-08-28 Nick Clifton <nickc@redhat.com>
198
199 PR19011
200 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
201 for undefined symbols which will not generate extra warning
202 messages about truncated relocs.
203
204 2020-08-28 Nelson Chu <nelson.chu@sifive.com>
205
206 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
207 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
208 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
209 unresolved reloc checks.
210
211 2020-08-27 John David Anglin <danglin@gcc.gnu.org>
212
213 PR 26356
214 * som.c (som_bfd_copy_private_section_data): Issue error when a
215 subspace is specified without its containing space.
216
217 2020-08-27 Alan Modra <amodra@gmail.com>
218
219 PR 26469
220 * elflink.c: Include limits.h.
221 (CHAR_BIT): Provide fallback define.
222 (set_symbol_value): Correct complex reloc comment.
223 (undefined_reference): Set bfd_error.
224 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
225 (BINARY_OP): ..this.
226 (eval_symbol): Limit shifts. Force unsigned for left shift.
227 Catch divide by zero.
228 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
229 * configure: Regenerate.
230 * config.in: Regenerate.
231
232 2020-08-27 Alan Modra <amodra@gmail.com>
233
234 PR 26462
235 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
236
237 2020-08-27 Alan Modra <amodra@gmail.com>
238
239 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
240 on sym_sec not being output.
241
242 2020-08-27 Alan Modra <amodra@gmail.com>
243
244 PR 26416
245 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
246
247 2020-08-26 Nick Clifton <nickc@redhat.com>
248
249 PR 26433
250 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
251 behaviour.
252 (avr_elf32_load_records_from_section): Use bfd_get_16 and
253 bfd_get_32 to load values from potentially unaligned pointers.
254
255 PR 26416
256 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
257 ignore local symbols.
258 (elf64_alpha_relax_got_load): Do not check for local dynamic
259 symbols.
260 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
261 values.
262 (INSN_A) Cast the A parameter to unsigned.
263 (INSN_AB): Define in terms of INSN_A.
264 (INSN_ABC): Likewise.
265 (INSN_ABO): Likewise.
266 (INSN_AD): Likewise.
267
268 PR 26411
269 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
270 unsigned long constant when creating a mask to test for alignment
271 issues.
272
273 2020-08-26 Alan Modra <amodra@gmail.com>
274
275 PR 26507
276 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
277
278 2020-08-26 Alan Modra <amodra@gmail.com>
279
280 PR 26506
281 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
282 when section is empty.
283
284 2020-08-26 Alan Modra <amodra@gmail.com>
285
286 PR 26498
287 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
288 avoid UB left shift.
289
290 2020-08-26 Alan Modra <amodra@gmail.com>
291
292 PR 26484
293 PR 26485
294 PR 26486
295 PR 26487
296 PR 26488
297 PR 26490
298 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
299 (ppc64_elf_tls_setup): Likewise.
300 (branch_reloc_hash_match): Likewise.
301 (build_plt_stub): Likewise.
302 (ppc64_elf_relocate_section): Likewise.
303
304 2020-08-26 Alan Modra <amodra@gmail.com>
305
306 PR 26478
307 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
308
309 2020-08-26 Alan Modra <amodra@gmail.com>
310
311 PR 26475
312 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
313 sstubs->contents != NULL.
314
315 2020-08-26 Alan Modra <amodra@gmail.com>
316
317 PR 26453
318 * som.c (som_prep_for_fixups): Return early when no symbols.
319
320 2020-08-26 Alan Modra <amodra@gmail.com>
321
322 PR 26418
323 * ecofflink.c (WRITE): Don't write size 0 chunks.
324
325 2020-08-26 Alan Modra <amodra@gmail.com>
326
327 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
328
329 2020-08-26 Alan Modra <amodra@gmail.com>
330
331 PR 26415
332 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
333
334 2020-08-26 David Faust <david.faust@oracle.com>
335
336 * archures.c (bfd_mach_xbpf): Define.
337 * bfd-in2.h: Regenerate.
338 * cpu-bpf.c (bfd_xbpf_arch) New.
339 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
340
341 2020-08-26 Alan Modra <amodra@gmail.com>
342
343 * archures.c (bfd_mach_ck860): Define.
344
345 2020-08-25 Mark Wielaard <mark@klomp.org>
346
347 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
348 and dwarf_rnglists_size fields.
349 (dwarf_debug_sections): Add debug_rnglists.
350 (dwarf_debug_section_enum): Likewise.
351 (read_debug_rnglists): New function.
352 (read_rangelist): New function to call either read_ranges or
353 read_rnglists. Rename original function to...
354 (read_ranges): ...this.
355 (read_rnglists): New function.
356
357 2020-08-25 Alan Modra <amodra@gmail.com>
358
359 PR 26505
360 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
361 is_elf_hash_table before accessing elf fields.
362
363 2020-08-25 Alan Modra <amodra@gmail.com>
364
365 PR 26482
366 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
367 won't be output.
368
369 2020-08-25 Alan Modra <amodra@gmail.com>
370
371 PR 26463
372 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
373 before accessing elf fields.
374
375 2020-08-25 Alan Modra <amodra@gmail.com>
376
377 PR 26452
378 * som.c (som_compute_checksum): XOR 32-bit words in header,
379 not unsigned long sized words.
380
381 2020-08-25 Alan Modra <amodra@gmail.com>
382
383 PR 26430
384 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
385 amount copied for elf_segment_map defined with one element
386 sections array.
387
388 2020-08-25 Alan Modra <amodra@gmail.com>
389
390 PR 26422
391 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
392 bfd_get_x size function to read addends out of fields. Apply
393 rightshift adjustment too. Don't apply the now unnecessary
394 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
395 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
396 Correct R_ARM_THM_JUMP6 addend.
397
398 2020-08-25 Alan Modra <amodra@gmail.com>
399
400 PR 26419
401 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
402 before start of section.
403
404 2020-08-25 Alan Modra <amodra@gmail.com>
405
406 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
407 before accessing elf_hash_table_id.
408 * elf32-arc.c (elf_arc_hash_table): Likewise.
409 * elf32-arm.c (elf32_arm_hash_table): Likewise.
410 * elf32-avr.c (avr_link_hash_table): Likewise.
411 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
412 * elf32-cris.c (elf_cris_hash_table): Likewise.
413 * elf32-csky.c (csky_elf_hash_table): Likewise.
414 * elf32-frv.c (frvfdpic_hash_table): Likewise.
415 * elf32-hppa.c (hppa_link_hash_table): Likewise.
416 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
417 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
418 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
419 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
420 * elf32-metag.c (metag_link_hash_table): Likewise.
421 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
422 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
423 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
424 * elf32-s390.c (elf_s390_hash_table): Likewise.
425 * elf32-sh.c (sh_elf_hash_table): Likewise.
426 * elf32-spu.c (spu_hash_table): Likewise.
427 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
428 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
429 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
430 * elf64-hppa.c (hppa_link_hash_table): Likewise.
431 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
432 * elf64-s390.c (elf_s390_hash_table): Likewise.
433 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
434 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
435 * elfxx-mips.c (mips_elf_hash_table): Likewise.
436 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
437 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
438
439 2020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
440
441 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
442 int. Use '%u' format with _bfd_error_handler to render it.
443
444 2020-08-25 Alan Modra <amodra@gmail.com>
445
446 PR 26489
447 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
448 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
449
450 2020-08-25 Alan Modra <amodra@gmail.com>
451
452 PR 26492
453 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
454 accessing elf_hash_table_id.
455
456 2020-08-25 Alan Modra <amodra@gmail.com>
457
458 PR 26483
459 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
460 accessing elf_hash_table_id.
461
462 2020-08-24 Mark Wielaard <mark@klomp.org>
463
464 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
465 (read_formatted_entries): Likewise. And skip zero entry.
466
467 2020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
468
469 * bfd-in2.h (bfd_mach_ck860): New.
470 * cpu-csky.c (arch_info_struct): Add item for CK860.
471
472 2020-08-24 Alan Modra <amodra@gmail.com>
473
474 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
475 high part tprel16 relocs.
476 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
477 Clear do_tls_opt on odd instructions.
478 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
479 Don't sanity check them here.
480 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
481 high part tprel16 relocs.
482 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
483 Clear do_tls_opt on odd instructions.
484 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
485
486 2020-08-23 John David Anglin <danglin@gcc.gnu.org>
487
488 PR binutils/26357
489 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
490 * configure: Regenerate.
491
492 2020-08-22 H.J. Lu <hongjiu.lu@intel.com>
493
494 PR ld/26382
495 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
496 versioned symbols, which are defined in shared objects, in
497 symbol string table.
498
499 2020-08-21 Nick Clifton <nickc@redhat.com>
500
501 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
502 the data map if there are entries in it.
503 (_bfd_aarch64_erratum_843419_scan): Likewise.
504
505 2020-08-21 Jan Beulich <jbeulich@suse.com>
506
507 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
508 last byte of debug dir, not first.
509
510 2020-08-20 Nick Clifton <nickc@redhat.com>
511
512 PR 26428
513 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
514 field in the ELF header of the compressed sections.
515
516 2020-08-20 Nick Clifton <nickc@redhat.com>
517
518 PR 26406
519 * elf-bfd.h (struct bfd_elf_section_data): Add
520 has_secondary_relocs field.
521 * elf.c (_bfd_elf_copy_special_section_fields): Set the
522 has_secondary_relocs field for sections which have associated
523 secondary relocs.
524 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
525 on sections which have associated secondary relocs.
526
527 2020-08-15 Alan Modra <amodra@gmail.com>
528
529 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
530 small common section.
531 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
532 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
533 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
534 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
535 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
536 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
537 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
538 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
539 * elf32-v850.c (v850_elf_check_relocs): Likewise.
540 (v850_elf_add_symbol_hook): Likewise.
541 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
542 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
543 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
544 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
545
546 2020-08-15 Alan Modra <amodra@gmail.com>
547
548 PR 26389
549 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
550 SEC_SMALL_DATA.
551 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
552 on small common section.
553 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
554 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
555 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
556 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
557 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
558 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
559
560 2020-08-14 Alan Modra <amodra@gmail.com>
561
562 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
563 rather than another copy of primes. Increase maximum default
564 size allowed.
565
566 2020-08-13 Alan Modra <amodra@gmail.com>
567
568 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
569
570 2020-08-13 Alan Modra <amodra@gmail.com>
571
572 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
573 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
574 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
575 optimization when --no-pcrel-optimize.
576
577 2020-08-13 Alan Modra <amodra@gmail.com>
578
579 PR 26348
580 * bfd.c (struct bfd): Add read_only.
581 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
582 Set read_only on warning.
583 (elf_object_p): Sanity check program header alignment. Set
584 read_only on warning.
585 * bfd-in2.h: Regenerate.
586
587 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
588
589 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
590 win32pstatus note type to avoid signedness comparison warning.
591
592 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
593
594 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
595 win32pstatus notes, and return TRUE so we continue rather than
596 stopping as if it was an error.
597
598 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
599
600 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
601
602 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
603
604 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
605 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
606 appropriate size constraint for each win32pstatus note type.
607
608 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
609
610 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
611 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
612 win32pstatus note.
613
614 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
615
616 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
617 (elfcore_grok_win32pstatus): Use.
618
619 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
620
621 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
622 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
623 offsets used to read NOTE_INFO_PROCESS.
624
625 2020-08-12 Nick Clifton <nickc@redhat.com>
626
627 * po/ru.po: Updated Russian translation.
628 * po/sr.po: Updated Serbian translation.
629
630 2020-08-07 David Faust <david.faust@oracle.com>
631
632 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
633 DISP16 and DISP32 relocations.
634
635 2020-08-05 David Faust <david.faust@oracle.com>
636
637 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
638 (bpf_elf_howto_table): Use it here.
639 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
640 instruction and data relocations.
641
642 2020-08-03 Alan Modra <amodra@gmail.com>
643
644 * vms-lib.c (vms_traverse_index): Sanity check size remaining
645 before accessing vms_idx or vms_elfidx.
646
647 2020-08-03 Alan Modra <amodra@gmail.com>
648
649 PR 26330
650 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
651 size against file size. Correct LONG_MAX limit check.
652 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
653 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
654 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
655 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
656 bfd_malloc_and_get_section.
657
658 2020-07-31 Alan Modra <amodra@gmail.com>
659
660 PR 26314
661 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
662 IR symbols to become dynamic.
663 (elf_link_add_object_symbols): Don't exclude IR symbols when
664 deciding whether an as-needed shared library is needed.
665
666 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
667
668 PR ld/26312
669 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
670 to 0.
671 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
672
673 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
674
675 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
676 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
677 Don't define _STRUCTURED_PROC.
678 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
679 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
680 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
681 * configure, config.in: Regenerate.
682 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
683 * Makefile.in, doc/Makefile.in: Regenerate.
684
685 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
686
687 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
688 (elf_link_hash_table): Add sym_cache.
689 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
690 (elf32_arm_check_relocs): Updated.
691 (elf32_arm_size_dynamic_sections): Likewise.
692 * elf32-bfin.c (bfin_link_hash_table): Removed.
693 (bfin_link_hash_newfunc): Updated.
694 (bfin_hash_table): Removed.
695 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
696 (csky_elf_check_relocs): Updated.
697 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
698 (elf32_hppa_check_relocs): Updated.
699 * elf32-i386.c (elf_i386_tls_transition): Updated.
700 (elf_i386_convert_load_reloc): Likewise.
701 (elf_i386_check_relocs): Likewise.
702 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
703 (m32r_elf_hash_table): Updated.
704 (m32r_elf_link_hash_table_create): Likewise.
705 (m32r_elf_create_dynamic_sections): Likewise.
706 (m32r_elf_adjust_dynamic_symbol): Likewise.
707 (allocate_dynrelocs): Likewise.
708 (m32r_elf_size_dynamic_sections): Likewise.
709 (m32r_elf_relocate_section): Likewise.
710 (m32r_elf_finish_dynamic_symbol): Likewise.
711 (m32r_elf_check_relocs): Likewise.
712 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
713 sym_cache.
714 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
715 (elf_m68k_check_relocs): Updated.
716 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
717 (elf_metag_check_relocs): Updated.
718 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
719 (microblaze_elf_check_relocs): Updated.
720 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
721 (nds32_elf_create_dynamic_sections): Likewise.
722 (nds32_elf_adjust_dynamic_symbol): Likewise.
723 (nds32_elf_check_relocs): Likewise.
724 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
725 srelbss and aym_cache.
726 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
727 (nios2_elf32_check_relocs): Updated.
728 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
729 (or1k_elf_check_relocs): Updated.
730 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
731 (ppc_elf_check_relocs): Updated.
732 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
733 (elf_s390_check_relocs): Updated.
734 (elf_s390_finish_dynamic_sections): Likewise.
735 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
736 and aym_cache.
737 (sh_elf_create_dynamic_sections): Updated.
738 (sh_elf_adjust_dynamic_symbol): Likewise.
739 (sh_elf_size_dynamic_sections): Likewise.
740 (sh_elf_check_relocs): Likewise.
741 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
742 (elf32_tic6x_check_relocs): Updated.
743 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
744 (tilepro_elf_hash_table): Updated.
745 (tilepro_elf_link_hash_table_create): Likewise.
746 (tilepro_elf_check_relocs): Likewise.
747 (tilepro_elf_adjust_dynamic_symbol): Likewise.
748 (allocate_dynrelocs): Likewise.
749 (tilepro_elf_size_dynamic_sections): Likewise.
750 (tilepro_elf_relocate_section): Likewise.
751 (tilepro_elf_finish_dynamic_symbol): Likewise.
752 (tilepro_finish_dyn): Likewise.
753 (tilepro_elf_finish_dynamic_sections): Likewise.
754 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
755 (ppc64_elf_before_check_relocs): Updated.
756 (ppc64_elf_check_relocs): Likewise.
757 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
758 (elf_s390_check_relocs): Updated.
759 (elf_s390_relocate_section): Likewise.
760 (elf_s390_finish_dynamic_sections): Likewise.
761 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
762 (elf_x86_64_check_relocs): Likewise.
763 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
764 sym_cache.
765 (elfNN_aarch64_check_relocs): Updated.
766 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
767 (riscv_elf_check_relocs): Updated.
768 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
769 (mips_elf_resolve_got_page_ref): Updated.
770 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
771 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
772 sym_cache.
773 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
774 (tilegx_elf_check_relocs): Updated.
775 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
776
777 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
778
779 * elflink.c (bfd_elf_final_link): Give local symbols a name if
780 so requested.
781 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
782 return TRUE if making ET_REL output.
783
784 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
785
786 * elf-bfd.h (elf_backend_data): Add
787 `elf_backend_elfsym_local_is_section' member.
788 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
789 macro.
790 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
791 * elflink.c (bfd_elf_final_link): Use it to determine whether
792 set the `.symtab' section's `sh_info' value to the index of the
793 first non-local or non-section symbol.
794 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
795 function.
796 (elf_backend_elfsym_local_is_section): New macro.
797 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
798 function.
799 (elf_backend_elfsym_local_is_section): New macro.
800
801 2020-07-29 Alan Modra <amodra@gmail.com>
802
803 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
804 defined in excluded sections.
805
806 2020-07-28 Alan Modra <amodra@gmail.com>
807
808 * elf.c (assign_section_numbers): Comment. Don't segfault on
809 discarded sections when setting linked-to section for generic
810 ELF linker.
811 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
812
813 2020-07-27 Alan Modra <amodra@gmail.com>
814
815 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
816 similar as absolute.
817 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
818 redefinitions here.
819
820 2020-07-24 Nick Clifton <nickc@redhat.com>
821
822 * config.bfd: Move xc16x target to the obsolete list.
823
824 2020-07-22 Kevin Buettner <kevinb@redhat.com>
825
826 * binary.c (binary_get_section_contents): Seek using offset
827 from section's file position.
828
829 2020-07-22 Kevin Buettner <kevinb@redhat.com>
830
831 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
832
833 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
834
835 PR 26246
836 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
837 type for the first function argument. Rename pointers to reflect
838 that they have distinct types.
839
840 2020-07-20 Alan Modra <amodra@gmail.com>
841
842 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
843
844 2020-07-19 Alan Modra <amodra@gmail.com>
845
846 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
847 (select_alt_stub): New function.
848 (ppc_get_stub_entry): Use it here.
849 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
850 power10_stubs.
851 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
852 merge notoc stubs with other varieties when power10_stubs is "auto".
853 Instead dup the stub hash table entry.
854 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
855 tests of power10_stubs.
856
857 2020-07-15 Alan Modra <amodra@gmail.com>
858
859 PR 26239
860 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
861
862 2020-07-15 Nick Clifton <nickc@redhat.com>
863
864 PR26240
865 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
866 check for aux entries that overflow the buufer.
867
868 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
869
870 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
871 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
872
873 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
874 Alan Modra <amodra@gmail.com>
875
876 PR 26198
877 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
878 objects both before and after normal object files.
879 * elflink.c (_bfd_elf_section_already_linked): Likewise.
880
881 2020-07-10 Alan Modra <amodra@gmail.com>
882
883 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
884 * elf64-ppc.c (struct ppc_link_hash_table): Delete
885 power10_stubs.
886 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
887 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
888 uses of power10_stubs.
889
890 2020-07-09 Alan Modra <amodra@gmail.com>
891
892 * coff-ppc.c: Delete.
893 * pe-ppc.c: Delete.
894 * pei-ppc.c: Delete.
895 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
896 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
897 PPCMAGIC code.
898 (coff_write_object_contents): Remove PPC_PE code.
899 * config.bfd: Move powerpcle-pe to removed targets.
900 * configure.ac: Remove powerpc PE entries.
901 * libcoff-in.h (ppc_allocate_toc_section): Delete.
902 (ppc_process_before_allocation): Delete.
903 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
904 * targets.c: Remove powerpc PE vectors.
905 * po/SRC-POTFILES.in: Regenerate.
906 * libcoff.h: Regenerate.
907 * Makefile.in: Regenerate.
908 * configure: Regenerate.
909
910 2020-07-09 Nick Clifton <nickc@redhat.com>
911
912 * po/fr.po: Updated French translation.
913
914 2020-07-07 Alan Modra <amodra@gmail.com>
915
916 * xcofflink.c (xcoff_mark): Don't mark const sections.
917 (bfd_xcoff_record_link_assignment): Add FIXME.
918 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
919 sections being discarded by linker script.
920
921 2020-07-07 Alan Modra <amodra@gmail.com>
922
923 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
924 time, uid, gid and mode for deterministic archive.
925 (xcoff_write_archive_contents_big): Likewise.
926
927 2020-07-07 Alan Modra <amodra@gmail.com>
928
929 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
930 C_AIX_WEAKEXT.
931
932 2020-07-06 Nick Clifton <nickc@redhat.com>
933
934 * po/pt.po: Updated Portuguese translation.
935 * po/uk.po: Updated Ukranian translation.
936
937 2020-07-04 Nick Clifton <nickc@redhat.com>
938
939 * version.m4: Set version to 2.35.50.
940 * configure: Regenerate.
941 * po/bbfd.pot: Regenerate.
942
943 2020-07-04 Nick Clifton <nickc@redhat.com>
944
945 Binutils 2.35 branch created.
946
947 2020-07-01 Alan Modra <amodra@gmail.com>
948
949 PR 26188
950 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
951 raw syment index before dereferencing.
952
953 2020-07-01 Alan Modra <amodra@gmail.com>
954
955 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
956
957 2020-07-01 Alan Modra <amodra@gmail.com>
958
959 * config.bfd: Obsolete xc16x.
960
961 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
962
963 * archures.c (bfd_mach_i386_nacl): Removed.
964 (bfd_mach_i386_i386_nacl): Likewise.
965 (bfd_mach_x86_64_nacl): Likewise.
966 (bfd_mach_x64_32_nacl): Likewise.
967 * config.bfd: Remove *-*-nacl* targets.
968 * configure.ac: Remove x86 NaCl target vectors.
969 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
970 (bfd_x64_32_nacl_arch): Likewise.
971 (bfd_x86_64_nacl_arch): Likewise.
972 (bfd_i386_nacl_arch): Likewise.
973 (bfd_x64_32_arch_intel_syntax): Updated.
974 * elf32-i386.c: Don't include "elf-nacl.h".
975 (elf_i386_nacl_plt): Removed.
976 (elf_i386_nacl_plt0_entry): Likewise.
977 (elf_i386_nacl_plt_entry): Likewise.
978 (elf_i386_nacl_pic_plt0_entry): Likewise.
979 (elf_i386_nacl_pic_plt_entry): Likewise.
980 (elf_i386_nacl_eh_frame_plt): Likewise.
981 (elf_i386_nacl_plt): Likewise.
982 (elf32_i386_nacl_elf_object_p): Likewise.
983 (elf_i386_get_synthetic_symtab): Updated.
984 (elf_i386_link_setup_gnu_properties): Likewise.
985 * elf64-x86-64.c: Don't include "elf-nacl.h".
986 (elf_x86_64_nacl_plt): Removed.
987 (elf64_x86_64_nacl_elf_object_p): Likewise.
988 (elf_x86_64_nacl_plt0_entry): Likewise.
989 (elf_x86_64_nacl_plt_entry): Likewise.
990 (elf_x86_64_nacl_eh_frame_plt): Likewise.
991 (elf_x86_64_nacl_plt): Likewise.
992 (elf32_x86_64_nacl_elf_object_p): Likewise.
993 (elf_x86_64_get_synthetic_symtab): Updated.
994 (elf_x86_64_link_setup_gnu_properties): Likewise.
995 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
996 * targets.c: Remove x86 NaCl target vectors.
997 * bfd-in2.h: Regenerated.
998 * configure: Likewise.
999
1000 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
1001
1002 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
1003 _bfd_elf_add_dynamic_tags.
1004
1005 2020-06-29 Alan Modra <amodra@gmail.com>
1006
1007 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
1008 return value of bfd_bread. Don't read more than requested length.
1009 Sanity check length. Properly terminate file name.
1010
1011 2020-06-29 Alan Modra <amodra@gmail.com>
1012
1013 * arc-got.h: Use C style comments.
1014 * coff-z80.c: Likewise.
1015 * elf32-csky.c: Likewise.
1016 * peXXigen.c: Likewise.
1017 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
1018 code.
1019
1020 2020-06-26 Pat Bernardi <bernardi@adacore.com>
1021
1022 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
1023 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
1024
1025 2020-06-26 Alan Modra <amodra@gmail.com>
1026
1027 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
1028 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
1029 (riscv_get_priv_spec_name): Move to..
1030 * cpu-riscv.c: ..here.
1031 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
1032 Use %u to print unsigned numbers.
1033
1034 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
1035
1036 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
1037 default architecture.
1038
1039 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1040
1041 PR ld/26083
1042 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
1043 _bfd_elf_add_dynamic_tags.
1044
1045 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1046
1047 PR ld/26083
1048 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
1049 _bfd_elf_add_dynamic_tags.
1050
1051 2020-06-24 Alan Modra <amodra@gmail.com>
1052
1053 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
1054 shifts without undefined behaviour.
1055
1056 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
1057
1058 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
1059 dt_jmprel_required.
1060 (_bfd_elf_add_dynamic_tags): New.
1061 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
1062 _bfd_elf_add_dynamic_tags.
1063 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1064 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
1065 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1066 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
1067 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1068 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1069 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1070 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
1071 Likewise.
1072 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1073 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1074 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1075 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1076 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1077 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1078 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1079 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1080 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
1081 Likewise.
1082 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1083 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1084 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
1085 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1086 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1087 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
1088 Likewise.
1089 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1090 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1091 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
1092 dt_reloc_sz and dt_reloc_ent.
1093 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1094 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1095 Likewise.
1096 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1097 etab.dt_pltgot_required.
1098 (elf32_hppa_size_dynamic_sections): Call
1099 _bfd_elf_add_dynamic_tags.
1100 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1101 etab.dt_pltgot_required.
1102 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1103 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1104 root.dt_pltgot_required for FDPIC output.
1105 (sh_elf_size_dynamic_sections): Call
1106 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1107 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1108 elf.dt_pltgot_required.
1109 (elf_xtensa_size_dynamic_sections): Call
1110 _bfd_elf_add_dynamic_tags.
1111 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1112 root.dt_pltgot_required.
1113 (elf64_hppa_size_dynamic_sections): Call
1114 _bfd_elf_add_dynamic_tags.
1115 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1116 root.dt_pltgot_required.
1117 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1118 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1119 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1120
1121 2020-06-22 Saagar Jha <saagar@saagarjha.com>
1122
1123 * mach-o.c: Support the new load commands by reading a linkedit
1124 data command for them.
1125
1126 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1127
1128 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1129 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1130 (riscv_get_priv_spec_class): Likewise.
1131 (riscv_get_priv_spec_name): Likewise.
1132 (riscv_get_priv_spec_class_from_numbers): New function, convert
1133 the version numbers into string, then call riscv_get_priv_spec_class
1134 to get the priv spec class.
1135 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1136 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1137 (riscv_get_priv_spec_name): Likewise.
1138 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1139 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1140 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1141 of input and output objects form their priv spec attributes by
1142 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1143 errors when linking objects with differnet priv spec versions. We do
1144 know v1.9.1 may have conflicts to other versions, so report the
1145 warning, too. After that, update the output priv spec version to the
1146 newest one so far.
1147
1148 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
1149
1150 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1151 priv attributes, we will check the conflicts for all of them (major,
1152 minor and revision), and then set the priv_attrs_merged to TRUE to
1153 indicate that we have handled all of the priv attributes. Remove
1154 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1155
1156 2020-06-21 Alan Modra <amodra@gmail.com>
1157
1158 PR 26132
1159 * configure.ac: Disable plugins by default for some targets.
1160 * plugin.c: Comment typo fix.
1161 * configure: Regenerate.
1162
1163 2020-06-19 Nick Clifton <nickc@redhat.com>
1164
1165 * plugin.c (try_load_plugin): Suppress the error message about
1166 being unable to open a plugin if creating a list of viable
1167 plugins.
1168
1169 2020-06-16 Alan Modra <amodra@gmail.com>
1170
1171 * aout-tic30.c: Delete file.
1172 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1173 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1174 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1175 (xc16x-*-elf): Sort properly.
1176 * configure.ac: Remove tic30_aout_vec.
1177 * targets.c: Likewise.
1178 * Makefile.in: Regenerate.
1179 * configure: Regenerate.
1180 * po/SRC-POTFILES.in: Regenerate.
1181
1182 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
1183
1184 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1185 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1186 (elf32xtensa_abi): New global variable.
1187 (xtensa_abi_choice): New function.
1188 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1189 XSHAL_ABI to select PLT code.
1190
1191 2020-06-15 Roland McGrath <mcgrathr@google.com>
1192
1193 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1194 field of bfd_link_info.
1195
1196 2020-06-15 Alan Modra <amodra@gmail.com>
1197
1198 * config.bfd: Obsolete powerpcle-*-pe targets.
1199
1200 2020-06-15 Alan Modra <amodra@gmail.com>
1201
1202 PR 26103
1203 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1204 symbols that were defined in discarded sections.
1205 * cofflink.c (coff_link_check_archive_element): Likewise.
1206 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1207 discarded sections.
1208 (_bfd_coff_write_global_sym): Don't emit such symbols.
1209 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1210 libcoff.h: Regenerate.
1211
1212 2020-06-11 Alan Modra <amodra@gmail.com>
1213
1214 PR 26107
1215 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1216
1217 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1218
1219 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1220 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1221 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1222 of reltext.
1223
1224 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1225
1226 PR ld/26094
1227 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1228 Clear verinfo.verdef.
1229
1230 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
1231
1232 PR ld/18801
1233 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1234 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1235 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1236 resolvers.
1237 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1238 Set ifunc_resolvers if there are FUNC resolvers.
1239 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1240 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1241 with elf.ifunc_resolvers.
1242 (write_plt_relocs_for_local_syms): Likewise.
1243 (ppc64_elf_relocate_section): Likewise.
1244 (ppc64_elf_finish_dynamic_sections): Likewise.
1245 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1246 Updated.
1247 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1248 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1249 instead of readonly_dynrelocs_against_ifunc.
1250 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1251 readonly_dynrelocs_against_ifunc.
1252
1253 2020-06-09 Alan Modra <amodra@gmail.com>
1254
1255 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1256 maybe_local_ifunc_resolver field.
1257 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1258 cases where maybe_local_ifunc_resolver was set.
1259 (ppc64_elf_relocate_section): Likewise.
1260 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1261 error to a warning.
1262
1263 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
1264
1265 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1266 tlsdesc_got.
1267 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1268 and dt_tlsdesc_got.
1269 (elf32_arm_size_dynamic_sections): Updated. Clear
1270 root.tlsdesc_plt for DF_BIND_NOW.
1271 (elf32_arm_finish_dynamic_sections): Updated.
1272 (elf32_arm_output_arch_local_syms): Likewise.
1273 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1274 Clear root.tlsdesc_plt for DF_BIND_NOW.
1275 (nds32_elf_finish_dynamic_sections): Updated.
1276 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1277 dt_tlsdesc_plt and dt_tlsdesc_got.
1278 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1279 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1280 tlsdesc_plt and dt_tlsdesc_got.
1281 (elfNN_aarch64_allocate_dynrelocs): Updated.
1282 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1283 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1284 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1285 twice.
1286 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1287 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1288 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1289 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1290 tlsdesc_got.
1291
1292 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1293
1294 * elf32-tic6x.c (elf32_bed): Defined the default to
1295 elf32_tic6x_bed.
1296
1297 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1298
1299 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1300 plt_rel_sec.
1301 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1302 root.splt/root.srelplt.
1303 (elf64_hppa_create_dynamic_sections): Likewise.
1304 (elf64_hppa_size_dynamic_sections): Likewise.
1305 (elf64_hppa_finish_dynamic_symbol): Likewise.
1306 (elf_hppa_final_link): Likewise.
1307 (elf_hppa_final_link_relocate): Likewise.
1308
1309 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1310
1311 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1312 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1313 is_vxworks.
1314
1315 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1316
1317 * elf-bfd.h (elf_target_os): New.
1318 (elf_link_hash_table): Add target_os.
1319 (elf_backend_data): Add target_os.
1320 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
1321 symbian_p and nacl_p.
1322 (create_got_section): Updated.
1323 (elf32_arm_create_dynamic_sections): Likewise.
1324 (arm_type_of_stub): Likewise.
1325 (elf32_arm_create_or_find_stub_sec): Likewise.
1326 (elf32_arm_allocate_plt_entry): Likewise.
1327 (elf32_arm_populate_plt_entry): Likewise.
1328 (elf32_arm_final_link_relocate): Likewise.
1329 (elf32_arm_check_relocs): Likewise.
1330 (allocate_dynrelocs_for_symbol): Likewise.
1331 (elf32_arm_finish_dynamic_symbol): Likewise.
1332 (elf32_arm_finish_dynamic_sections): Likewise.
1333 (elf32_arm_output_plt_map_1): Likewise.
1334 (elf32_arm_output_arch_local_syms): Likewise.
1335 (elf32_arm_add_symbol_hook): Likewise.
1336 (elf32_arm_nacl_link_hash_table_create): Likewise.
1337 (elf32_arm_vxworks_link_hash_table_create): Likewise.
1338 (elf32_arm_symbian_link_hash_table_create): Likewise.
1339 (ELF_TARGET_OS): New.
1340 * elf32-i386.c (elf_i386_arch_bed): Removed.
1341 (elf_backend_arch_data): Likewise.
1342 (elf_i386_solaris_arch_bed): Likewise.
1343 (elf_i386_nacl_arch_bed): Likewise.
1344 (elf_i386_vxworks_arch_bed): Likewise.
1345 (elf_i386_relocate_section): Updated.
1346 (elf_i386_finish_dynamic_sections): Likewise.
1347 (elf_i386_get_synthetic_symtab): Likewise.
1348 (elf_i386_link_setup_gnu_properties): Likewise.
1349 (ELF_TARGET_OS): New.
1350 * elf32-mips.c (ELF_TARGET_OS): New.
1351 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
1352 (ppc_elf_create_got): Updated.
1353 (ppc_elf_create_dynamic_sections): Likewise.
1354 (ppc_elf_check_relocs): Likewise.
1355 (ppc_elf_adjust_dynamic_symbol): Likewise.
1356 (ppc_elf_size_dynamic_sections): Likewise.
1357 (ppc_elf_relocate_section): Likewise.
1358 (ppc_elf_finish_dynamic_sections): Likewise.
1359 (ppc_elf_vxworks_link_hash_table_create): Likewise.
1360 (ELF_TARGET_OS): New.
1361 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
1362 (sh_elf_link_hash_table_create): Updated.
1363 (sh_elf_create_dynamic_sections): Likewise.
1364 (allocate_dynrelocs): Likewise.
1365 (sh_elf_size_dynamic_sections): Likewise.
1366 (sh_elf_relocate_section): Likewise.
1367 (sh_elf_finish_dynamic_symbol): Likewise.
1368 (sh_elf_finish_dynamic_sections): Likewise.
1369 (ELF_TARGET_OS): New.
1370 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1371 Removed.
1372 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1373 (ELF_TARGET_OS): New.
1374 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1375 (elf_x86_64_solaris_arch_bed): Likewise.
1376 (elf_x86_64_nacl_arch_bed): Likewise.
1377 (elf_x86_64_finish_dynamic_sections): Updated.
1378 (elf_x86_64_get_synthetic_symtab): Likewise.
1379 (elf_x86_64_link_setup_gnu_properties): Likewise.
1380 (ELF_TARGET_OS): New.
1381 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1382 target_o.
1383 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1384 (MIPS_ELF_REL_DYN_NAME): Updated.
1385 (ELF_MIPS_GP_OFFSET): Likewise.
1386 (mips_elf_create_local_got_entry): Likewise.
1387 (mips_elf_allocate_dynamic_relocations): Likewise.
1388 (mips_elf_count_got_symbols): Likewise.
1389 (is_gott_symbol): Likewise.
1390 (mips_elf_calculate_relocation): Likewise.
1391 (mips_elf_create_dynamic_relocation): Likewise.
1392 (_bfd_mips_elf_check_relocs): Likewise.
1393 (allocate_dynrelocs): Likewise.
1394 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1395 (mips_elf_lay_out_got): Likewise.
1396 (mips_elf_set_plt_sym_value): Likewise.
1397 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1398 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1399 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1400 (_bfd_mips_elf_final_link): Likewise.
1401 (_bfd_mips_init_file_header): Likewise.
1402 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1403 Likewise.
1404 (allocate_dynrelocs): Likewise.
1405 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1406 (_bfd_sparc_elf_relocate_section): Likewise.
1407 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1408 (sparc_finish_dyn): Likewise.
1409 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1410 * elfxx-target.h (ELF_TARGET_OS): New.
1411 (elfNN_bed): Add ELF_TARGET_OS.
1412 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1413 (_bfd_x86_elf_link_hash_table_create): Likewise.
1414 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1415 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1416 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1417 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1418 * elfxx-x86.h (elf_x86_target_os): Removed.
1419 (elf_x86_backend_data): Likewise.
1420 (get_elf_x86_backend_data): Likewise.
1421 (elf_x86_link_hash_table): Remove target_os.
1422
1423 2020-06-06 Alan Modra <amodra@gmail.com>
1424
1425 * reloc.c: Rename
1426 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
1427 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
1428 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
1429 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
1430 * elf64-ppc.c: Update throughout for reloc renaming.
1431 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
1432 * libbfd.h: Regenerate.
1433 * bfd-in2.h: Regenerate.
1434
1435 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
1436
1437 PR ld/26080
1438 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
1439 section.
1440
1441 2020-06-05 Nick Clifton <nickc@redhat.com>
1442
1443 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
1444 bug.
1445
1446 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
1447
1448 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
1449 priv_may_conflict, in_priv_zero and out_priv_zero to decide
1450 whether the object can be linked according to it's priv
1451 attributes. The object without any priv spec attributes can
1452 be linked with others. If the first input object doesn't contain
1453 any priv attributes, then we need to copy the setting from the
1454 next input one. Also report more detailed error messages to user.
1455
1456 2020-06-04 Stephen Casner <casner@acm.org>
1457
1458 Extend pdp11-aout symbol table format to accommodate .stab
1459 symbols and implement correct handling of them.
1460
1461 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
1462 (N_STAB, is_stab): Needed new function is_stab to disambiguate
1463 normal vs. .stab symbol table type values, replacing N_STAB mask.
1464 (translate_from_native_sym_flags): Determine correct section for
1465 different .stab types.
1466 (translate_to_native_sym_flags): Leave .stab types intact.
1467 (translate_symbol_table): Error if symbol indicates overlay;
1468 store desc field from .stab symbols.
1469 (write_syms): Output desc field with symbol.
1470 (aout_link_check_ar_symbols): Skip .stab symbols.
1471 (aout_link_add_symbols): Correctly distinguish .stab symbols.
1472 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
1473 (aout_link_write_symbols): Write 0 for desk and ovly fields;
1474 correctly distinguish .stab symbols and select calculate their
1475 section and value; and copy desc and ovly fields from input symbol
1476 to output symbol.
1477
1478 2020-06-04 Stephen Casner <casner@acm.org>
1479
1480 * aoutx.h (translate_symbol_table): Comment had external and
1481 internal swapped.
1482 * pdp11.c (translate_symbol_table): Likewise.
1483
1484 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1485
1486 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
1487 (is_x86_elf): Check elf.hash_table_id instead of target_id.
1488 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
1489
1490 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1491
1492 PR ld/26080
1493 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
1494 in debug section against symbol defined in shared library to 0.
1495 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
1496 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
1497 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1498 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
1499 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
1500 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1501 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1502 * elf32-sh.c (sh_elf_check_relocs): Likewise.
1503 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1504 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1505 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1506 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1507 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1508 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
1509 reference.
1510 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
1511 there is non-GOT reference.
1512 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
1513 non-alloced sections.
1514
1515 2020-06-03 Stephen Casner <casner@acm.org>
1516
1517 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
1518
1519 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
1520 files with relocs.
1521 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
1522 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
1523 other size that doesn't qcover the header word.
1524 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
1525 string table, and zero it.
1526 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
1527 message and set bfd_error on finding an invalid name string offset.
1528 (add_to_stringtab): INLINE -> inline
1529 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
1530 bound check.
1531 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
1532 any relocs that could not be recognised.
1533 92744f05809 PR 20929 - Check for relocs without an associated symbol.
1534 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
1535 name exists and is long enough, before attempting to see if it is
1536 for a .o file.
1537 c3864421222 - Correct case for N_SO being the last symbol.
1538 50455f1ab29 PR 20891 - Handle the case where the main file name
1539 and the directory name are both empty.
1540 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
1541 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
1542 range string table offsets.
1543 531336e3a0b PR 20909 - Fix off-by-one error in check for an
1544 illegal string offset.
1545 (aout_link_includes_newfunc): Add comment.
1546 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
1547 on unexpected relocation type rather than ASSERT.
1548
1549 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1550
1551 PR ld/26066
1552 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
1553 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
1554
1555 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1556
1557 PR ld/26066
1558 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
1559 non-alloced sections.
1560
1561 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1562
1563 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
1564 dynamic relocations for non SEC_ALLOC sections.
1565
1566 2020-06-03 Gunther Nikl <gnikl@justmail.de>
1567
1568 * aout64.c (BMAGIC, QMAGIC): Do not define.
1569 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
1570 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
1571 to check the file format.
1572 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
1573 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
1574 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
1575
1576 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1577
1578 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
1579 relocations for non SEC_ALLOC sections.
1580
1581 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1582
1583 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
1584 * elf32-arm.c (maybe_set_textrel): Removed.
1585 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
1586 with _bfd_elf_maybe_set_textrel.
1587 * elf32-csky.c (maybe_set_textrel): Removed.
1588 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
1589 with _bfd_elf_maybe_set_textrel.
1590 * elf32-hppa.c (maybe_set_textrel): Removed.
1591 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
1592 with _bfd_elf_maybe_set_textrel.
1593 * elf32-lm32.c (maybe_set_textrel): Removed.
1594 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
1595 with _bfd_elf_maybe_set_textrel.
1596 * elf32-m32r.c (maybe_set_textrel): Removed.
1597 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
1598 with _bfd_elf_maybe_set_textrel.
1599 * elf32-metag.c (maybe_set_textrel): Removed.
1600 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
1601 with _bfd_elf_maybe_set_textrel.
1602 * elf32-nds32.c (maybe_set_textrel): Removed.
1603 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
1604 with _bfd_elf_maybe_set_textrel.
1605 * elf32-or1k.c (maybe_set_textrel): Removed.
1606 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
1607 with _bfd_elf_maybe_set_textrel.
1608 * elf32-ppc.c (maybe_set_textrel): Removed.
1609 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
1610 with _bfd_elf_maybe_set_textrel.
1611 * elf32-s390.c (maybe_set_textrel): Removed.
1612 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1613 with _bfd_elf_maybe_set_textrel.
1614 * elf32-sh.c (maybe_set_textrel): Removed.
1615 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1616 with _bfd_elf_maybe_set_textrel.
1617 * elf32-tic6x.c (maybe_set_textrel): Removed.
1618 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1619 with _bfd_elf_maybe_set_textrel.
1620 * elf32-tilepro.c (maybe_set_textrel): Removed.
1621 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1622 with _bfd_elf_maybe_set_textrel.
1623 * elf64-ppc.c (maybe_set_textrel): Removed.
1624 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1625 with _bfd_elf_maybe_set_textrel.
1626 * elf64-s390.c (maybe_set_textrel): Removed.
1627 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1628 with _bfd_elf_maybe_set_textrel.
1629 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1630 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1631 with _bfd_elf_maybe_set_textrel.
1632 * elfnn-riscv.c (maybe_set_textrel): Removed.
1633 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1634 with _bfd_elf_maybe_set_textrel.
1635 * elfxx-sparc.c (maybe_set_textrel): Removed.
1636 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1637 with _bfd_elf_maybe_set_textrel.
1638 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1639 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1640 with _bfd_elf_maybe_set_textrel.
1641 * elfxx-x86.c (maybe_set_textrel): Removed.
1642 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1643 with _bfd_elf_maybe_set_textrel.
1644 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1645
1646 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1647
1648 PR ld/26067
1649 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
1650 dyn_relocs.
1651 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
1652 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1653 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
1654 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
1655 Likewise.
1656 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
1657 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
1658 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
1659 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1660 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
1661 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
1662 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1663 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
1664 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
1665 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1666 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
1667 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1668 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
1669 (elf_backend_copy_indirect_symbol): Likewise.
1670 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
1671 (elf_backend_copy_indirect_symbol): Likewise.
1672 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
1673
1674 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1675
1676 PR ld/26067
1677 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
1678 * elf32-arm.c (readonly_dynrelocs): Removed.
1679 (maybe_set_textrel): Replace readonly_dynrelocs with
1680 _bfd_elf_readonly_dynrelocs.
1681 * elf32-csky.c (readonly_dynrelocs): Removed.
1682 (maybe_set_textrel): Replace readonly_dynrelocs with
1683 _bfd_elf_readonly_dynrelocs.
1684 * elf32-hppa.c(readonly_dynrelocs): Removed.
1685 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1686 _bfd_elf_readonly_dynrelocs.
1687 (maybe_set_textrel): Likewise.
1688 * elf32-lm32.c (readonly_dynrelocs): Removed.
1689 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1690 with _bfd_elf_readonly_dynrelocs.
1691 (maybe_set_textrel): Likewise.
1692 * elf32-m32r.c (readonly_dynrelocs): Removed.
1693 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1694 with _bfd_elf_readonly_dynrelocs.
1695 (maybe_set_textrel): Likewise.
1696 * elf32-metag.c (readonly_dynrelocs): Removed.
1697 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
1698 with _bfd_elf_readonly_dynrelocs.
1699 (maybe_set_textrel): Likewise.
1700 * elf32-microblaze.c (readonly_dynrelocs): Removed.
1701 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1702 with _bfd_elf_readonly_dynrelocs.
1703 * elf32-nds32.c (readonly_dynrelocs): Removed.
1704 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1705 with _bfd_elf_readonly_dynrelocs.
1706 (maybe_set_textrel): Likewise.
1707 * elf32-or1k.c (readonly_dynrelocs): Removed.
1708 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1709 with _bfd_elf_readonly_dynrelocs.
1710 * elf32-ppc.c (readonly_dynrelocs): Removed.
1711 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1712 _bfd_elf_readonly_dynrelocs.
1713 (ppc_elf_adjust_dynamic_symbol): Likewise.
1714 (maybe_set_textrel): Likewise.
1715 * elf32-s390.c (readonly_dynrelocs): Removed.
1716 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1717 with _bfd_elf_readonly_dynrelocs.
1718 (maybe_set_textrel): Likewise.
1719 * elf32-sh.c (readonly_dynrelocs): Removed.
1720 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
1721 _bfd_elf_readonly_dynrelocs.
1722 (maybe_set_textrel): Likewise.
1723 * elf32-tic6x.c (readonly_dynrelocs): Removed.
1724 (maybe_set_textrel): Replace readonly_dynrelocs with
1725 _bfd_elf_readonly_dynrelocs.
1726 * elf32-tilepro.c (readonly_dynrelocs): Removed.
1727 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1728 with _bfd_elf_readonly_dynrelocs.
1729 (maybe_set_textrel): Likewise.
1730 * elf64-ppc.c (readonly_dynrelocs): Removed.
1731 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1732 _bfd_elf_readonly_dynrelocs.
1733 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1734 (maybe_set_textrel): Likewise.
1735 * elf64-s390.c (readonly_dynrelocs): Removed.
1736 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1737 with _bfd_elf_readonly_dynrelocs.
1738 (maybe_set_textrel): Likewise.
1739 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
1740 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
1741 (maybe_set_textrel): Replace readonly_dynrelocs with
1742 _bfd_elf_readonly_dynrelocs.
1743 * elfnn-riscv.c (readonly_dynrelocs): Removed.
1744 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1745 with _bfd_elf_readonly_dynrelocs.
1746 (maybe_set_textrel): Likewise.
1747 * elfxx-sparc.c (readonly_dynrelocs): Removed.
1748 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
1749 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
1750 (maybe_set_textrel): Likewise.
1751 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
1752 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1753 with _bfd_elf_readonly_dynrelocs.
1754 (maybe_set_textrel): Likewise.
1755 * elfxx-x86.c (readonly_dynrelocs): Removed.
1756 (maybe_set_textrel): Replace readonly_dynrelocs with
1757 _bfd_elf_readonly_dynrelocs.
1758 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1759
1760 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1761
1762 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
1763 -fsanitize=undefined.
1764
1765 2020-06-03 Alan Modra <amodra@gmail.com>
1766
1767 PR 26069
1768 PR 18758
1769 * peicode.h (pe_ILF_make_a_section): Align data for compilers
1770 other than gcc.
1771 (pe_ILF_build_a_bfd): Likewise.
1772
1773 2020-06-03 Alan Modra <amodra@gmail.com>
1774
1775 PR 26069
1776 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
1777 core files as well as objects.
1778
1779 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
1780
1781 PR ld/26067
1782 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
1783 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
1784 Updated.
1785 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
1786 (elf_arc_link_hash_newfunc): Updated.
1787 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
1788 (elf32_arm_link_hash_newfunc): Updated.
1789 (elf32_arm_copy_indirect_symbol): Likewise.
1790 (elf32_arm_check_relocs): Likewise.
1791 (readonly_dynrelocs): Likewise.
1792 (allocate_dynrelocs_for_symbol): Likewise.
1793 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
1794 (csky_elf_link_hash_newfunc): Updated.
1795 (csky_allocate_dynrelocs): Likewise.
1796 (readonly_dynrelocs): Likewise.
1797 (csky_elf_copy_indirect_symbol): Likewise.
1798 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
1799 (hppa_link_hash_newfunc): Updated.
1800 (elf32_hppa_copy_indirect_symbol): Likewise.
1801 (elf32_hppa_hide_symbol): Likewise.
1802 (elf32_hppa_adjust_dynamic_symbol): Likewise.
1803 (allocate_dynrelocs): Likewise.
1804 (elf32_hppa_relocate_section): Likewise.
1805 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1806 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
1807 (lm32_elf_link_hash_newfunc): Likewise.
1808 (lm32_elf_link_hash_table_create): Updated.
1809 (readonly_dynrelocs): Likewise.
1810 (allocate_dynrelocs): Likewise.
1811 (lm32_elf_copy_indirect_symbol): Likewise.
1812 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1813 (m32r_elf_link_hash_newfunc): Likewise.
1814 (m32r_elf_link_hash_table_create): Updated.
1815 (m32r_elf_copy_indirect_symbol): Likewise.
1816 (allocate_dynrelocs): Likewise.
1817 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1818 (metag_link_hash_newfunc): Updated.
1819 (elf_metag_copy_indirect_symbol): Likewise.
1820 (readonly_dynrelocs): Likewise.
1821 (allocate_dynrelocs): Likewise.
1822 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1823 dyn_relocs.
1824 (link_hash_newfunc): Updated.
1825 (microblaze_elf_check_relocs): Likewise.
1826 (microblaze_elf_copy_indirect_symbol): Likewise.
1827 (readonly_dynrelocs): Likewise.
1828 (allocate_dynrelocs): Likewise.
1829 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1830 (nds32_elf_link_hash_newfunc): Updated.
1831 (nds32_elf_copy_indirect_symbol): Likewise.
1832 (readonly_dynrelocs): Likewise.
1833 (allocate_dynrelocs): Likewise.
1834 (nds32_elf_check_relocs): Likewise.
1835 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1836 (link_hash_newfunc): Updated.
1837 (nios2_elf32_copy_indirect_symbol): Likewise.
1838 (nios2_elf32_check_relocs): Likewise.
1839 (allocate_dynrelocs): Likewise.
1840 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1841 (or1k_elf_link_hash_newfunc): Updated.
1842 (readonly_dynrelocs): Likewise.
1843 (allocate_dynrelocs): Likewise.
1844 (or1k_elf_copy_indirect_symbol): Likewise.
1845 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1846 (ppc_elf_link_hash_newfunc): Updated.
1847 (ppc_elf_copy_indirect_symbol): Likewise.
1848 (ppc_elf_check_relocs): Likewise.
1849 (readonly_dynrelocs): Likewise.
1850 (ppc_elf_adjust_dynamic_symbol): Likewise.
1851 (allocate_dynrelocs): Likewise.
1852 (ppc_elf_relocate_section): Likewise.
1853 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1854 (link_hash_newfunc): Updated.
1855 (elf_s390_copy_indirect_symbol): Likewise.
1856 (readonly_dynrelocs): Likewise.
1857 (elf_s390_adjust_dynamic_symbol): Likewise.
1858 (allocate_dynrelocs): Likewise.
1859 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1860 (sh_elf_link_hash_newfunc): Updated.
1861 (readonly_dynrelocs): Likewise.
1862 (allocate_dynrelocs): Likewise.
1863 (sh_elf_copy_indirect_symbol): Likewise.
1864 (sh_elf_check_relocs): Likewise.
1865 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1866 (elf32_tic6x_link_hash_newfunc): Likewise.
1867 (elf32_tic6x_link_hash_table_create): Updated.
1868 (readonly_dynrelocs): Likewise.
1869 (elf32_tic6x_check_relocs): Likewise.
1870 (elf32_tic6x_allocate_dynrelocs): Likewise.
1871 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1872 dyn_relocs.
1873 (link_hash_newfunc): Updated.
1874 (tilepro_elf_copy_indirect_symbol): Likewise.
1875 (tilepro_elf_check_relocs): Likewise.
1876 (allocate_dynrelocs): Likewise.
1877 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1878 (ppc64_elf_copy_indirect_symbol): Updated.
1879 (ppc64_elf_check_relocs): Likewise.
1880 (readonly_dynrelocs): Likewise.
1881 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1882 (dec_dynrel_count): Likewise.
1883 (allocate_dynrelocs): Likewise.
1884 (ppc64_elf_relocate_section): Likewise.
1885 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1886 (link_hash_newfunc): Updated.
1887 (elf_s390_copy_indirect_symbol): Likewise.
1888 (readonly_dynrelocs): Likewise.
1889 (allocate_dynrelocs): Likewise.
1890 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1891 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1892 dyn_relocs.
1893 (elfNN_aarch64_link_hash_newfunc): Updated.
1894 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1895 (readonly_dynrelocs): Likewise.
1896 (need_copy_relocation_p): Likewise.
1897 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1898 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1899 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1900 (link_hash_newfunc): Updated.
1901 (riscv_elf_copy_indirect_symbol): Likewise.
1902 (riscv_elf_check_relocs): Likewise.
1903 (readonly_dynrelocs): Likewise.
1904 (allocate_dynrelocs): Likewise.
1905 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1906 dyn_relocs.
1907 (link_hash_newfunc): Updated.
1908 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1909 (_bfd_sparc_elf_check_relocs): Likewise.
1910 (readonly_dynrelocs): Likewise.
1911 (allocate_dynrelocs): Likewise.
1912 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1913 (link_hash_newfunc): Updated.
1914 (tilegx_elf_copy_indirect_symbol): Likewise.
1915 (tilegx_elf_check_relocs): Likewise.
1916 (readonly_dynrelocs): Likewise.
1917 (allocate_dynrelocs): Likewise.
1918 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1919 (readonly_dynrelocs): Likewise.
1920 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1921 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1922
1923 2020-06-01 Alan Modra <amodra@gmail.com>
1924
1925 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1926 command against cmd_length, not the end of record. For
1927 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1928 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1929 cmd_length test.
1930
1931 2020-05-28 David Faust <david.faust@oracle.com>
1932
1933 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1934 R_BPF_INSN_{32,64} relocations.
1935
1936 2020-05-28 Stephen Casner <casner@acm.org>
1937
1938 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1939 addreses in .long (used in testsuites) and .stab values.
1940
1941 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1942
1943 PR ld/22909
1944 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1945 Check bfd_link_dll when issue a DT_TEXTREL warning.
1946 * elfxx-x86.c (maybe_set_textrel): Likewise.
1947 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1948
1949 2020-05-26 Nick Clifton <nickc@redhat.com>
1950
1951 * plugin.c (try_load_plugin): Extend error message when a plugin
1952 fails to open.
1953
1954 2020-05-23 Alan Modra <amodra@gmail.com>
1955
1956 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1957
1958 2020-05-22 Alan Modra <amodra@gmail.com>
1959
1960 PR 25882
1961 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1962 attributes from shared libraries, and do not return an error if
1963 they don't match.
1964
1965 2020-05-21 Alan Modra <amodra@gmail.com>
1966
1967 PR 25993
1968 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1969 filename.
1970 (_bfd_delete_bfd): Free the copy.
1971 (_bfd_new_bfd): Free nbfd->memory on error.
1972
1973 2020-05-21 Alan Modra <amodra@gmail.com>
1974
1975 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1976 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1977 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1978 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1979 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1980 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1981 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1982 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1983 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1984 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1985 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1986 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1987 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1988 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1989 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1990 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1991 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1992 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1993 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1994 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1995
1996 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1997
1998 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1999 get_default_version. It is used to find the default version for
2000 the specific extension.
2001 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
2002 default_major_version and default_minor_version. Add new bfd_boolean
2003 parameter *use_default_version. Set it to TRUE if we need to call
2004 the callback rps->get_default_version to find the default version.
2005 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
2006 the default version in riscv_parsing_subset_version, and then call
2007 riscv_add_subset to add the subset into subset list.
2008 (riscv_parse_prefixed_ext): Likewise.
2009 (riscv_std_z_ext_strtab): Support Zicsr extensions.
2010 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
2011 strings rather than characters.
2012 riscv_merge_arch_attr_info): The callback function get_default_version
2013 is only needed for assembler, so set it to NULL int the linker.
2014 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
2015 * elfxx-riscv.h: Updated.
2016
2017 2020-05-20 Alan Modra <amodra@gmail.com>
2018
2019 PR 25993
2020 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
2021 use bfd_set_filename.
2022 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
2023 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
2024 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
2025 (bfd_create): Likewise.
2026 (_bfd_delete_bfd): Don't free filename.
2027 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
2028 return pointer to the copy or NULL on alloc fail.
2029 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
2030 result of bfd_set_filename.
2031 * bfd-in2.h: Regenerate.
2032
2033 2020-05-20 Alan Modra <amodra@gmail.com>
2034
2035 PR 26011
2036 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
2037 section size against file size.
2038 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
2039
2040 2020-05-19 Gunther Nikl <gnikl@justmail.de>
2041
2042 PR 26005
2043 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
2044 and memset when allocating memory for the sections_being_created
2045 array.
2046
2047 2020-05-19 Stafford Horne <shorne@gmail.com>
2048
2049 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
2050 to relgot.
2051 (or1k_elf_relocate_section): Access srelgot via
2052 htab->root.srelgot. Add assertions for srelgot->contents.
2053 Introduce local variable for srelgot to not reuse global
2054 sreloc.
2055 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
2056 (or1k_set_got_and_rela_sizes): New function.
2057 (or1k_initial_exec_offset): New function.
2058 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
2059 (or1k_elf_relocate_section): Allow for TLS to handle multiple
2060 model access.
2061 (or1k_elf_check_relocs): Use OR to set TLS access.
2062 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
2063 sizes.
2064 (or1k_elf_size_dynamic_sections): Use
2065 or1k_set_got_and_rela_sizes to set sizes.
2066 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
2067 (TCB_SIZE): New macro.
2068 (tpoff): Use TCB_SIZE and alignment to calculate offset.
2069 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
2070 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
2071 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
2072 (tpoff): Add dynamic boolean argument.
2073 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
2074
2075 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
2076
2077 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
2078 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
2079 cases with BFD_RELOC_AARCH64_JUMP26.
2080 (elfNN_aarch64_check_relocs): Likewise.
2081
2082 2020-05-19 Alan Modra <amodra@gmail.com>
2083
2084 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
2085 bfd_get_filename rather than accessing bfd->filename directly.
2086 * aout-target.h (MY (object_p)): Likewise.
2087 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2088 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
2089 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
2090 (_bfd_archive_bsd44_construct_extended_name_table),
2091 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
2092 (_bfd_bsd_write_armap): Likewise.
2093 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2094 * cache.c (bfd_open_file): Likewise.
2095 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2096 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2097 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2098 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2099 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2100 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2101 (patch_tls_desc_to_ie): Likewise.
2102 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2103 (spu_elf_auto_overlay): Likewise.
2104 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2105 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2106 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2107 * elflink.c (bfd_elf_size_dynamic_sections),
2108 (elf_link_input_bfd): Likewise.
2109 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2110 * mach-o.c (bfd_mach_o_follow_dsym),
2111 (bfd_mach_o_close_and_cleanup): Likewise.
2112 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2113 (find_separate_debug_file, get_build_id_name): Likewise.
2114 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2115 * plugin.c (bfd_plugin_open_input): Likewise.
2116 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2117 * som.c (som_write_armap): Likewise.
2118 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2119 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2120 (_bfd_vms_lib_write_archive_contents): Likewise.
2121 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2122
2123 2020-05-19 Alan Modra <amodra@gmail.com>
2124
2125 PR 25713
2126 * bfdio.c (_bfd_real_fopen): Typo fix.
2127
2128 2020-05-18 Nick Clifton <nickc@redhat.com>
2129
2130 PR 26005
2131 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2132 for the sections_being_created array.
2133
2134 2020-05-18 Alan Modra <amodra@gmail.com>
2135
2136 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2137 they can be freed without also freeing internal_relocs.
2138
2139 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2140
2141 PR 25713
2142 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2143 separators into DOS style when creating a WIN32 fullpath.
2144
2145 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
2146
2147 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2148 to initialize RISC-V tdata.
2149
2150 2020-05-12 Gunther Nikl <gnikl@justmail.de>
2151
2152 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2153 relocation size.
2154
2155 2020-05-11 Alan Modra <amodra@gmail.com>
2156
2157 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2158
2159 2020-05-11 Alan Modra <amodra@gmail.com>
2160
2161 * elf64-ppc.c: Rename powerxx to power10 throughout.
2162
2163 2020-05-11 Alan Modra <amodra@gmail.com>
2164
2165 PR 25961
2166 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2167 contains required number of auxents before processing any auxent.
2168 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2169 file name from auxents for PE.
2170
2171 2020-05-04 Gunther Nikl <gnikl@justmail.de>
2172
2173 * aout-cris.c (DEFAULT_ARCH): Delete define.
2174 (MY_set_arch_mach): Likewise.
2175 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2176 of bfd_arch_cris.
2177 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2178 of r_type before the shift.
2179
2180 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
2181
2182 PR ld/25665
2183 * elfnn-aarch64.c (group_sections): Copy implementation from
2184 elf32-arm.c.
2185
2186 2020-05-01 Alan Modra <amodra@gmail.com>
2187
2188 PR 25900
2189 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2190 accessing root.u.def of symbols. Also check root.u.def.section
2191 is non-NULL. Reverse tests so as to make the logic positive.
2192
2193 2020-05-01 Alan Modra <amodra@gmail.com>
2194
2195 PR 25882
2196 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2197 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2198
2199 2020-05-01 Alan Modra <amodra@gmail.com>
2200
2201 PR 25882
2202 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2203 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2204 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2205 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2206 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2207 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2208 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2209 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2210 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2211 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2212
2213 2020-05-01 Alan Modra <amodra@gmail.com>
2214
2215 PR 25882
2216 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2217 from shared libraries.
2218
2219 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
2220
2221 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2222 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2223 equals 0. Report overflow when the result has negative sign but
2224 all significant bits are zero.
2225
2226 2020-04-29 Gunther Nikl <gnikl@justmail.de>
2227
2228 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2229 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2230
2231 2020-04-28 Alan Modra <amodra@gmail.com>
2232
2233 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2234 Emit warning message.
2235
2236 2020-04-27 Tamar Christina <tamar.christina@arm.com>
2237
2238 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2239 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2240 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2241 to x86_64_pe_big_vec as it not a big-endian format.
2242 (vec i386_pe_big_vec): New.
2243 * configure.ac: Likewise.
2244 * targets.c: Likewise.
2245 * configure: Regenerate.
2246 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2247 COFF_WITH_PE_BIGOBJ): New.
2248 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2249 New.
2250 (x86_64_pe_be_vec): Moved.
2251
2252 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2253
2254 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2255 * elf.c (elfcore_grok_arc_v2): New function.
2256 (elfcore_grok_note): Call the new function to handle the corresponding
2257 note.
2258 (elfcore_write_arc_v2): New function.
2259 (elfcore_write_register_note): Call the new function to handle the
2260 corresponding pseudo-sections.
2261
2262 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
2263
2264 PR ld/25861
2265 * bfd-in2.h: Regenerated.
2266 * elf32-xtensa.c (elf_howto_table): New entries for
2267 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2268 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2269 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2270 R_XTENSA_NDIFF{8,16,32}.
2271 * libbfd.h (bfd_reloc_code_real_names): Add names for
2272 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2273 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2274 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2275 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2276
2277 2020-04-21 Tamar Christina <tamar.christina@arm.com>
2278
2279 PR binutils/24753
2280 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2281 content.
2282
2283 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2284
2285 PR ld/25849
2286 * elf-bfd.h (elf_backend_data): Add
2287 elf_backend_strip_zero_sized_dynamic_sections.
2288 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2289 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2290 New macro.
2291 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2292 function.
2293 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2294 New macro.
2295 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2296
2297 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2298
2299 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2300 sec.
2301 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2302 DT_TEXTREL with -M.
2303 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2304
2305 2020-04-21 Nick Clifton <nickc@redhat.com>
2306
2307 * po/sr.po: Updated Serbian translation.
2308
2309 2020-04-21 Alan Modra <amodra@gmail.com>
2310
2311 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
2312 processing.
2313
2314 2020-04-20 Stephen Casner <casner@acm.org>
2315
2316 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
2317 causing globals from linker script to be treated as debug symbols.
2318 (translate_symbol_table): Don't sign-extend symbol values from 16
2319 to 64 bits in nm output.
2320
2321 2020-04-20 Alan Modra <amodra@gmail.com>
2322
2323 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
2324
2325 2020-04-18 Alan Modra <amodra@gmail.com>
2326
2327 * section.c (bfd_is_const_section): Correct test for special
2328 sections.
2329 * bfd-in2.h: Regenerate.
2330
2331 2020-04-17 Alan Modra <amodra@gmail.com>
2332
2333 PR 25842
2334 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
2335 NULL nodename.
2336
2337 2020-04-16 Nick Clifton <nickc@redhat.com>
2338
2339 PR 25803
2340 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
2341 abort with a more helpful error message.
2342
2343 2020-04-16 Alan Modra <amodra@gmail.com>
2344
2345 PR 25827
2346 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
2347 strdup(0).
2348
2349 2020-04-15 Fangrui Song <maskray@google.com>
2350
2351 PR binutils/24613
2352 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
2353 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
2354 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2355 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
2356 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2357 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2358 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2359 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2360 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2361 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2362 * elflink.c (elf_link_output_extsym): Likewise.
2363 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2364
2365 2020-04-15 Alan Modra <amodra@gmail.com>
2366
2367 PR 25823
2368 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2369 pointer into strings that may be freed for section name, always
2370 allocate a new string.
2371
2372 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2373 Jan W. Jagersma <jwjagersma@gmail.com>
2374
2375 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2376 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2377 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2378 (_bfd_go32_mkobject): New functions.
2379 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2380 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2381 (go32exe_mkobject): Call _bfd_go32_mkobject.
2382 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2383 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2384 and COFF_GO32.
2385 (coff_write_relocs): Enable extended reloc counter code if
2386 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2387 (coff_write_object_contents): Likewise. Pad section headers
2388 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2389 instead of coff_swap_scnhdr_out.
2390 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2391 enable extended reloc counter.
2392 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2393 Declare with ATTRIBUTE_UNUSED.
2394 * libcoff-in.h: (struct coff_tdata): New field go32.
2395 (obj_go32): Define.
2396 * libcoff.h: Regenerate.
2397
2398 2020-04-14 Fangrui Song <maskray@google.com>
2399
2400 PR gas/25768
2401 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2402 12.
2403
2404 2020-04-14 Stephen Casner <casner@acm.org>
2405
2406 PR ld/25677
2407 * pdp11.c: Add implementation of --imagic option.
2408 (adjust_o_magic): Fix objcopy --extract-symbol test.
2409 * libaout.h (enum aout_magic): Add i_magic.
2410
2411 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2412 Nick Clifton <nickc@redhat.com>
2413
2414 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2415 <0>: Ignore.
2416 <default>: Error rather than abort.
2417
2418 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
2419
2420 PR ld/25767
2421 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2422 relocation section from section group.
2423
2424 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
2425
2426 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
2427 bfd->origin to file offset.
2428 * bfdwin.c (bfd_get_file_window): Likewise.
2429 * bfd.c: Clarify the use of the bfd->origin field.
2430 * bfd-in2.h: Regenerate.
2431 * coff-i386.c: Don't include go32exe.h. Allow overriding
2432 coff_write_object_contents via COFF_WRITE_CONTENTS.
2433 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
2434 (go32exe_write_object_contents): New functions.
2435 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
2436 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
2437 (create_go32_stub): Remove check for 2k size limit. Read stub
2438 from go32exe_temp_stub if present.
2439 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
2440 copy variable-length stub.
2441 (go32_check_format): Read stub to go32exe_temp_stub, set
2442 origin, return go32exe_cleanup.
2443 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
2444 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
2445 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
2446 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
2447 Remove functions and their associated #defines.
2448 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
2449 * libcoff-in.h: (struct coff_tdata): New field stub_size.
2450 Rename field go32stub to stub.
2451 * libcoff.h: Regenerate.
2452 * coff-stgo32.c (go32_check_format): Rename to...
2453 (go32exe_check_format): ...this.
2454 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
2455 (go32exe_copy_private_bfd_data): ...this.
2456 (stub_bytes): Rename to...
2457 (go32exe_default_stub): ...this.
2458 (create_go32_stub): Rename to...
2459 (go32exe_create_stub): ...this.
2460 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
2461 when possible.
2462
2463 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
2464
2465 PR ld/25749
2466 PR ld/25754
2467 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
2468 relocation to R_386_32 for relocation against non-preemptible
2469 absolute symbol.
2470 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
2471 allocate dynamic relocation for non-preemptible absolute symbol.
2472 (elf_i386_relocate_section): Pass sec to
2473 GENERATE_DYNAMIC_RELOCATION_P.
2474 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
2475 (elf_x86_64_convert_load_reloc): Covert load relocation to
2476 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
2477 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
2478 for non-preemptible absolute symbol if they overflow.
2479 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
2480 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
2481 symbol. Don't allocate dynamic relocation for non-preemptible
2482 absolute symbol.
2483 (elf_x86_64_relocate_section): Don't generate relative relocation
2484 for GOTPCREL relocations aganst local absolute symbol. Pass sec
2485 to GENERATE_DYNAMIC_RELOCATION_P.
2486 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
2487 against non-preemptible absolute symbol.
2488 (_bfd_elf_x86_valid_reloc_p): New function.
2489 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
2490 GOT_ABS GOT slot.
2491 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
2492 argument. Don't generate dynamic relocation against
2493 non-preemptible absolute symbol.
2494 (ABS_SYMBOL_P): New.
2495 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
2496 against non-preemptible absolute symbol.
2497 (GOT_ABS): New.
2498 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
2499 (_bfd_elf_x86_valid_reloc_p): New.
2500
2501 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2502
2503 PR ld/16017
2504 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
2505 address in the GOT if in thumb only mode.
2506
2507 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2508
2509 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
2510
2511 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
2512
2513 * mmo.c (mmo_scan): Create .text section only when needed, not
2514 from the start.
2515
2516 2020-03-31 Alan Modra <amodra@gmail.com>
2517
2518 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
2519 return value check.
2520
2521 2020-03-31 Alan Modra <amodra@gmail.com>
2522
2523 * vms-alpha.c (image_write): Check bounds for sections without
2524 contents too. Error on non-zero write to section without
2525 contents.
2526 (_bfd_vms_slurp_etir): Check return of image_write* functions.
2527
2528 2020-03-31 Alan Modra <amodra@gmail.com>
2529
2530 * tekhex.c (pass_over): Check is_eof before reading buffer.
2531
2532 2020-03-30 Nick Clifton <nickc@redhat.com>
2533
2534 PR binutils/pr25662
2535 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
2536 field to timestamp and make it an integer.
2537 * libcoff.h: Regenerate.
2538 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
2539 field in the pe_data structure rather than the insert_timestamp
2540 field.
2541
2542 2020-03-30 Alan Modra <amodra@gmail.com>
2543
2544 PR 25745
2545 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
2546 statistics message.
2547
2548 2020-03-26 Nick Clifton <nickc@redhat.com>
2549
2550 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
2551 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
2552 prototype.
2553 * libbfd.h: Regenerate.
2554
2555 2020-03-26 Alan Modra <amodra@gmail.com>
2556
2557 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2558
2559 2020-03-26 Alan Modra <amodra@gmail.com>
2560
2561 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
2562 array.
2563 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2564
2565 2020-03-25 Nick Clifton <nickc@redhat.com>
2566
2567 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
2568 function.
2569 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
2570 * libbfd.h: Regenerate.
2571
2572 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
2573
2574 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
2575 correct field name in the output string.
2576
2577 2020-03-25 Alan Modra <amodra@gmail.com>
2578
2579 PR 25662
2580 * elf.c (assign_file_positions_for_load_sections): Adjust offset
2581 for SHT_NOBITS section if first in segment.
2582
2583 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2584
2585 PR binutils/25708
2586 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
2587 (_bfd_elf_get_symbol_version_string): This.
2588 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
2589 (_bfd_elf_get_symbol_version_string): This.
2590 (bfd_elf_print_symbol): Pass TRUE to
2591 _bfd_elf_get_symbol_version_string.
2592 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
2593 bfd_boolean argument.
2594 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
2595 * targets.c (_bfd_get_symbol_version_string): Likewise.
2596 (bfd_get_symbol_version_string): Likewise.
2597 * bfd-in2.h: Regenerated.
2598
2599 2020-03-24 Nick Clifton <nickc@redhat.com>
2600 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2601
2602 PR 25713
2603 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
2604 Win32 systems.
2605
2606 2020-03-24 Nick Clifton <nickc@redhat.com>
2607
2608 PR 25681
2609 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
2610 segment to use for PT_GNU_RELRO, ignore empty sections in a
2611 segment's current list.
2612
2613 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2614
2615 PR binutils/25717
2616 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2617
2618 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2619
2620 PR binutils/25708
2621 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2622 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2623 on the previous _bfd_elf_get_symbol_version_string.
2624 (_bfd_elf_get_symbol_version_string): Use it.
2625
2626 2020-03-24 Alan Modra <amodra@gmail.com>
2627
2628 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2629 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2630 struct areltdata.
2631
2632 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
2633
2634 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2635
2636 2020-03-23 Alan Modra <amodra@gmail.com>
2637
2638 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2639 symbol count. Allocate an extra byte to ensure name strings
2640 are terminated. Sanity check name offsets. Release memory on
2641 error return.
2642
2643 2020-03-23 Alan Modra <amodra@gmail.com>
2644
2645 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2646 field hasn't been read. Remove unnecessary casts.
2647
2648 2020-03-22 Alan Modra <amodra@gmail.com>
2649
2650 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
2651 enough to read number of symbols.
2652
2653 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
2654
2655 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
2656 (EXECUTABLE_SUFFIX): Likewise.
2657 * config.in: Regenerated.
2658 * configure: Likewise.
2659 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
2660 _bfd_generic_close_and_cleanup.
2661 (plugin_list_entry): Remove resolution_file, resolution_option,
2662 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
2663 lto_wrapper, gcc_env and initialized,
2664 (need_lto_wrapper_p): Removed.
2665 (get_lto_wrapper): Likewise.
2666 (setup_lto_wrapper_env): Likewise.
2667 (register_all_symbols_read): Likewise.
2668 (egister_cleanup): Likewise.
2669 (get_symbols): Likewise.
2670 (add_input_file): Likewise.
2671 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
2672 (add_symbols): Updated.
2673 (try_claim): Likewise.
2674 (try_load_plugin): Likewise.
2675 (bfd_plugin_canonicalize_symtab): Likewise.
2676 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
2677 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
2678
2679 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
2680
2681 PR binutils/25640
2682 * plugin.c (plugin_list_entry): Add has_symbol_type.
2683 (add_symbols_v2): New function.
2684 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
2685 provides symbol type.
2686 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
2687 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
2688 available.
2689
2690 2020-03-20 Alan Modra <amodra@gmail.com>
2691
2692 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
2693 enough to read number of symbols.
2694
2695 2020-03-20 Alan Modra <amodra@gmail.com>
2696
2697 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
2698 backend functions for NULL before calling.
2699 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
2700 (bfd_section_from_shdr, assign_section_numbers): Likewise.
2701 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
2702 * elfnn-ia64.c (ignore_errors): New function.
2703 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
2704
2705 2020-03-19 Nick Clifton <nickc@redhat.com>
2706
2707 PR 25676
2708 * dwarf2.c (struct varinfo): Add unit_offset field to record the
2709 location of the varinfo in the unit's debug info data. Change the
2710 type of the stack field to a boolean.
2711 (lookup_var_by_offset): New function. Returns the varinfo
2712 structure for the variable described at the given offset in the
2713 unit's debug info.
2714 (scan_unit_for_symbols): Add support for variables which have the
2715 DW_AT_specification attribute.
2716
2717 2020-03-19 Nick Clifton <nickc@redhat.com>
2718
2719 PR 25699
2720 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
2721 error return.
2722
2723 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
2724
2725 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
2726
2727 2020-03-18 Nick Clifton <nickc@redhat.com>
2728
2729 PR 25673
2730 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
2731 memory access when processing a corrupt secondary reloc section.
2732
2733 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
2734
2735 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
2736 instead of calling abort.
2737 * elf32-csky.c (csky_build_one_stub): Likewise.
2738 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2739 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2740 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2741 * elf32-metag.c (metag_build_one_stub): Likewise.
2742 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2743 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2744 (ppc_size_one_stub): Likewise.
2745 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2746
2747 2020-03-17 Nick Clifton <nickc@redhat.com>
2748
2749 PR 25688
2750 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
2751 with error messages.
2752
2753 2020-03-17 Nick Clifton <nickc@redhat.com>
2754
2755 PR 25687
2756 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
2757 free. Add free on another failure path.
2758
2759 2020-03-16 Alan Modra <amodra@gmail.com>
2760
2761 PR 25675
2762 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
2763 we have a non-zero section count. Do lma comparison in octets.
2764
2765 2020-03-16 Alan Modra <amodra@gmail.com>
2766
2767 * vms-alpha.c (dst_restore_location): Validate index into
2768 dst_ptr_offsets array before accessing. Return status.
2769 (dst_retrieve_location): Similarly, making "loc" parameter a
2770 pointer to return value.
2771 (_bfd_vms_slurp_etir): Update calls to above functions.
2772
2773 2020-03-14 Kamil Rytarowski <n54@gmx.com>
2774
2775 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
2776 targets.
2777 * configure: Regenerated.
2778
2779 2020-03-14 Alan Modra <amodra@gmail.com>
2780
2781 * section.c (BFD_FAKE_SECTIONS): Formatting.
2782 * bfd-in2.h: Regenerate.
2783
2784 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2785
2786 * elf.c (elfcore_grok_netbsd_note): Add support for
2787 NT_NETBSDCORE_LWPSTATUS notes.
2788
2789 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
2790
2791 * bfd-in2.h: Regenerate.
2792 * section.c (asection): Add already_assigned field.
2793 (BFD_FAKE_SECTION): Add default initializer for it.
2794 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
2795 * elf32-arm.c (arm_build_one_stub): Add support for
2796 non_contiguous_regions.
2797 * elf32-csky.c (csky_build_one_stub): Likewise.
2798 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2799 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2800 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2801 * elf32-metag.c (metag_build_one_stub): Likewise.
2802 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2803 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2804 (ppc_size_one_stub): Likewise.
2805 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2806 * elflink.c (elf_link_input_bfd): Likewise.
2807
2808 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
2809
2810 PR ld/24920
2811 * elf-linker-x86.h (elf_linker_x86_params): Add
2812 static_before_all_inputs and has_dynamic_linker.
2813 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2814 dynamic input objects if -static is passed at command-line
2815 before all input files without --dynamic-linker unless
2816 --no-dynamic-linker is used.
2817
2818 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2819
2820 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2821
2822 2020-03-13 Christian Eggers <ceggers@gmx.de>
2823
2824 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2825 "p_paddr" from "at".
2826 * elfcode.h (bfd_from_remote_memory): Add units to several
2827 parameters. New local "opb". Fix usage of p_align. Fix
2828 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2829 call of target_read_memory.
2830 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2831 calculation of "offset" and "output_offset".
2832 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2833 from "offset" and fix calculation of "end" from "vma+size". Fix
2834 comparison between "sh_addr" and "vma"/"output_offset".
2835 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2836 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2837 member.
2838 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2839 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2840 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2841 assignment of p_paddr from phdr_lma. Fix comparison between
2842 "lma+size" and "next->lma".
2843 (elf_sort_segments): Fix assignment from p_paddr to lma.
2844 (assign_file_positions_for_load_sections): Add unit (bytes) to
2845 local "align". Fix calculation of local "off_adjust". Fix
2846 calculation of local "filehdr_vaddr".
2847 (assign_file_positions_for_non_load_sections): New local "opb".
2848 Fix calculation of "end" from "p_size". Fix comparison between
2849 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2850 from "end" and "p_vaddr".
2851 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2852 vma. Fix assignment to p_paddr from lma. Fix comparison between
2853 p_paddr and lma. Fix assignment to p_paddr from lma.
2854 * merge.c (sec_merge_emit): New local "opb". Convert
2855 "alignment_power" to octets.
2856 (_bfd_add_merge_section): New locals "alignment_power" and
2857 "opb". Fix comparison between "alignment_power" and
2858 "sizeof(align)".
2859 (_bfd_merge_sections): New local "opb". Divide size by opb
2860 before checking align mask.
2861
2862 2020-03-13 Christian Eggers <ceggers@gmx.de>
2863
2864 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2865 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2866 section LMA/VMA.
2867 (_bfd_elf_make_section_from_phdr): Similarly.
2868 (elf_fake_sections): Fix calculation of
2869 Elf_Internal_shdr::sh_addr from section VMA.
2870 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2871 and bytes.
2872 (assign_file_positions_for_load_sections): Fix calculations of
2873 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2874 comparison between program header address and section LMA.
2875 (assign_file_positions_for_non_load_sections): Likewise.
2876 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2877 (IS_CONTAINED_BY_VMA): Add parameter opb.
2878 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2879 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2880 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2881 Fix calculations of p_addr_valid and p_vaddr_offset.
2882 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2883 with octets per byte when comparing against p_vaddr.
2884
2885 2020-03-11 Alan Modra <amodra@gmail.com>
2886
2887 * som.c (setup_sections): Sanity check subspace.name.
2888
2889 2020-03-11 Alan Modra <amodra@gmail.com>
2890
2891 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2892
2893 2020-03-10 Alan Modra <amodra@gmail.com>
2894
2895 PR 25648
2896 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2897 addresses here.
2898
2899 2020-03-09 Alan Modra <amodra@gmail.com>
2900
2901 * wasm-module.c (wasm_scan): Sanity check file name length
2902 before allocating memory. Move common section setup code. Do
2903 without bfd_tell to calculate section size.
2904
2905 2020-03-06 Nick Clifton <nickc@redhat.com>
2906
2907 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2908 with error messages and failure return values.
2909
2910 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2911
2912 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2913 relocation sections for any removed reference to a dynamic symbol.
2914
2915 2020-03-05 Nick Clifton <nickc@redhat.com>
2916
2917 * elf-bfd.h (struct elf_backend_data): Add new fields:
2918 init_secondary_reloc_section, slurp_secondary_reloc_section,
2919 write_secondary_reloc_section.
2920 (_bfd_elf_init_secondary_reloc_section): Prototype.
2921 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2922 (_bfd_elf_write_secondary_reloc_section): Prototype.
2923 * elf.c ( bfd_section_from_shdr): Invoke the new
2924 init_secondary_reloc_section backend function, if defined, when a
2925 second reloc section is encountered.
2926 (swap_out_syms): Invoke the new symbol_section_index function, if
2927 defined, when computing the section index of an OS/PROC specific
2928 symbol.
2929 (_bfd_elf_init_secondary_reloc_section): New function.
2930 (_bfd_elf_slurp_secondary_reloc_section): New function.
2931 (_bfd_elf_write_secondary_reloc_section): New function.
2932 (_bfd_elf_copy_special_section_fields): New function.
2933 * elfcode.h (elf_write_relocs): Invoke the new
2934 write_secondary_relocs function, if defined, in order to emit
2935 secondary relocs.
2936 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2937 function, if defined, in order to read in secondary relocs.
2938 * elfxx-target.h (elf_backend_copy_special_section_fields):
2939 Provide a non-NULL default definition.
2940 (elf_backend_init_secondary_reloc_section): Likewise.
2941 (elf_backend_slurp_secondary_reloc_section): Likewise.
2942 (elf_backend_write_secondary_reloc_section): Likewise.
2943 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2944 fields.
2945 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2946 * configure: Regenerate.
2947
2948 2020-03-05 Alan Modra <amodra@gmail.com>
2949
2950 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2951 against file size before allocating memory. Use bfd_alloc rather
2952 than bfd_zalloc for carsym/strings memory.
2953
2954 2020-03-04 Alan Modra <amodra@gmail.com>
2955
2956 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2957 sh_addr mod sh_addalign is zero.
2958
2959 2020-03-04 Alan Modra <amodra@gmail.com>
2960
2961 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2962
2963 2020-03-03 Alan Modra <amodra@gmail.com>
2964
2965 * format.c (struct bfd_preserve): Add cleanup field.
2966 (bfd_preserve_save): Add cleanup param and save.
2967 (bfd_preserve_restore): Return cleanup.
2968 (bfd_preserve_finish): Call the cleanup for the discarded match.
2969 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2970 and clear when preserving a match. Restore cleanup too when
2971 restoring that match.
2972
2973 2020-03-02 Alan Modra <amodra@gmail.com>
2974
2975 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2976 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2977 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2978 (core_sco5_vec): Correct initialisers.
2979
2980 2020-03-02 Alan Modra <amodra@gmail.com>
2981
2982 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2983 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2984 * cisco-core.c (cisco_core_file_validate): Likewise.
2985 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2986 * hpux-core.c (hpux_core_core_file_p): Likewise.
2987 * irix-core.c (irix_core_core_file_p): Likewise.
2988 * lynx-core.c (lynx_core_file_p): Likewise.
2989 * netbsd-core.c (netbsd_core_file_p): Likewise.
2990 * osf-core.c (osf_core_core_file_p): Likewise.
2991 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2992 * sco5-core.c (sco5_core_file_p): Likewise.
2993
2994 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2995
2996 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2997
2998 2020-03-02 Alan Modra <amodra@gmail.com>
2999
3000 * targets.c (bfd_cleanup): New typedef.
3001 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
3002 * libbfd-in.h (_bfd_no_cleanup): Define.
3003 * format.c (bfd_reinit): Add cleanup parameter, call it.
3004 (bfd_check_format_matches): Set cleanup from _bfd_check_format
3005 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
3006 * aout-target.h (callback, object_p): Return bfd_cleanup.
3007 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
3008 * archive.c (bfd_generic_archive_p): Likewise.
3009 * binary.c (binary_object_p): Likewise.
3010 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
3011 * coff-ia64.c (ia64coff_object_p): Likewise.
3012 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
3013 * coff-sh.c (coff_small_object_p): Likewise.
3014 * coff-stgo32.c (go32_check_format): Likewise.
3015 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
3016 (xcoff64_core_p): Likewise.
3017 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
3018 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
3019 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
3020 * elfcode.h (elf_object_p): Likewise.
3021 * elfcore.h (elf_core_file_p): Likewise.
3022 * i386msdos.c (msdos_object_p): Likewise.
3023 * ihex.c (ihex_object_p): Likewise.
3024 * libaout.h (some_aout_object_p): Likewise.
3025 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
3026 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
3027 * libbfd.c (_bfd_dummy_target): Likewise.
3028 * libcoff-in.h (coff_object_p): Likewise.
3029 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
3030 (bfd_mach_o_arm64_core_p): Likewise.
3031 * mach-o-arm.c (bfd_mach_o_arm_object_p),
3032 (bfd_mach_o_arm_core_p): Likewise.
3033 * mach-o-i386.c (bfd_mach_o_i386_object_p),
3034 (bfd_mach_o_i386_core_p): Likewise.
3035 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
3036 (bfd_mach_o_x86_64_core_p): Likewise.
3037 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
3038 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
3039 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
3040 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
3041 * mmo.c (mmo_object_p): Likewise.
3042 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
3043 * peicode.h (coff_real_object_p, pe_ILF_object_p),
3044 (pe_bfd_object_p): Likewise.
3045 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
3046 * ppcboot.c (ppcboot_object_p): Likewise.
3047 * rs6000-core.c (rs6000coff_core_p): Likewise.
3048 * som.c (som_object_setup, som_object_p): Likewise.
3049 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
3050 * tekhex.c (tekhex_object_p): Likewise.
3051 * vms-alpha.c (alpha_vms_object_p): Likewise.
3052 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
3053 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
3054 * wasm-module.c (wasm_object_p): Likewise.
3055 * xsym.c (bfd_sym_object_p): Likewise.
3056 * xsym.h (bfd_sym_object_p): Likewise.
3057 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
3058 return type.
3059 * pdp11.c (some_aout_object_p): Likewise.
3060 * plugin.c (register_ld_plugin_object_p): Update object_p
3061 parameter type.
3062 * plugin.h (register_ld_plugin_object_p): Likewise.
3063 * bfd-in2.h: Regenerate.
3064 * libbfd.h: Regenerate.
3065 * libcoff.h: Regenerate.
3066
3067 2020-03-02 Alan Modra <amodra@gmail.com>
3068
3069 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
3070 applicable section flags.
3071 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
3072 (mips_ecoff_bele_vec): Likewise.
3073 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
3074 and .sbss sections.
3075 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
3076 (_bfd_ecoff_styp_to_sec_flags): Likewise.
3077
3078 2020-03-02 Alan Modra <amodra@gmail.com>
3079
3080 * elf32-m32r.c (m32r_elf_section_flags): New function.
3081 (elf_backend_section_flags): Define.
3082 * elf32-nds32.c (nds32_elf_section_flags): New function.
3083 (elf_backend_section_flags): Define.
3084 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
3085 .sbss and .sdata sections.
3086 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
3087 for SHF_V850_GPREL sections.
3088 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
3089 FIXME.
3090 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
3091 for SHF_PARISC_SHORT sections.
3092 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3093 (elf_backend_section_flags): Define.
3094 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3095 for SHF_MIPS_GPREL sections. Delete FIXME.
3096
3097 2020-03-02 Alan Modra <amodra@gmail.com>
3098
3099 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3100 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3101 calling elf_backend_section_flags with adjusted params. Use
3102 newsect->flags past that point.
3103 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3104 special sections.
3105 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3106 to have their type overridden, and all sh_flags but processor and
3107 os specific.
3108 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3109 * elf32-mep.c (mep_elf_section_flags): Likewise.
3110 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3111 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3112 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3113 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3114 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3115 stub BFD and non-aarch64 input files when scanning for stubs.
3116
3117 2020-03-02 Alan Modra <amodra@gmail.com>
3118
3119 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3120 limit to decompressed element size.
3121
3122 2020-03-02 Alan Modra <amodra@gmail.com>
3123
3124 * vms-lib.c (vms_traverse_index): Add recur_count param and
3125 update calls. Fail on excessive recursion.
3126
3127 2020-03-02 Alan Modra <amodra@gmail.com>
3128
3129 * vms-alpha.c (vms_get_remaining_object_record): Use
3130 bfd_realloc_or_free rather than bfd_realloc.
3131 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3132 (dst_define_location, parse_module): Likewise, and check realloc
3133 return status before using memory. Return status from function
3134 adjusting all callers.
3135
3136 2020-02-28 Alan Modra <amodra@gmail.com>
3137
3138 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3139
3140 2020-02-28 Alan Modra <amodra@gmail.com>
3141
3142 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3143 Remove duplicate undersize check.
3144
3145 2020-02-27 Alan Modra <amodra@gmail.com>
3146
3147 PR 24511
3148 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3149
3150 2020-02-27 Alan Modra <amodra@gmail.com>
3151
3152 PR 24511
3153 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3154 (coff_section_type): Adjust comment.
3155 (decode_section_type): Likewise. Call coff_section_type before
3156 decode_section_type.
3157 (bfd_decode_symclass): Use 'c' for common sections other than
3158 the standard one.
3159
3160 2020-02-27 Alan Modra <amodra@gmail.com>
3161
3162 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3163 malloc'd block.
3164
3165 2020-02-27 Alan Modra <amodra@gmail.com>
3166
3167 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3168 if file is an archive element.
3169 * bfd-in2.h: Regenerate.
3170
3171 2020-02-26 Alan Modra <amodra@gmail.com>
3172
3173 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3174 bfd_set_error on failing test. Don't bother changing bfd_error on
3175 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3176 Check sym name is within string buffer. Use size_t for some vars.
3177 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3178 int_buf. Don't change bfd_error on file read error. Use
3179 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3180 calculations to catch overflows before they occur. malloc and
3181 free raw armap rather than using bfd_alloc. Read raw armap before
3182 allocating carsym+strings buffer.
3183 (_bfd_slurp_extended_name_table): Localize variables. Check
3184 name size against file size.
3185
3186 2020-02-26 Alan Modra <amodra@gmail.com>
3187
3188 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3189
3190 2020-02-26 Alan Modra <amodra@gmail.com>
3191
3192 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3193 malloc. Check for NULL return from bfd_malloc.
3194 (rx_table_find, rx_table_map): Likewise.
3195 (rx_set_section_contents): Check bfd_alloc return.
3196 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3197
3198 2020-02-26 Alan Modra <amodra@gmail.com>
3199
3200 * aoutx.h: Indent labels correctly. Format error strings.
3201 * archive.c: Likewise.
3202 * archive64.c: Likewise.
3203 * coff-arm.c: Likewise.
3204 * coff-rs6000.c: Likewise.
3205 * coff-stgo32.c: Likewise.
3206 * cpu-arm.c: Likewise.
3207 * dwarf2.c: Likewise.
3208 * elf-ifunc.c: Likewise.
3209 * elf-properties.c: Likewise.
3210 * elf-s390-common.c: Likewise.
3211 * elf-strtab.c: Likewise.
3212 * elf.c: Likewise.
3213 * elf32-arm.c: Likewise.
3214 * elf32-bfin.c: Likewise.
3215 * elf32-cr16.c: Likewise.
3216 * elf32-csky.c: Likewise.
3217 * elf32-i386.c: Likewise.
3218 * elf32-m68k.c: Likewise.
3219 * elf32-msp430.c: Likewise.
3220 * elf32-nds32.c: Likewise.
3221 * elf32-nios2.c: Likewise.
3222 * elf32-pru.c: Likewise.
3223 * elf32-xtensa.c: Likewise.
3224 * elf64-ia64-vms.c: Likewise.
3225 * elf64-x86-64.c: Likewise.
3226 * elfcode.h: Likewise.
3227 * elfcore.h: Likewise.
3228 * elflink.c: Likewise.
3229 * elfnn-aarch64.c: Likewise.
3230 * elfnn-ia64.c: Likewise.
3231 * elfnn-riscv.c: Likewise.
3232 * elfxx-mips.c: Likewise.
3233 * elfxx-sparc.c: Likewise.
3234 * elfxx-x86.c: Likewise.
3235 * i386lynx.c: Likewise.
3236 * merge.c: Likewise.
3237 * pdp11.c: Likewise.
3238 * plugin.c: Likewise.
3239 * reloc.c: Likewise.
3240
3241 2020-02-26 Alan Modra <amodra@gmail.com>
3242
3243 PR 25593
3244 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3245 "dyn_loaded".
3246 (bfd_elf_add_dt_needed_tag): Declare.
3247 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3248 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3249 from elf_add_dt_needed_tag. Remove soname and doit param.
3250 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3251 to see whether as-needed lib is already loaded, use dyn_loaded
3252 list instead. When saving and restoring around as-needed lib
3253 handle possibility that dynstr has not been initialised. Don't
3254 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3255 Mark libs loaded via DT_NEEDED entries of other libs with
3256 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3257 the output.
3258 (elf_link_check_versioned_symbol): Remove now unneccesary
3259 DYNAMIC check when traversing dyn_loaded list.
3260
3261 2020-02-26 Alan Modra <amodra@gmail.com>
3262
3263 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3264
3265 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
3266
3267 PR binutils/25584
3268 * plugin.c (need_lto_wrapper_p): New.
3269 (bfd_plugin_set_program_name): Add an int argument to set
3270 need_lto_wrapper_p.
3271 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3272 set.
3273 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3274
3275 2020-02-24 Alan Modra <amodra@gmail.com>
3276
3277 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3278
3279 2020-02-24 Alan Modra <amodra@gmail.com>
3280
3281 * vms-lib.c (struct carsym_mem): Add limit.
3282 (vms_add_index): Heed limit.
3283 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3284 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3285 Always return actual number read.
3286 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3287 assertion with error exit.
3288
3289 2020-02-22 Alan Modra <amodra@gmail.com>
3290
3291 PR 25585
3292 * elf.c (assign_file_positions_for_load_sections): Continue linking
3293 on "PHDR segment not covered by LOAD segment" errors.
3294
3295 2020-02-21 Alan Modra <amodra@gmail.com>
3296
3297 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3298 overflow check.
3299 (bfd_mach_o_canonicalize_reloc): Likewise.
3300 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3301 counts and offsets against file size.
3302 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3303 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3304 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3305 against file size. Delete symbol table error message.
3306 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3307 against file size.
3308 (bfd_mach_o_read_symtab): Likewise.
3309 (bfd_mach_o_read_command): Pass file size.
3310 (bfd_mach_o_scan): Sanity check command count against file size.
3311
3312 2020-02-21 Alan Modra <amodra@gmail.com>
3313
3314 PR 25569
3315 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
3316 "text", "data" and "bss" section pointer vars. Don't update
3317 section size, just exec header sizes.
3318 (adjust_sizes_and_vmas): Don't update text section size. Set
3319 initial exec header a_text. Print exec headers sizes.
3320 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
3321 (adjust_sizes_and_vmas): Similarly. Formatting.
3322 (final_link): Correct final file extension.
3323
3324 2020-02-20 Nick Clifton <nickc@redhat.com>
3325
3326 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
3327 callback.
3328 * elfxx-target.h (elf_backend_symbol_section_index): Provide
3329 default definition.
3330 (elfNN_bed): Initialise the symbol_section_index field.
3331 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
3332 OS and PROC specific section indicies. Warn if converting other
3333 reserved incidies to SHN_ABS.
3334
3335 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
3336
3337 PR 25537
3338 * cpu-z80.c: Add machine type compatibility checking.
3339
3340 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
3341
3342 PR binutils/25355
3343 * plugin.c (plugin_list_entry): Remove handle.
3344 (try_load_plugin): Call dlclose before return.
3345
3346 2020-02-19 Alan Modra <amodra@gmail.com>
3347
3348 * libbfd-in.h (_bfd_constant_p): Define.
3349 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
3350 file size before allocating memory.
3351 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
3352 * elf.c (bfd_elf_get_str_section): Likewise.
3353 (_bfd_elf_slurp_version_tables): Likewise.
3354 * libbfd.h: Regenerate.
3355
3356 2020-02-19 Alan Modra <amodra@gmail.com>
3357
3358 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
3359 * aoutx.h (aout_get_external_symbols): Replace calls to
3360 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
3361 (slurp_reloc_table): Likewise.
3362 * archive.c (do_slurp_bsd_armap): Likewise.
3363 (do_slurp_coff_armap): Likewise.
3364 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
3365 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
3366 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
3367 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3368 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3369 (_bfd_coff_get_external_symbols): Likewise.
3370 * ecoff.c (ecoff_slurp_symbolic_header),
3371 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3372 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3373 (ecoff_indirect_link_order): Likewise.
3374 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3375 (_bfd_elf_slurp_version_tables): Likewise.
3376 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3377 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3378 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3379 * elf64-alpha.c (READ): Likewise.
3380 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3381 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3382 * elfcode.h (elf_slurp_symbol_table),
3383 (elf_slurp_reloc_table_from_section): Likewise.
3384 * elflink.c (elf_link_add_object_symbols),
3385 (elf_link_check_versioned_symbol): Likewise.
3386 * elfxx-mips.c (READ): Likewise.
3387 * i386lynx.c (slurp_reloc_table): Likewise.
3388 * lynx-core.c (lynx_core_file_p): Likewise.
3389 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3390 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3391 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3392 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3393 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3394 (bfd_pef_parse_symbols): Likewise.
3395 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3396 * som.c (setup_sections, som_slurp_string_table),
3397 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3398 (som_bfd_fill_in_ar_symbols): Likewise.
3399 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3400 (evax_bfd_print_image): Likewise.
3401 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3402 * wasm-module.c (wasm_scan): Likewise.
3403 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3404 * xsym.c (bfd_sym_read_name_table),
3405 (bfd_sym_print_type_information_table_entry): Likewise.
3406 * libbfd.h: Regenerate.
3407
3408 2020-02-19 Alan Modra <amodra@gmail.com>
3409
3410 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3411 reading external relocs.
3412 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3413 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3414 after bfd_bread.
3415 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3416 bfd_release.
3417 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3418 (m32c_elf_relax_section): Likewise.
3419 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3420 (rl78_elf_relax_section): Likewise.
3421 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3422 (elf32_rx_relax_section): Likewise.
3423 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3424 parameter types and use..
3425 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
3426 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
3427 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
3428 being read from file, just the extra.
3429 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
3430 after reading external syms. Free on failure.
3431
3432 2020-02-19 Alan Modra <amodra@gmail.com>
3433
3434 * coffcode.h (buy_and_read, coff_slurp_line_table),
3435 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
3436 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
3437 corresponding bfd_alloc call. Adjust variables to suit.
3438 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3439 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
3440 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
3441 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
3442 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
3443 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3444 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3445 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3446 * elf64-alpha.c (READ): Likewise.
3447 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
3448 (elf_slurp_symbol_table, elf_slurp_reloc_table),
3449 (bfd_from_remote_memory): Likewise.
3450 * elfcore.h (core_find_build_id): Likewise.
3451 * elfxx-mips.c (READ): Likewise.
3452 * mach-o.c (bfd_mach_o_mangle_sections),
3453 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
3454 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
3455 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
3456 * som.c (setup_sections, som_prep_for_fixups)
3457 (som_build_and_write_symbol_table, som_slurp_symbol_table),
3458 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3459 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
3460 (som_bfd_ar_write_symbol_stuff): Likewise.
3461 * vms-alpha.c (vector_grow1): Likewise.
3462 * vms-lib.c (vms_add_index): Likewise.
3463 * wasm-module.c (wasm_scan_name_function_section): Likewise.
3464 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
3465 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
3466 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
3467 (bfd_alloc2, bfd_zalloc2): Delete.
3468 (_bfd_mul_overflow): Define.
3469 * libbfd.h: Regenerate.
3470
3471 2020-02-19 Alan Modra <amodra@gmail.com>
3472
3473 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
3474 bfd_zalloc2.
3475 (assign_section_numbers): Likewise.
3476 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
3477 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
3478 bfd_malloc2, size_t amt, and unsigned tls_count.
3479 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
3480 * elflink.c (elf_create_symbuf): Use bfd_malloc.
3481 (elf_output_implib): Use bfd_alloc.
3482
3483 2020-02-19 Alan Modra <amodra@gmail.com>
3484
3485 * bfd.c (struct bfd): Move format and direction to other
3486 bitfields. Add "size".
3487 * bfdio.c (bfd_get_size): Cache size when not writing file.
3488 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
3489 returning zero, ie. unknown.
3490 (bfd_get_alt_debug_link_info): Likewise.
3491 * bfd-in2.h: Regenerate.
3492
3493 2020-02-19 Alan Modra <amodra@gmail.com>
3494
3495 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
3496 bfd_get_file_size twice.
3497 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
3498 zero, ie. unknown, return.
3499 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
3500 * elfcode.h (elf_swap_shdr_in): Likewise.
3501 (elf_object_p): Don't call bfd_get_file_size twice and correct
3502 file size check.
3503
3504 2020-02-19 Alan Modra <amodra@gmail.com>
3505
3506 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
3507 FALSE if memory alloc fails. Adjust calls.
3508 * som.c (som_prep_for_fixups): Likewise.
3509 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
3510 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
3511 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
3512 * som.c (som_build_and_write_symbol_table): Return via error_return
3513 on seek failure.
3514 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
3515 (VEC_APPEND_EL): Delete.
3516 (vector_grow1): Return pointer to element. Catch overflow.
3517 Return NULL on memory allocation failure.
3518 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
3519 (alpha_vms_add_fixup_ca): Likewise.
3520 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
3521 before using.
3522 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
3523
3524 2020-02-19 Alan Modra <amodra@gmail.com>
3525
3526 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
3527 * aout-target.h (object_p): Likewise.
3528 * aout-tic30.c (tic30_aout_object_p): Likewise.
3529 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
3530 (emit_stringtab, write_syms, link_hash_table_create),
3531 (aout_link_write_other_symbol): Likewise.
3532 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
3533 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
3534 (_bfd_compute_and_write_armap): Likewise.
3535 * archures.c (bfd_arch_list): Likewise.
3536 * bfd.c (bfd_record_phdr): Likewise.
3537 * binary.c (binary_canonicalize_symtab): Likewise.
3538 * cisco-core.c (cisco_core_file_validate): Likewise.
3539 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
3540 (find_arm_glue, record_arm_to_thumb_glue),
3541 (record_thumb_to_arm_glue): Likewise.
3542 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
3543 (ppc_allocate_toc_section): Likewise.
3544 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
3545 * coff-sh.c (sh_relax_section): Likewise.
3546 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
3547 * coffcode.h (handle_COMDAT, coff_new_section_hook),
3548 (coff_set_alignment_hook, coff_mkobject),
3549 (coff_compute_section_file_positions): Likewise.
3550 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
3551 (coff_find_nearest_line_with_names),
3552 ( bfd_coff_set_symbol_class): Likewise.
3553 * cofflink.c (_bfd_coff_link_hash_table_create),
3554 (_bfd_coff_link_input_bfd): Likewise.
3555 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
3556 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
3557 (build_line_info_table, sort_line_sequences),
3558 (line_info_add_include_dir, line_info_add_file_name),
3559 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
3560 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
3561 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
3562 (_bfd_ecoff_find_nearest_line),
3563 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
3564 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
3565 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
3566 * elf-m10300.c (mn10300_elf_relax_section),
3567 (elf32_mn10300_link_hash_table_create): Likewise.
3568 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
3569 * elf.c (make_mapping, copy_elf_program_header): Likewise.
3570 * elf32-arm.c (elf32_arm_link_hash_table_create),
3571 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
3572 (elf32_arm_new_section_hook): Likewise.
3573 * elf32-avr.c (elf_avr_new_section_hook),
3574 (elf32_avr_link_hash_table_create, get_local_syms),
3575 (elf32_avr_setup_section_lists): Likewise.
3576 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
3577 (bfin_link_hash_table_create): Likewise.
3578 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
3579 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
3580 * elf32-csky.c (csky_elf_link_hash_table_create),
3581 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
3582 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
3583 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
3584 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
3585 * elf32-i386.c (elf_i386_check_relocs): Likewise.
3586 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
3587 * elf32-m32r.c (m32r_elf_link_hash_table_create),
3588 (m32r_elf_check_relocs): Likewise.
3589 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
3590 (elf32_m68hc11_setup_section_lists),
3591 (elf32_m68hc11_size_stubs): Likewise.
3592 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
3593 * elf32-metag.c (elf_metag_link_hash_table_create),
3594 (elf_metag_setup_section_lists): Likewise.
3595 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
3596 (microblaze_elf_check_relocs): Likewise.
3597 * elf32-nds32.c (nds32_elf_link_hash_table_create),
3598 (nds32_elf_check_relocs): Likewise.
3599 * elf32-nios2.c (nios2_elf32_setup_section_lists),
3600 (get_local_syms, nios2_elf32_check_relocs),
3601 (nios2_elf32_link_hash_table_create): Likewise.
3602 * elf32-or1k.c (or1k_elf_link_hash_table_create),
3603 (or1k_elf_check_relocs): Likewise.
3604 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
3605 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
3606 * elf32-s390.c (elf_s390_link_hash_table_create),
3607 (elf_s390_check_relocs): Likewise.
3608 * elf32-score.c (score_elf_create_got_section),
3609 (s3_elf32_score_new_section_hook),
3610 (elf32_score_link_hash_table_create): Likewise.
3611 * elf32-score7.c (score_elf_create_got_section),
3612 (s7_elf32_score_new_section_hook): Likewise.
3613 * elf32-sh.c (sh_elf_link_hash_table_create),
3614 (sh_elf_check_relocs): Likewise.
3615 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3616 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3617 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3618 (tilepro_elf_check_relocs): Likewise.
3619 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3620 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3621 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3622 (elf_xtensa_new_section_hook): Likewise.
3623 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3624 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3625 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3626 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3627 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3628 * elf64-ppc.c (ppc64_elf_new_section_hook),
3629 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3630 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3631 * elf64-s390.c (elf_s390_link_hash_table_create),
3632 (elf_s390_check_relocs): Likewise.
3633 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3634 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3635 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3636 (elf_link_add_archive_symbols, compute_bucket_count),
3637 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3638 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3639 (bfd_elf_final_link): Likewise.
3640 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3641 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3642 (elfNN_aarch64_new_section_hook): Likewise.
3643 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3644 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3645 (riscv_elf_check_relocs): Likewise.
3646 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3647 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3648 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
3649 (_bfd_mips_elf_link_hash_table_create): Likewise.
3650 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
3651 (_bfd_sparc_elf_check_relocs),
3652 (_bfd_sparc_elf_new_section_hook): Likewise.
3653 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
3654 (tilegx_elf_check_relocs): Likewise.
3655 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
3656 * format.c (bfd_check_format_matches): Likewise.
3657 * hash.c (_bfd_stringtab_init): Likewise.
3658 * ihex.c (ihex_scan): Likewise.
3659 * irix-core.c (irix_core_core_file_p): Likewise.
3660 * linker.c (bfd_wrapped_link_hash_lookup),
3661 (_bfd_generic_link_hash_table_create),
3662 (_bfd_generic_reloc_link_order): Likewise.
3663 * lynx-core.c (lynx_core_file_p): Likewise.
3664 * netbsd-core.c (netbsd_core_file_p): Likewise.
3665 * osf-core.c (osf_core_core_file_p): Likewise.
3666 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
3667 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
3668 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
3669 * peicode.h (pe_mkobject): Likewise.
3670 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
3671 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3672 * sco5-core.c (read_uarea): Likewise.
3673 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
3674 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
3675 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
3676 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
3677 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
3678 * srec.c (srec_scan): Likewise.
3679 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
3680 * targets.c (bfd_target_list): Likewise.
3681 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
3682 * trad-core.c (trad_unix_core_file_p): Likewise.
3683 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
3684 (vms_new_section_hook): Likewise.
3685 * wasm-module.c (wasm_make_empty_symbol): Likewise.
3686 * xcofflink.c (xcoff_get_section_contents),
3687 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
3688 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
3689 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
3690
3691 2020-02-19 Alan Modra <amodra@gmail.com>
3692
3693 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
3694
3695 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
3696
3697 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
3698 and use it if it isn't NULL. Remove has_plugin_p argument. Add
3699 a build_list_p argument. Don't search plugin_list. Short circuit
3700 when building the plugin list.
3701 (has_plugin): Renamed to has_plugin_list.
3702 (bfd_plugin_set_plugin): Don't set has_plugin.
3703 (bfd_plugin_specified_p): Check plugin_list instead.
3704 (build_plugin_list): New function.
3705 (load_plugin): Call build_plugin_list and use plugin_list.
3706
3707 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3708
3709 PR binutils/25355
3710 * plugin.c (try_claim): Always clean up for LTO wrapper.
3711 (try_load_plugin): Treat each object as independent. Create a
3712 copy for plugin name.
3713
3714 2020-02-11 Nick Clifton <nickc@redhat.com>
3715
3716 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
3717 for addresses in print statements.
3718 (msp430_elf_relax_delete_bytes): Likewise.
3719 (msp430_elf_relax_add_words): Likewise.
3720 (msp430_elf_relax_section): Likewise.
3721
3722 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3723
3724 * plugin.c (add_symbols): Clear plugin_data memory.
3725
3726 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
3727
3728 PR binutils/25355
3729 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
3730 (EXECUTABLE_SUFFIX): Likewise.
3731 * config.in: Regenerated.
3732 * configure: Likewise.
3733 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
3734 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
3735 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
3736 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
3737 (get_lto_wrapper): New.
3738 (setup_lto_wrapper_env): Likewise.
3739 (current_plugin): Likewise.
3740 (register_all_symbols_read): Likewise.
3741 (register_cleanup): Likewise.
3742 (get_symbols): Likewise.
3743 (add_input_file): Likewise.
3744 (bfd_plugin_close_and_cleanup): Likewise.
3745 (claim_file): Removed.
3746 (register_claim_file): Set current_plugin->claim_file.
3747 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
3748 lto_syms in current_plugin.
3749 (try_claim): Use current_plugin->claim_file. Call LTO plugin
3750 all_symbols_read handler. Copy real symbols to plugin_data.
3751 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
3752 (try_load_plugin): Don't reuse the previous plugin for LTO
3753 wrapper. Set up GCC LTO wrapper if possible. Don't set
3754 plugin_list_iter->claim_file.
3755 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
3756 possible.
3757 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
3758 real_syms.
3759
3760 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3761
3762 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
3763 check if previous instruction matches a conditional jump inserted
3764 earlier. Invert conditional jump and delete branch in this case.
3765
3766 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3767
3768 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
3769 msp430_elf_relax_add_words. Support insertion of either one or two
3770 words.
3771 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
3772 needs to be grown. Handle insertion of branch instruction to replace
3773 jump.
3774
3775 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3776
3777 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
3778 debugging relocations.
3779 (msp430_elf_relax_delete_bytes): Likewise.
3780 (msp430_elf_relax_add_two_words): Likewise.
3781 (msp430_elf_relax_section): Likewise.
3782
3783 2020-02-10 Alan Modra <amodra@gmail.com>
3784
3785 * archures.c: Wrap overlong z80 comments.
3786 * bfd-in2.h: Regenerate.
3787
3788 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
3789
3790 PR 25469
3791 * archures.c: Add GBZ80 and Z80N machine values.
3792 * reloc.c: Add BFD_RELOC_Z80_16_BE.
3793 * coff-z80.c: Add support for new reloc.
3794 * coffcode.h: Add support for new machine values.
3795 * cpu-z80.c: Add support for new machine names.
3796 * elf32-z80.c: Add support for new reloc.
3797 * bfd-in2.h: Regenerate.
3798 * libbfd.h: Regenerate.
3799
3800 2020-02-07 Nick Clifton <nickc@redhat.com>
3801
3802 PR 23932
3803 * elf.c (rewrite_elf_program_header): Do not complain if no
3804 sections are mapped to a segment.
3805
3806 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3807
3808 PR ld/25490
3809 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
3810 for garbage collection on __patchable_function_entries section
3811 without linked-to section.
3812
3813 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3814
3815 PR gas/25381
3816 * bfd-in2.h: Regenerated.
3817 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3818 on section if gc_mark of any of its linked-to sections is set
3819 and don't set gc_mark again.
3820 * section.c (asection): Add linked_to_symbol_name to map_head
3821 union.
3822
3823 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
3824
3825 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3826 reporting an unrecognized instruction with R_V850_LONGJUMP.
3827
3828 2020-02-05 Alan Modra <amodra@gmail.com>
3829
3830 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3831
3832 2020-02-04 Alan Modra <amodra@gmail.com>
3833
3834 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3835 R_PPC_VLE_ADDR20, goto copy_reloc.
3836
3837 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3838
3839 * bfd-in2.h: Regenerated.
3840 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3841
3842 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3843
3844 PR gas/25380
3845 * bfd-in2.h: Regenerated.
3846 * ecoff.c (bfd_debug_section): Add section_id.
3847 * section.c (bfd_section): Add section_id.
3848 (SEC_ASSEMBLER_SECTION_ID): New.
3849 (BFD_FAKE_SECTION): Add section_id.
3850
3851 2020-02-01 Nick Clifton <nickc@redhat.com>
3852
3853 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3854 obsolete list.
3855
3856 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
3857
3858 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3859 encodings are relative to the GOT on nios2, too.
3860
3861 2020-01-31 Alan Modra <amodra@gmail.com>
3862
3863 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3864 file. Use $< and $@ in rules.
3865 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3866 (elf32-ia64.c, elf64-ia64.c): Likewise.
3867 (elf32-riscv.c, elf64-riscv.c): Likewise.
3868 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3869 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3870 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3871 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3872 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3873 * Makefile.in: Regenerate.
3874
3875 2020-01-31 Alan Modra <amodra@gmail.com>
3876
3877 PR 4110
3878 * elf.c (setup_group): Don't clear entire section contents,
3879 just the padding after group flags. Release alloc'd memory
3880 after a seek or read failure.
3881
3882 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3883
3884 * peXXigen.c (pe_is_repro): New function.
3885 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3886 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3887
3888 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3889
3890 * peXXigen.c (debug_type_names): Add names for new debug data type
3891 values.
3892
3893 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3894
3895 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3896 inner loop. Fix a memory leak.
3897
3898 2020-01-30 Alan Modra <amodra@gmail.com>
3899
3900 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3901 or obj_coff_keep_strings here.
3902 (coff_get_normalized_symtab): Free external syms directly.
3903 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3904 on error exit path.
3905
3906 2020-01-27 Jim Wilson <jimw@sifive.com>
3907
3908 * cpu-riscv.c (riscv_scan): New.
3909 (N): Change bfd_default_scan to riscv_scan.
3910
3911 2020-01-27 Andreas Schwab <schwab@suse.de>
3912
3913 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3914 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3915 * Makefile.in: Regenerate.
3916 * cpu-plugin.c: Remove.
3917 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3918 (bfd_plugin_arch): Remove declaration.
3919 * bfd-in2.h: Regenerate.
3920 * po/SRC-POTFILES.in: Regenerate.
3921
3922 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3923 Alan Modra <amodra@gmail.com>
3924
3925 PR ld/25458
3926 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3927
3928 2020-01-24 Jim Wilson <jimw@sifive.com>
3929
3930 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3931 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3932 avoid over long line.
3933
3934 2020-01-24 Nick Clifton <nickc@redhat.com>
3935
3936 PR 25447
3937 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3938 syms and keep strings flags as these may have been set in order to
3939 prevent a bogus call to free.
3940
3941 2020-01-23 Nick Clifton <nickc@redhat.com>
3942
3943 * po/fr.po: Updated French translation.
3944
3945 2020-01-23 Alan Modra <amodra@gmail.com>
3946
3947 PR 25444
3948 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3949 by zero when p_align is zero.
3950
3951 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3952
3953 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3954 (riscv_prefix_cmp): Likewise.
3955 (riscv_non_std_ext_p): Deleted.
3956 (riscv_std_sv_ext_p): Likewise.
3957 (riscv_non_std_sv_ext_p): Likewise.
3958 (riscv_merge_non_std_and_sv_ext): Rename to...
3959 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3960 (riscv_merge_arch_attr_info): Replace 3 calls to
3961 riscv_merge_non_std_and_sv_ext with single call to
3962 riscv_merge_multi_letter_ext.
3963 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3964 encounter a 'z' prefix.
3965 (riscv_get_prefix_class): New function, return prefix class based
3966 on first few characters of input string.
3967 (riscv_parse_config): New structure to factor out minor differences
3968 in extension class parsing behaviour.
3969 (riscv_parse_sv_or_non_std_ext): Rename to...
3970 (riscv_parse_prefixed_ext): and parameterise with
3971 riscv_parse_config.
3972 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3973 (riscv_multi_letter_ext_valid_p): New.
3974 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3975 (riscv_parse_subset): Delegate all non-single-letter parsing work
3976 to riscv_parse_prefixed_ext.
3977 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3978 (riscv_get_prefix_class): Declare.
3979
3980 2020-01-22 Alan Modra <amodra@gmail.com>
3981
3982 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3983 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3984 __tls_get_addr_desc.
3985 (ppc64_elf_size_stubs): Add section for linker generated
3986 __tls_get_addr_desc wrapper function. Loop at least once if
3987 generating this function.
3988 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3989 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3990
3991 2020-01-22 Alan Modra <amodra@gmail.com>
3992
3993 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3994 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3995 tga_desc_fd.
3996 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3997 (STDU_R1_0R1, ADDI_R1_R1): Define.
3998 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3999 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
4000 tga_desc_fd to opt_fd, and tga_desc to opt. Set
4001 no_tls_get_addr_regsave.
4002 (branch_reloc_hash_match): Add hash3 and hash4.
4003 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
4004 (ppc64_elf_size_dynamic_sections): Likewise.
4005 (ppc64_elf_relocate_section): Likewise.
4006 (plt_stub_size, build_plt_stub): Likewise. Size regsave
4007 __tls_get_addr stub.
4008 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
4009 eh_frame.
4010 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
4011 eh_frame for regsave __tls_get_addr.
4012
4013 2020-01-22 Alan Modra <amodra@gmail.com>
4014
4015 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
4016 which __tls_get_addr calls will be eliminated.
4017
4018 2020-01-20 Nick Clifton <nickc@redhat.com>
4019
4020 * po/pt.po: Updates Portuguese translation.
4021 * po/ru.po: Updated Russian translation.
4022 * po/uk.po: Updated Ukranian translation.
4023
4024 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
4025
4026 PR ld/25416
4027 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
4028 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
4029 X32 mode.
4030 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
4031 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
4032 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
4033 "rex leal x@tlsdesc(%rip), %reg" to
4034 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
4035 "call *(%eax)" to "nopl (%rax)".
4036
4037 2020-01-20 Alan Modra <amodra@gmail.com>
4038
4039 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
4040 (MTLR_R11): Don't define.
4041 (LD_R0_0R3, CMPDI_R0_0): Define.
4042 (build_tls_get_addr_stub): Don't use r11 in stub.
4043
4044 2020-01-20 Alan Modra <amodra@gmail.com>
4045
4046 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
4047 (defined_sym_val, is_tls_get_addr): Likewise.
4048
4049 2020-01-18 Nick Clifton <nickc@redhat.com>
4050
4051 * version.m4 (BFD_VERSION): Set to 2.34.50.
4052 * configure: Regenerate.
4053 * po/bfd.pot: Regenerate.
4054
4055 2020-01-18 Nick Clifton <nickc@redhat.com>
4056
4057 Binutils 2.34 branch created.
4058
4059 2020-01-17 Christian Biesinger <cbiesinger@google.com>
4060
4061 * coff-arm.c: Fix spelling error (seperate).
4062 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
4063 error (seperate).
4064 * sysdep.h (strnlen): Fix spelling error (seperate).
4065
4066 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
4067
4068 PR 20694
4069 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
4070
4071 2020-01-15 Alan Modra <amodra@gmail.com>
4072
4073 PR 25384
4074 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
4075 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
4076 of function symbols unless dot symbols are present. Do warn
4077 whenever one is created, regardles of whether a PLT entry is
4078 also emitted for the function symbol.
4079
4080 2020-01-14 Alan Modra <amodra@gmail.com>
4081
4082 * som.c (som_bfd_count_ar_symbols): Error when file position
4083 of symbols on chains is not strictly increasing.
4084
4085 2020-01-14 Alan Modra <amodra@gmail.com>
4086
4087 * vms.h (VMS_DEBUG): Define as 0.
4088 * vms-alpha.c (image_write): Move debug output after bounds check.
4089 Tidy bounds check.
4090 (_bfd_vms_slurp_eihd): Warning fix.
4091 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4092
4093 2020-01-13 Alan Modra <amodra@gmail.com>
4094
4095 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4096 for "ignored" records.
4097
4098 2020-01-13 Alan Modra <amodra@gmail.com>
4099
4100 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4101 Delete asect name check. Move asect NULL check to wasm_object_p.
4102 Correct bounds check of sizes against end. Replace uses of
4103 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4104 just one bfd_release.
4105 (wasm_scan): Don't use malloc/strdup for section names,
4106 bfd_alloc instead. Simplify code prefixing section name.
4107 Formatting. Don't attempt to free memory here..
4108 (wasm_object_p): ..do so here.
4109
4110 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
4111
4112 PR ld/22269
4113 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4114 UNDEFWEAK_NO_DYNAMIC_RELOC.
4115 (allocate_dynrelocs_for_symbol): Likewise.
4116
4117 2020-01-10 Tamar Christina <tamar.christina@arm.com>
4118
4119 PR 25210
4120 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4121
4122 2020-01-10 Alan Modra <amodra@gmail.com>
4123
4124 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4125
4126 2020-01-09 Nick Clifton <nickc@redhat.com>
4127
4128 PR 25221
4129 * bfd.c (bfd_convert_section_contents): Check for a compress
4130 header size that is larger than the actual section size.
4131
4132 2020-01-08 Alan Modra <amodra@gmail.com>
4133
4134 PR 25351
4135 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4136 after removing sections.
4137
4138 2020-01-06 Jim Wilson <jimw@sifive.com>
4139
4140 PR 25205
4141 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4142 check for !bfd_link_pic (info).
4143 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4144 <R_RISCV_JAL>: Add comment.
4145 (_bfd_riscv_relax_section): For plt.offset check, add check for
4146 bfd_link_pic (info). Add comment.
4147
4148 2020-01-06 Alan Modra <amodra@gmail.com>
4149
4150 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4151 match failures. Don't init to bfd_error_wrong_format before
4152 calling _bfd_check_format.
4153
4154 2020-01-06 Alan Modra <amodra@gmail.com>
4155
4156 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4157 status rather than exiting on stack overflow or underflow.
4158 (_bfd_vms_slurp_etir): Adjust to suit.
4159
4160 2020-01-06 Alan Modra <amodra@gmail.com>
4161
4162 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4163
4164 2020-01-06 Alan Modra <amodra@gmail.com>
4165
4166 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4167 command. Check name offset is within command.
4168 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4169 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4170 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4171 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4172 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4173 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4174 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4175 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4176 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4177 (bfd_mach_o_read_segment): Similarly.
4178 (bfd_mach_o_read_thread): Properly bound check thread struct.
4179 Don't repeat checks on second loop.
4180 (bfd_mach_o_read_command): Fail on invalid command length.
4181
4182 2020-01-04 Alan Modra <amodra@gmail.com>
4183
4184 * format.c (bfd_check_format_matches): Add preserve_match.
4185 Save initial bfd state in "preserve", matched bfd state in
4186 "preserve_match". Save just the first match. Release
4187 bfd_alloc memory. Restore and finish preserved state as
4188 appropriate on all function exit paths.
4189
4190 2020-01-04 Alan Modra <amodra@gmail.com>
4191
4192 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4193
4194 2020-01-04 Alan Modra <amodra@gmail.com>
4195
4196 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4197 match too.
4198
4199 2020-01-03 Nick Clifton <nickc@redhat.com>
4200
4201 PR 25307
4202 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4203 there is enough data remaining in the code buffer before
4204 attempting to read a function stub.
4205
4206 2020-01-03 Nick Clifton <nickc@redhat.com>
4207
4208 PR 25308
4209 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4210 return value from bfd_malloc.
4211 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4212 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4213 (elf32_arm_filter_cmse_symbols): Likewise.
4214 (elf32_arm_write_section): Likewise.
4215 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4216 (bfd_mach_o_follow_dsym): Likewise.
4217 * pef.c (bfd_pef_print_loader_section): Likewise.
4218 (bfd_pef_scan_start_address): Likewise.
4219 (bfd_pef_parse_function_stubs): Likewise.
4220 (bfd_pef_parse_symbols): Likewise.
4221
4222 2020-01-03 Sergei Trofimovich <siarheit@google.com>
4223
4224 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4225 on binary inputs ld/PR25316.
4226 (is_ia64_elf): new helper to filter on ia64 objects.
4227
4228 2020-01-03 Jan Beulich <jbeulich@suse.com>
4229
4230 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4231 in parameter names.
4232 (bfd_mach_o_scan): Insert underscore in two variable names.
4233
4234 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
4235
4236 * Makefile.am: Add z80-elf target support.
4237 * configure.ac: Likewise.
4238 * targets.c: Likewise.
4239 * Makefile.in: Regenerate.
4240 * configure: Regenerate.
4241 * config.bfd: Add z80-elf target support and new arches: ez80 and
4242 z180.
4243 * elf32-z80.c: New file.
4244 * archures.c: Add new z80 architectures: eZ80 and Z180.
4245 * coffcode.h: Likewise.
4246 * cpu-z80.c: Likewise.
4247 * coff-z80.c: Add new relocations for Z80 target and local label
4248 check.
4249 * reloc.c: Add new relocs.
4250 * bfd-in2.h: Regenerate.
4251 * libbfd.h: Regenerate.
4252
4253 2020-01-02 Tamar Christina <tamar.christina@arm.com>
4254
4255 PR 25210
4256 PR 24753
4257 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4258
4259 2020-01-01 Alan Modra <amodra@gmail.com>
4260
4261 Update year range in copyright notice of all files.
4262
4263 For older changes see ChangeLog-2019
4264 \f
4265 Copyright (C) 2020 Free Software Foundation, Inc.
4266
4267 Copying and distribution of this file, with or without modification,
4268 are permitted in any medium without royalty provided the copyright
4269 notice and this notice are preserved.
4270
4271 Local Variables:
4272 mode: change-log
4273 left-margin: 8
4274 fill-column: 74
4275 version-control: never
4276 End:
This page took 0.164394 seconds and 5 git commands to generate.