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