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