]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - bfd/ChangeLog
7e6313d91f2cf819b3dc4eed80e1a12dddf9cf97
[thirdparty/binutils-gdb.git] / bfd / ChangeLog
1 2022-12-31 Nick Clifton <nickc@redhat.com>
2
3 * 2.40 branch created.
4
5 2022-12-23 Nick Clifton <nickc@redhat.com>
6
7 PR 29936
8 * dwarf2.c (concat_filename): Fix check for a directory index off
9 the end of the directory table.
10
11 2022-12-21 Nick Clifton <nickc@redhat.com>
12
13 * po/ro.po: Updated Romanian translation.
14
15 2022-12-06 Nick Clifton <nickc@redhat.com>
16
17 PR 29852
18 * elf32-arm.c (cmse_scan): Check for NULL entries in the
19 sym_hashes array.
20 (elf32_arm_gc_mark_extra_sections): Likewise.
21
22 2022-12-05 Nick Clifton <nickc@redhat.com>
23
24 PR 29848
25 * vms-alpha.c (parse_module): Fix potential out of bounds memory
26 access.
27
28 2022-12-01 Nick Clifton <nickc@redhat.com>
29
30 PR 25202
31 * bfd.c (VerilogDataEndianness): New variable.
32 (verilog_write_record): Use VerilogDataEndianness, if set, to
33 choose the endianness of the output.
34 (verilog_write_section): Adjust the address by the data width.
35
36 2022-11-21 Nick Clifton <nickc@redhat.com>
37
38 PR 29764
39 * cpu-arm.c (scan): Accept machine names prefixed with "arm:".
40 * cpu-aarch64.c (scan): Accept machine names prefixed with "aarch64:".
41
42 2022-10-19 Nick Clifton <nickc@redhat.com>
43
44 PR 29699
45 * elf.c (_bfd_elf_slurp_version_tables): Fail if the sh_info field
46 of the section header is zero.
47
48 2022-09-09 Nick Clifton <nickc@redhat.com>
49
50 PR 29532
51 * elf.c (setup_group): Do not return false if there is no group
52 information available.
53
54 2022-09-02 Aaron Merey <amerey@redhat.com>
55
56 * aout-target.h (MY_find_nearest_line_with_alt): New macro.
57 * bfd-in2.h: Regenerate.
58 * bfd.c (bfd_find_nearest_line_with_alt): New macro.
59 * binary.c (binary_find_nearest_line_with_alt): New macro.
60 * coff-rs6000.c (_bfd_xcoff_find_nearest_line_with_alt): New macro.
61 (rs6000_xcoff64_vec): Add coff_find_nearest_line_with_alt.
62 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Calls
63 _bfd_dwarf2_find_nearest_line_with_alt.
64 (_bfd_dwarf2_find_nearest_line_with_alt): New function. Implements the
65 former _bfd_dwarf2_find_nearest_line. Adds parameter alt_filename.
66 Attempt to open alt_filename and use it as the .dwz file if not NULL.
67 * elf-bfd.h (_bfd_elf_find_nearest_line_with_alt): New declaration.
68 * elf.c (_bfd_elf_find_nearest_line): Calls
69 _bfd_elf_find_nearest_line_with_alt.
70 (_bfd_elf_find_nearest_line_with_alt): New function. Implements the
71 former _bfd_elf_find_nearest_line. Adds parameter alt_filename.
72 * elf32-mips.c (bfd_elf32_find_nearest_line_with_alt): New macro.
73 * elf64-mips.c (bfd_elf64_find_nearest_line_with_alt): New macro.
74 * elfn32-mips.c (bfd_elf32_find_nearest_line_with_alt): New macro.
75 * elfxx-mips.h (_bfd_mips_elf_find_nearest_line_with_alt): New macro.
76 * elfxx-target.h (bfd_elfNN_find_nearest_line_with_alt): New macro.
77 * i386mdos.c (msdos_find_nearest_line_with_alt): New macro.
78 * ihex.c (ihex_find_nearest_line_with_alt): New macro.
79 * libbfd-in.h (_bfd_nosymbols_find_nearest_line_with_alt): New
80 declaration.
81 (_bfd_dwarf2_find_nearest_line_with_alt): New declaration.
82 * libbfd.h: Regenerate.
83 * libcoff-in.h (coff_find_nearest_line_with_alt): New macro.
84 * libcoff.h: Regenerate.
85 * libecoff.h (_bfd_ecoff_find_nearest_line_with_alt): New macro.
86 * mach-o.h (bfd_mach_o_find_nearest_line_with_alt): New macro.
87 * mmo.c (mmo_find_nearest_line_with_alt): New macro.
88 * pef.c (bfd_pef_find_nearest_line_with_alt): New macro.
89 * plugin.c (bfd_plugin_find_nearest_line_with_alt): New macro.
90 * ppcboot.c (ppcboot_find_nearest_line_with_alt): New macro.
91 * som.h (som_find_nearest_line_with_alt): New macro.
92 * srec.c (srec_find_nearest_line_with_alt): New macro.
93 * syms.c (_bfd_nosymbols_find_nearest_line_with_alt): New function.
94 * targets.c (BFD_JUMP_TABLE_SYMBOLS): Add symbol for
95 NAME##_find_nearest_line_with_alt.
96 (_bfd_find_nearest_line_with_alt): Add declaration.
97 * tekhex.c (tekhex_find_nearest_line_with_alt): New macro.
98 * verilog.c (verilog_find_nearest_line_with_alt): New macro.
99 * vms-alpha.c (_bfd_vms_find_nearest_line_with_alt): New macro.
100 * wasm-module.c (wasm_find_nearest_line_with_alt): New macro.
101 * xsym.c (bfd_sym_find_nearest_line_with_alt): New macro.
102
103 2022-09-02 Frederic Cambus <fred@statdns.com>
104
105 * config.bfd (arm-*-openbsd*): Restore target.
106
107 2022-08-30 Nick Clifton <nickc@redhat.com>
108
109 PR 29529
110 * dwarf2.c (struct line_info_table): Add new field:
111 use_dir_and_file_0.
112 (concat_filename): Use new field to help select the correct table
113 slot.
114 (read_formatted_entries): Do not skip entry 0.
115 (decode_line_info): Set new field depending upon the version of
116 DWARF being parsed. Initialise filename based upon the setting of
117 the new field.
118
119 2022-08-22 Frederic Cambus <fred@statdns.com>
120
121 * config.bfd (aarch64-*-openbsd*): Add target.
122
123 2022-08-03 Nick Clifton <nickc@redhat.com>
124
125 PR 29389
126 * bfd.c (BFD_CLOSED_BY_CACHE): New bfd flag.
127 * cache.c (bfd_cache_delete): Set BFD_CLOSED_BY_DELETE on the
128 closed bfd.
129 (bfd_cache_lookup_worker): Clear BFD_CLOSED_BY_DELETE on the newly
130 reopened bfd.
131 * opncls.c (bfd_set_filename): Refuse to change the name of a bfd
132 that has been closed by bfd_cache_delete. Mark changed bfds as
133 uncacheable.
134 * bfd-in2.h: Regenerate.
135
136 2022-07-29 Nick Clifton <nickc@redhat.com>
137
138 PR 29424
139 * dwarf2.c (read_attribute_value): Handle DW_FORM_rnglistx and
140 DW_FORM_loclistx.
141
142 2022-07-26 Nick Clifton <nickc@redhat.com>
143
144 * elfnn-loongarch.c (loongarch_elf_relocate_section): Fix
145 indentation.
146
147 2022-07-08 Nick Clifton <nickc@redhat.com>
148
149 * 2.39 branch created.
150
151 2022-05-19 Yvan Roux <yvan.roux@foss.st.com>
152
153 PR 25713
154 * bfdio.c (_bfd_real_fopen): Delete ccs string.
155
156 2022-04-27 John Baldwin <jhb@FreeBSD.org>
157
158 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_TLS notes.
159
160 2022-04-25 Nick Clifton <nickc@redhat.com>
161
162 PR 29072
163 * elflink.c (bfd_elf_size_dynamic_sections): Display a note to the
164 user that the current ehaviour of creating an executable stack
165 because of a missing .note.GNU-stack section is deprecated and
166 will be changed in a future release.
167
168 2022-04-20 Clément Chigot <clement.chigot@atos.net>
169
170 * coff-rs6000.c (xcoff_reloc_type_noop): Add info argument.
171 (xcoff_reloc_type_fail): Likewise.
172 (xcoff_reloc_type_pos): Likewise.
173 (xcoff_reloc_type_neg): Likewise.
174 (xcoff_reloc_type_rel): Likewise.
175 (xcoff_reloc_type_toc): Likewise.
176 (xcoff_reloc_type_ba): Likewise.
177 (xcoff_reloc_type_crel): Likewise.
178 (xcoff_reloc_type_tls): Likewise.
179 (xcoff_reloc_type_br): Add stub handler.
180 (xcoff_ppc_relocate_section): Add info to
181 xcoff_calculate_relocation.
182 (xcoff_stub_indirect_call_code): New constant.
183 (xcoff_stub_shared_call_code): Likewise.
184 (bfd_xcoff_backend_data): Add stub code fields.
185 (bfd_pmac_xcoff_backend_data): Likewise.
186 * coff64-rs6000.c (xcoff64_reloc_type_br): Add stub handler.
187 (xcoff64_ppc_relocate_section): Add info to
188 xcoff64_calculate_relocation.
189 (xcoff64_stub_indirect_call_code): New constant.
190 (xcoff64_stub_shared_call_code): Likewise.
191 (bfd_xcoff_backend_data): Add stub code fields.
192 (bfd_xcoff_aix5_backend_data): Likewise.
193 * libxcoff.h (struct xcoff_backend_data_rec): Add stub fields.
194 (bfd_xcoff_stub_indirect_call_code): New define.
195 (bfd_xcoff_stub_indirect_call_size): New define.
196 (bfd_xcoff_stub_shared_call_code): New define.
197 (bfd_xcoff_stub_shared_call_size): New define.
198 (xcoff_reloc_function): Add info argument.
199 (enum xcoff_stub_type): New enum.
200 (struct xcoff_stub_hash_entry): New structure.
201 * xcofflink.c (struct xcoff_link_hash_table): Add stub hash
202 table and params fields.
203 (xcoff_stub_hash_entry): New define.
204 (xcoff_stub_hash_lookup): New define.
205 (stub_hash_newfunc): New function.
206 (_bfd_xcoff_bfd_link_hash_table_free): Free the new stub hash
207 table.
208 (_bfd_xcoff_bfd_link_hash_table_create): Create the new stub
209 hash table.
210 (xcoff_link_add_symbols): Save rawsize for XTY_SD.
211 (bfd_xcoff_link_init): New function.
212 (xcoff_stub_csect_name): New function.
213 (xcoff_stub_get_csect_in_range): New function.
214 (xcoff_stub_name): New function.
215 (bfd_xcoff_get_stub_entry): New function.
216 (bfd_xcoff_type_of_stub): New function.
217 (xcoff_add_stub): New function.
218 (xcoff_build_one_stub): New function.
219 (bfd_xcoff_size_stubs): New function.
220 (bfd_xcoff_build_stubs): New function.
221 (xcoff_stub_create_relocations): New function.
222 (xcoff_link_input_bfd): Adapt relocations to stub.
223 (xcoff_write_global_symbol): Adapt to new TOC entries generated
224 for stubs.
225 (_bfd_xcoff_bfd_final_link): Handle stub file.
226 * xcofflink.h (struct bfd_xcoff_link_params): New structure.
227
228 2022-04-20 Clément Chigot <clement.chigot@atos.net>
229
230 * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Write len in
231 ldinfo->strings instead of directly in the output_bfd.
232 * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise.
233 * xcofflink.c (struct xcoff_link_hash_table): Remove ldrel_count
234 field. Add ldinfo field.
235 (xcoff_mark_symbol): Adjust to new ldinfo field.
236 (xcoff_mark): Likewise.
237 (bfd_xcoff_link_count_reloc): Likewise.
238 (xcoff_build_loader_section): Split into two functions: one that
239 build the loader section (this function) and one that only size
240 it...
241 (xcoff_size_loader_section): ... (this function).
242 (bfd_xcoff_size_dynamic_sections): Adapt to new ldinfo field.
243 Move the part where the dynamic sections are build to ...
244 (bfd_xcoff_build_dynamic_sections): ... this function.
245 * xcofflink.h: Add bfd_xcoff_build_dynamic_sections prototype.
246
247 2022-04-13 Alexander von Gluck IV <kallisti5@unixzen.com>
248
249 * config.bfd (x86-haiku): Add i386_pei_vec as a selectable format.
250
251 2022-04-08 Nick Clifton <nickc@redhat.com>
252
253 PR 29038
254 * coffgen.c (coff_find_nearest_line_with_names): Fix typo
255 retrieving saved bias.
256
257 2022-04-07 Mark Harmstone <mark@harmstone.com>
258
259 * coff-i386.c (in_reloc_p): Add R_SECTION.
260 (howto_table): Add R_SECTION.
261 (coff_pe_i386_relocation_section): Add support for R_SECTION.
262 (coff_i386_reloc_type_lookup): Add support for
263 BFD_RELOC_16_SECCIDX.
264 * coff-x86_64.c (in_reloc_p): Add R_SECTION.
265 (howto_table): Add R_SECTION.
266 (coff_pe_amd64_relocation_section): Add support for R_SECTION.
267 (coff_amd64_reloc_type_lookup): Add support for
268 BFD_RELOC_16_SECCIDX.
269 * reloc.c: Add BFD_RELOC_16_SECIDX.
270 * bfd-in2.h: Regenerate.
271 * libbfd.h: Regenerate.
272
273 2022-04-01 John Baldwin <jhb@FreeBSD.org>
274
275 * elf-bfd.h (elfcore_write_x86_segbases): New.
276 * elf.c (elfcore_grok_freebsd_note): Add pseudosections for
277 NT_FREEBSD_X86_SEGBASES register notes.
278 (elfcore_write_x86_segbases): New.
279 (elfcore_write_register_note): Write NT_FREEBSD_X86_SEGBASES
280 register notes.
281
282 2022-04-01 John Baldwin <jhb@FreeBSD.org>
283
284 * elf.c (elfcore_grok_freebsd_note): Remove checks for namesz.
285
286 2022-03-22 Steiner H Gunderson <steinar+sourceware@gunderson.no>
287
288 * dwarf2.c (_bfd_dwarf2_find_nearest_line): if a function name is
289 found, but no line number info, then return a result of 2.
290
291 2022-03-21 Steiner H Gunderson <steinar+sourceware@gunderson.no>
292
293 PR 28978
294 * dwarf2.c (scan_unit_for_symbols): When performing second pass,
295 check to see if the function or variable being processed is the
296 same as the previous one.
297
298 2022-03-18 Viorel Preoteasa <viorel.preoteasa@gmail.com>
299
300 PR 28924
301 * elf32-arm.c (THM_MAX_FWD_BRANCH_OFFSET): Fix definition.
302 (THM2_MAX_FWD_BRANCH_OFFSET): Likewise.
303
304 2022-03-16 Simon Marchi <simon.marchi@efficios.com>
305
306 * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES):
307 Add cpu-amdgcn.c.
308 (BFD64_BACKENDS): Add elf64-amdgcn.lo.
309 (BFD64_BACKENDS_CFILES): Add elf64-amdgcn.c.
310 * Makefile.in: Re-generate.
311 * cpu-amdgcn.c: New.
312 * elf64-amdgcn.c: New.
313 * archures.c (bfd_architecture): Add bfd_arch_amdgcn and related
314 mach defines.
315 (bfd_amdgcn_arch): New.
316 (bfd_archures_list): Add bfd_amdgcn_arch.
317 * bfd-in2.h: Re-generate.
318 * config.bfd: Handle amdgcn* target.
319 * configure.ac: Handle amdgcn_elf64_le_vec.
320 * configure: Re-generate.
321 * elf-bfd.h (elf_target_id): Add AMDGCN_ELF_DATA.
322 * targets.c (amdgcn_elf64_le_vec): New.
323 (_bfd_target_vector): Add amdgcn_elf64_le_vec.
324
325 2022-03-01 Torbjörn Svensson <torbjorn.svensson@st.com>
326 Fred Eisele <fredrick.eisele@gmail.com>
327
328 PR 25713
329 * bfdio.c (_bfd_real_fopen): Fix typo.
330
331 2022-03-01 Nick Clifton <nickc@redhat.com>
332
333 PR 28848
334 * elf32-arm.c (elf32_arm_merge_eabi_attributes): If the first
335 input bfd has a Tag_ABI_HardFP_use set to 3 but does not also have
336 TAG_FP_arch set then reset the TAG_ABI_HardFP_use.
337
338 2022-02-28 Torbjörn Svensson <torbjorn.svensson@st.com>
339 Fred Eisele <fredrick.eisele@gmail.com>
340
341 PR 25713
342 * bfdio.c (_bfd_real_fopen): Fix handling of paths longer than 260
343 characters on Windows hosts.
344
345 2022-02-28 Nick Clifton <nickc@redhat.com>
346
347 PR 28886
348 * config.bfd: Update error message for obsolete configurations.
349
350 2022-02-17 Nick Clifton <nickc@redhat.com>
351
352 * po/sr.po: Updated Serbian translation.
353
354 2022-02-16 Fangrui Song <maskray@google.com>
355 Nick Clifton <nickc@redhat.com>
356
357 PR ld/28841
358 * bfd-in2.h (struct bfd_section): Add type.
359 (discarded_section): Add field.
360 * elf.c (elf_fake_sections): Handle bfd_section::type.
361 * section.c (BFD_FAKE_SECTION): Add field.
362 * mri.c (mri_draw_tree): Update function call.
363
364 2022-02-11 Michael Forney <mforney@mforney.org>
365
366 * bfd.c (bfd_set_gp_value): Remove return with expression
367 in void function.
368
369 2022-02-09 Nick Clifton <nickc@redhat.com>
370
371 * config.bfd: Move pending obsolesence targets into the definitely
372 obsolete list.
373
374 2022-02-02 Nick Clifton <nickc@redhat.com>
375
376 PR 28834
377 * dwarf2.c (read_section): Change the heuristic that checks for
378 overlarge dwarf debug info sections.
379
380 2022-02-02 Stafford Horne <shorne@gmail.com>
381
382 PR 28735
383 * elf32-or1k.c (or1k_elf_got16_no_overflow_howto): Define.
384 (or1k_elf_relocate_section): Use new howto instead of trying to
385 mask out relocation bits.
386
387 2022-01-24 Roland McGrath <mcgrathr@google.com>
388
389 * doc/local.mk (%D%/bfdver.texi): Add mkdir command.
390
391 2022-01-24 Nick Clifton <nickc@redhat.com>
392
393 * po/fr.po: Updated French translation.
394 * po/ro.po: Updated Romanian translation.
395 * po/uk.po: Updated Ukranian translation.
396
397 2022-01-22 Nick Clifton <nickc@redhat.com>
398
399 * version.m4: Change to 2.38.50.
400 * configure: Regenerate.
401 * po/bfd.pot: Regenerate.
402
403 2022-01-22 Nick Clifton <nickc@redhat.com>
404
405 * 2.38 release branch created.
406
407 2022-01-17 Nick Clifton <nickc@redhat.com>
408
409 * Makefile.in: Regenerate.
410 * configure: Regenerate.
411 * doc/Makefile.in: Regenerate.
412 * po/bfd.pot: Regenerate.
413
414 2021-12-15 Nikita Popov <npv1310@gmail.com>
415
416 PR 28687
417 * dwarf1.c (parse_die): Fix undefined behaviour in range tests.
418
419 2021-11-17 Nick Clifton <nickc@redhat.com>
420
421 PR 28452
422 * elf.c (assign_file_positions_for_non_load_sections): Replace
423 assertion with a warning message.
424
425 2021-10-19 Nick Clifton <nickc@redhat.com>
426
427 * linker.c (_bfd_generic_link_add_one_symbol): Test for a NULL
428 name before checking to see if the symbol is __gnu_lto_slim.
429 * archive.c (_bfd_compute_and_write_armap): Likewise.
430
431 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
432
433 * configure: Regenerate.
434
435 2021-09-15 Andrew Burgess <andrew.burgess@embecosm.com>
436
437 * archures.c (bfd_arch_list): Use 'char *' instead of 'char **'
438 when calculating space for a string list.
439
440 2021-09-014 Cupertino Miranda <cmiranda@synopsys.com>
441 Claudiu Zissulescu <claziss@synopsys.com>
442
443 * arc-got.h (arc_static_sym_data): New structure.
444 (get_static_sym_data): New function.
445 (relocate_fix_got_relocs_for_got_info): Move the computation fo
446 symbol value and section to above introduced function, and use
447 this new function.
448
449 2021-09-07 Luis Machado <luis.machado@linaro.org>
450
451 Revert: [AArch64] MTE corefile support
452
453 2021-05-21 Luis Machado <luis.machado@linaro.org>
454
455 * elf.c (elfcore_make_memtag_note_section): New function.
456 (elfcore_grok_note): Handle NT_MEMTAG note types.
457
458 2021-09-07 Nick Clifton <nickc@redhat.com>
459
460 PR 28305
461 * elf32-xtensa.c (elf_xtensa_do_reloc): Add check for put of range
462 reloc.
463
464 PR 28303
465 * elfxx-riscv.c (riscv_elf_add_sub_reloc): Add check for out of
466 range relocs.
467
468 2021-08-10 Nick Clifton <nickc@redhat.com>
469
470 * po/sr.po: Updated Serbian translation.
471
472 2021-07-18 Nick Clifton <nickc@redhat.com>
473
474 * config.bfd: Move pending obsoletion targets to obsolete list.
475
476 2021-07-16 Giulio Benetti <giulio.benetti@benettiengineering.com>
477
478 * elf32-or1k.c (or1k_elf_relocate_section): Use a separate entry
479 in switch case R_OR1K_INSN_REL_26 where we need to check for
480 !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
481
482 2021-07-14 Clément Chigot <clement.chigot@atos.net>
483
484 * libxcoff.h (struct xcoff_dwsect_name): Add DWARF name.
485 * coff-rs6000.c (xcoff_dwsect_names): Update.
486 * coffcode.h (sec_to_styp_flags): Likewise.
487 (coff_new_section_hook): Likewise.
488
489 2021-07-10 Alan Modra <amodra@gmail.com>
490
491 * dwarf2.c (read_address): Remove accidental commit.
492 (read_ranges): Compare offset rather than pointers.
493
494 2021-07-08 Nick Clifton <nickc@redhat.com>
495
496 * po/pt.po: Updated Portuguese translation.
497
498 2021-07-07 Nick Clifton <nickc@redhat.com>
499
500 * elfcode.h (elf_swap_symbol_out): Revert accidental change that
501 removed an abort if the shndx pointer is NULL.
502
503 2021-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
504
505 * sysdep.h [!ENABLE_NLS]: Prevent inclusion of <libintl.h> on
506 Solaris.
507
508 2021-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
509
510 * configure.ac: Check for strnlen declaration.
511 * configure, config.in: Regenerate.
512
513 2021-07-07 Nick Clifton <nickc@redhat.com>
514
515 PR 28051
516 * coff-rs6000.c (xcoff_reloc_type_tls): Reformat error messages in
517 order to fix problems when translating.
518 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
519 * elfnn-aarch64.c (_bfd_aarch64_erratum_843419_branch_to_stub):
520 Likewise.
521 * po/bfd.pot: Regenerate.
522
523 2021-07-06 Michael Matz <matz@suse.de>
524
525 PR ld/28021
526 * elfnn-riscv.c (riscv_relax_delete_bytes): Check for any
527 versioning.
528
529 2021-07-06 Alan Modra <amodra@gmail.com>
530
531 PR 28055
532 * elf64-bpf.c (bpf_elf_generic_reloc): Add missing ATTRIBUTE_UNUSED.
533
534 2021-07-05 Alan Modra <amodra@gmail.com>
535
536 PR 28055
537 * elf64-bpf.c (bpf_elf_generic_reloc): Use correct bfd for bfd_put
538 and bfd_put_32 calls. Correct section limit checks.
539
540 2021-07-03 Nick Clifton <nickc@redhat.com>
541
542 * version.m4: Update version number.
543 * configure: Regenerate.
544 * po/opcodes.pot: Regenerate.
545
546 2021-07-03 Nick Clifton <nickc@redhat.com>
547
548 * 2.37 release branch created.
549
550 2021-07-02 Nick Clifton <nickc@redhat.com>
551
552 PR 28046
553 * dwarf2.c (read_ranges): Check that range_ptr does not exceed
554 range_end.
555
556 2021-06-30 YunQiang Su <yunqiang.su@cipunited.com>
557
558 PR mips/28009
559 * bfd/elfxx-mips.c (_bfd_mips_elf_section_from_shdr,
560 _bfd_mips_elf_fake_sections): Mark LTO debug info as
561 SHT_MIPS_DWARF.
562
563 2021-06-29 Nick Clifton <nickc@redhat.com>
564
565 * config.bfd (obsolete configurations): Add netbsdpe.
566
567 2021-06-22 Nelson Chu <nelson.chu@sifive.com>
568
569 * elfnn-riscv.c (riscv_pcrel_hi_reloc): Added field to store
570 the original relocation type, in case the type is converted to
571 R_RISCV_HI20.
572 (riscv_pcrel_lo_reloc): Removed unused name field.
573 (riscv_pcrel_relocs): Added comments.
574 (riscv_zero_pcrel_hi_reloc): Removed unused input_bfd.
575 (riscv_record_pcrel_hi_reloc): Updated.
576 (riscv_record_pcrel_lo_reloc): Likewise.
577 (riscv_resolve_pcrel_lo_relocs): Likewise. Check the original
578 type of auipc, to make sure the %pcrel_lo without any addends.
579 Otherwise, report dangerous relocation error.
580 (riscv_elf_relocate_section): Updated above functions are changed.
581 For R_RISCV_GOT_HI20, report dangerous relocation error when addend
582 isn't zero.
583
584 2021-06-19 H.J. Lu <hongjiu.lu@intel.com>
585
586 PR ld/27998
587 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Count PLT for GOTOFF
588 relocation against IFUNC symbols.
589 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
590
591 2021-06-19 H.J. Lu <hongjiu.lu@intel.com>
592
593 * elflink.c (bfd_elf_final_link): Correct DT_TEXTREL warning in
594 PDE.
595
596 2021-06-18 H.J. Lu <hongjiu.lu@intel.com>
597
598 * elf-properties.c (_bfd_elf_parse_gnu_properties): Handle
599 GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI,
600 GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI.
601 (elf_merge_gnu_properties): Likewise.
602
603 2021-06-11 Alan Modra <amodra@gmail.com>
604
605 PR 27952
606 * elf-bfd.h (struct elf_obj_tdata): Add is_pie.
607 * elflink.c (elf_link_add_object_symbols): Set is_pie.
608
609 2021-06-09 Nick Clifton <nickc@redhat.com>
610
611 PR 27666
612 * config.bfd: Do not add the sparc_elf32_vec or sparc_elf64_vec
613 vectors to Sparc Solaris2 targets.
614
615 2021-06-08 Michael Matz <matz@suse.de>
616
617 * elf.c (bfd_section_from_shdr): Set has_secondary_relocs flag.
618 (_bfd_elf_slurp_secondary_reloc_section): Use it for early-out.
619
620 2021-06-07 Jan Beulich <jbeulich@suse.com>
621
622 * dwarf2.c (read_ranges, read_rnglists): Add u suffix to constant.
623
624 2021-06-02 Alan Modra <amodra@gmail.com>
625
626 * elf-attrs.c (_bfd_elf_parse_attributes): Break out of loop if
627 subsection length is too small to cover tag and length field.
628
629 2021-05-31 Nelson Chu <nelson.chu@sifive.com>
630 Lifang Xia <lifang_xia@c-sky.com>
631
632 PR 27566
633 * elfnn-riscv.c (struct riscv_elf_link_hash_table): New integer pointer
634 to monitor the data segment phase.
635 (bfd_elfNN_riscv_set_data_segment_info): New function called by
636 after_allocation, to set the data_segment_phase from expld.dataseg.
637 (_bfd_riscv_relax_section): Don't relax when data_segment_phase is
638 exp_seg_relro_adjust (0x4).
639 * elfxx-riscv.h (bfd_elf32_riscv_set_data_segment_info): New extern.
640 (bfd_elf64_riscv_set_data_segment_info): Likewise
641
642 2021-05-28 H.J. Lu <hongjiu.lu@intel.com>
643
644 PR ld/27905
645 * elf32-i386.c: Don't include "libiberty.h".
646 (elf_howto_table): Revert commits a7664973b24 and 50c95a739c9.
647 (elf_i386_rtype_to_howto): Revert commit 50c95a739c9.
648 (elf_i386_info_to_howto_rel): Likewise.
649 (elf_i386_tls_transition): Likewise.
650 (elf_i386_relocate_section): Likewise.
651 * elf64-x86-64.c (x86_64_elf_howto_table): Revert commits
652 a7664973b24 and 50c95a739c9.
653 (elf_x86_64_rtype_to_howto): Revert commit 50c95a739c9.
654 * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Likewise.
655 * elfxx-x86.h (elf_x86_obj_tdata): Likewise.
656 (elf_x86_has_code16): Likewise.
657
658 2021-05-26 H.J. Lu <hongjiu.lu@intel.com>
659
660 PR ld/27905
661 * elf32-i386.c: Include "libiberty.h".
662 (elf_howto_table): Add 16-bit R_386_PC16 entry.
663 (elf_i386_rtype_to_howto): Add a BFD argument. Use 16-bit
664 R_386_PC16 if input has 16-bit mode instructions.
665 (elf_i386_info_to_howto_rel): Update elf_i386_rtype_to_howto
666 call.
667 (elf_i386_tls_transition): Likewise.
668 (elf_i386_relocate_section): Likewise.
669 * elf64-x86-64.c (x86_64_elf_howto_table): Add 16-bit
670 R_X86_64_PC16 entry.
671 (elf_x86_64_rtype_to_howto): Use 16-bit R_X86_64_PC16 if input
672 has 16-bit mode instructions.
673 * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Set
674 elf_x86_has_code16 if relocatable input is marked with
675 GNU_PROPERTY_X86_FEATURE_2_CODE16.
676 * elfxx-x86.h (elf_x86_obj_tdata): Add has_code16.
677 (elf_x86_has_code16): New.
678
679 2021-05-26 Nelson Chu <nelson.chu@sifive.com>
680
681 * elfxx-riscv.h (check_unknown_prefixed_ext): New bool.
682 * elfxx-riscv.c (riscv_parse_prefixed_ext): Do not check the
683 prefixed extension name if check_unknown_prefixed_ext is false.
684 * elfnn-riscv.c (riscv_merge_arch_attr_info): Set
685 check_unknown_prefixed_ext to false for linker.
686
687 2021-05-25 Nick Clifton <nickc@redhat.com>
688
689 * elf32-arn.c (struct elf_arm_obj_tdata): Add num_entries field.
690 (elf32_arm_num_entries): New macro.
691 (elf32_arm_allocate_local_sym_info): Initialise the new field.
692 Allocate arrays individually so that buffer overruns can be
693 detected by memory checkers.
694 (elf32_arm_create_local_iplt): Check num_entries.
695 (elf32_arm_get_plt_info): Likewise.
696 (elf32_arm_final_link_relocate): Likewise.
697 (elf32_arm_check_relocs): Likewise.
698 (elf32_arm_size_dynamic_sections): Likewise.
699 (elf32_arm_output_arch_local_syms): Likewise.
700
701 2021-05-25 Nick Clifton <nickc@redhat.com>
702
703 * elf32-arm.c: Fix formatting.
704
705 2021-05-25 Alan Modra <amodra@gmail.com>
706
707 * elf-attrs.c (elf_attr_strdup): New function.
708 (_bfd_elf_attr_strdup): Use it here.
709 (elf_add_obj_attr_string): New function, extracted from..
710 (bfd_elf_add_obj_attr_string): ..here.
711 (elf_add_obj_attr_int_string): New function, extracted from..
712 (bfd_elf_add_obj_attr_int_string): ..here.
713 (_bfd_elf_parse_attributes): Don't allocate an extra byte for a
714 string terminator. Instead ensure parsing doesn't go past
715 end of sub-section. Use size_t variables for lengths.
716
717 2021-05-22 Alan Modra <amodra@gmail.com>
718
719 * libbfd.c (_bfd_safe_read_leb128): Remove length_return parameter.
720 Replace data pointer with pointer to pointer. Increment pointer
721 over bytes read.
722 * libbfd-in.h (_bfd_safe_read_leb128): Update prototype.
723 * elf-attrs.c (_bfd_elf_parse_attributes): Adjust to suit. Be
724 careful not to increment data pointer past end. Remove now
725 redundant pr17512 check.
726 * wasm-module.c (READ_LEB128): Adjust to suit changes to
727 _bfd_safe_read_leb128.
728 * dwarf2.c (read_n_bytes): New inline function, old one renamed to..
729 (read_blk): ..this. Allocate and return block. Increment bfd_byte**
730 arg.
731 (read_3_bytes): New function.
732 (read_1_byte, read_1_signed_byte, read_2_bytes, read_4_bytes),
733 (read_8_bytes, read_string, read_indirect_string),
734 (read_indirect_line_string, read_alt_indirect_string): Take a
735 byte_byte** arg which is incremented over bytes read. Remove any
736 bytes_read return. Rewrite limit checks to compare lengths
737 rather than pointers.
738 (read_abbrevs, read_attribute_value, read_formatted_entries),
739 (decode_line_info, find_abstract_instance, read_ranges),
740 (read_rnglists, scan_unit_for_symbols, parse_comp_unit),
741 (stash_comp_unit): Adjust to suit. Rewrite limit checks to
742 compare lengths rather than pointers.
743 * libbfd.h: Regenerate.
744
745 2021-05-21 Luis Machado <luis.machado@linaro.org>
746
747 * elf.c (elfcore_make_memtag_note_section): New function.
748 (elfcore_grok_note): Handle NT_MEMTAG note types.
749
750 2021-05-20 Andrew Burgess <andrew.burgess@embecosm.com>
751
752 * section.c (bfd_get_section_by_name): Return NULL if name is
753 NULL.
754 (bfd_get_section_by_name_if): Likewise.
755 * dwarf2.c (read_section): Remove unneeded NULL check.
756 (find_debug_info): Likewise.
757
758 2021-05-19 Nick Clifton <nickc@redhat.com>
759
760 * plugin.c (bfd_plugin_open_input): Inform the user if the limit
761 on the number of open files is reached. If possible, try to
762 increase this limit before failing.
763
764 2021-05-14 Nelson Chu <nelson.chu@sifive.com>
765
766 * elfnn-riscv.c (riscv_resolve_pcrel_lo_relocs): Check the values
767 of %pcrel_hi, before and after adding the addend. Make sure the
768 value won't be changed, otherwise, report dangerous error.
769
770 2021-05-13 Nelson Chu <nelson.chu@sifive.com>
771
772 * elfxx-riscv.c (check_implicit_always): The check_func, always add
773 the implicit subset without checking.
774 (check_implicit_for_i): The check_func for i, only add zicsr and
775 zifencei when the version of i less than 2.1.
776 (struct riscv_implicit_subset): Record the subsets and their
777 corresponding implicit subsets.
778 (riscv_implicit_subsets): Table records all implicit informations.
779 (riscv_parse_add_implicit_subsets): Updated and add implicit subsets
780 according to riscv_implicit_subsets. Remove the redundant codes.
781
782 2021-05-13 Alan Modra <amodra@gmail.com>
783
784 PR 27858
785 * elf32-sh.c (sh_elf_info_to_howto): Correct check for last valid
786 reloc howto.
787
788 2021-05-12 Luis Machado <luis.machado@linaro.org>
789
790 * elf-bfd.h (elfcore_write_aarch_mte): New prototype.
791 * elf.c (elfcore_grok_aarch_mte, elfcore_write_aarch_mte): New
792 functions.
793 (elfcore_grok_note): Handle notes of type NT_ARM_TAGGED_ADDR_CTRL.
794 (elfcore_write_register_note): Handle MTE notes.
795
796 2021-05-11 Alan Modra <amodra@gmail.com>
797
798 PR 27844
799 * pdp11.c (aout_get_external_symbols): Clear first four bytes of
800 strings array, not just the first byte.
801 * aoutx.h (aout_get_external_symbols): Likewise.
802
803 2021-05-10 H.J. Lu <hongjiu.lu@intel.com>
804
805 PR binutils/27839
806 * simple.c (bfd_simple_get_relocated_section_contents): Remove
807 strayed fprintf.
808
809 2021-05-10 Nick Clifton <nickc@redhat.com>
810
811 PR 27839
812 * simple.c (simple_dummy_add_to_set): New function.
813 (simple_dummy_constructor): New function.
814 (simple_dummy_multiple_common): New function.
815 (bfd_simple_get_relocated_section_contents): Zero out the
816 callbacks structure, and then set the add_to_set, constructor and
817 multiple_common fields.
818
819 2021-05-10 Dimitar Dimitrov <dimitar@dinux.eu>
820
821 * elf32-pru.c (elf_backend_can_gc_sections): Define as 1.
822
823 2021-05-08 Mike Frysinger <vapier@gentoo.org>
824
825 * doc/Makefile.am (html-local, bfd/index.html): New targets.
826 * doc/Makefile.in: Regenerate.
827
828 2021-05-08 Mike Frysinger <vapier@gentoo.org>
829
830 * doc/Makefile.am (AM_MAKEINFOFLAGS): Define.
831 * doc/Makefile.in: Regenerate.
832
833 2021-05-07 Clément Chigot <clement.chigot@atos.net>
834
835 * coff-rs6000.c (xcoff_dwsect_names): Add new DWARF
836 sections.
837 * coffgen.c (coff_pointerize_aux): Handle C_DWARF.
838 (coff_print_symbol): Likewise.
839 * libxcoff.h (XCOFF_DWSECT_NBR_NAMES): Update.
840
841 2021-05-07 Jan Beulich <jbeulich@suse.com>
842
843 * elf64-x86-64.c (x86_64_elf_howto_table): Set src_mask fields
844 to zero.
845
846 2021-05-07 Alan Modra <amodra@gmail.com>
847
848 * bfd-in2.h: Regenerate.
849 * libbfd.h: Regenerate.
850
851 2021-05-06 Stafford Horne <shorne@gmail.com>
852
853 PR 27746
854 * elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
855 OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
856 (elf_or1k_link_hash_table): New field plt_count.
857 (elf_or1k_link_hash_entry): New field plt_index.
858 (elf_or1k_plt_entry_size): New function.
859 (or1k_write_plt_entry): Update to support variable size PLTs.
860 (or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
861 API.
862 (or1k_elf_finish_dynamic_symbol): Update to write large PLTs
863 when needed.
864 (allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
865 PLT size.
866
867 2021-05-06 Stafford Horne <shorne@gmail.com>
868
869 PR 21464
870 * elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
871 overflow check if we have R_OR1K_GOT_AHI16 followed by
872 R_OR1K_GOT16.
873
874 2021-05-06 Stafford Horne <shorne@gmail.com>
875
876 PR 21464
877 * bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
878 * elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
879 (or1k_final_link_relocate, or1k_elf_relocate_section,
880 or1k_elf_check_relocs): Likewise.
881 * libbfd.h (bfd_reloc_code_real_names): Likewise.
882 * reloc.c: Likewise.
883
884 2021-05-06 Stafford Horne <shorne@gmail.com>
885
886 PR 27624
887 * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
888 condition used to cleanup plt entries to cleanup forced local
889 entries.
890
891 2021-05-05 H.J. Lu <hongjiu.lu@intel.com>
892
893 PR ld/27825
894 * elflink.c (elf_link_output_symstrtab): Always append ".COUNT"
895 to local symbols.
896
897 2021-05-05 Alan Modra <amodra@gmail.com>
898
899 * vms-lib.c (vms_traverse_index): Account for vms_kbn size when
900 sanity checking keylen.
901
902 2021-05-04 Nick Clifton <nickc@redhat.com>
903
904 * libbfd.c (bfd_malloc): Provide some documenation. Treat a size
905 of 0 as 1.
906 (bfd_realloc): Likewise.
907 (bfd_zmalloc): Likewise.
908 (bfd_realloc_or_free): Provide some documentation. Treat a size
909 of 0 as a request to free.
910 * libbfd-in.h (bfd_realloc): Remove prototype.
911 (bfd_realloc_or_free): Remove prototype.
912 (bfd_zmalloc): Remove prototype.
913 * libbfd.h: Regenerate.
914
915 2021-05-03 Jan Beulich <jbeulich@suse.com>
916
917 * elf32-i386.c (elf_howto_table): Switch all 32-bit relocs to
918 complain_overflow_dont.
919 * elf64-x86-64.c (x86_64_elf_howto_table): Switch all 64-bit
920 relocs to complain_overflow_dont.
921
922 2021-05-03 Alan Modra <amodra@gmail.com>
923
924 * elf32-ppc.c (allocate_dynrelocs): Keep dyn_relocs for undefweak
925 symbols when -z dynamic-undefined-weak or when there are no
926 dynamic relocs in read-only sections and -z nodynamic-undefined-weak
927 is not given.
928 * elf64-ppc.c (allocate_dynrelocs): Likewise.
929
930 2021-05-03 Alan Modra <amodra@gmail.com>
931
932 * elf32-ppc.c (allocate_dynrelocs): Call ensure_undef_dynamic for
933 weak undefined symols that only appear on PLT relocs.
934 * elf64-ppc.c (allocate_dynrelocs): Likewise.
935
936 2021-05-03 Alan Modra <amodra@gmail.com>
937
938 PR 27755
939 * elf32-ppc.c (ppc_elf_inline_plt): Do increment rel in loop.
940
941 2021-05-03 Alan Modra <amodra@gmail.com>
942
943 * elf32-csky.c (is_mapping_symbol_name): New function.
944 (csky_elf_is_target_special_symbol): Likewise.
945 (csky_elf_maybe_function_sym): Likewise.
946 (bfd_elf32_bfd_is_target_special_symbol): Define.
947 (elf_backend_maybe_function_sym): Define.
948
949 2021-04-30 Nick Clifton <nickc@redhat.com>
950
951 PR 27801
952 * mach-o.c (bfd_mach_o_core_fetch_environment): Use bfd_get_32 to
953 read 32-bit value.
954
955 2021-04-30 Nick Clifton <nickc@redhat.com>
956
957 PR 27799
958 * elf32-xtensa.c (elf_xtensa_grok_prstatus): Check for core notes
959 that are too small.
960
961 2021-04-30 Nick Clifton <nickc@redhat.com>
962
963 PR 27797
964 * libbfd.c (bfd_realloc_or_free): Do not free a pointer than has
965 been realloc'ed to size 0.
966
967 2021-04-30 Nick Clifton <nickc@redhat.com>
968
969 PR 27795
970 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Check for invalid name
971 lengths.
972
973 2021-04-29 Nick Clifton <nickc@redhat.com>
974
975 PR 27793
976 * som.c (som_slurp_symbol_table): Assign symbols without any scope
977 to the undefined section.
978 (som_decode_symclass): Check for a missing symbol section.
979 * syms.c (bfd_decode_symclass): Likewise.
980
981 2021-04-29 Nick Clifton <nickc@redhat.com>
982
983 PR 27792
984 * som.c (som_slurp_string_table): Place a terminating NUL byte at
985 the end of the table.
986 (som_slurp_symbol_table): Check for an over-large offset into the
987 string string table.
988
989 2021-04-28 Nick Clifton <nickc@redhat.com>
990
991 * elf.c (_bfd_elf_maybe_function_sym): Do not accept annobin
992 symbols as potential function symbols.
993 * elfnn-aarch64.c (elfNN_aarch64_maybe_function_sym): Likewise.
994 * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
995 * elf32-arm.c (elf32_arm_maybe_function_sym): Likewise.
996
997 2021-04-26 Mike Frysinger <vapier@gentoo.org>
998
999 * elf-bfd.h: Include stdlib.h.
1000
1001 2021-04-26 Jan Beulich <jbeulich@suse.com>
1002
1003 * elf32-i386.c (elf_howto_table): Switch R_386_PC16 to
1004 complain_overflow_signed.
1005 * elf64-x86-64.c (x86_64_elf_howto_table): Switch R_X86_64_PC16
1006 to complain_overflow_signed.
1007
1008 2021-04-23 Eric Botcazou <ebotcazou@adacore.com>
1009
1010 * elf.c (special_sections_p): Add .persistent.bss.
1011
1012 2021-04-23 Jan Beulich <jbeulich@suse.com>
1013
1014 * elf32-i386.c (elf_howto_table): R_386_TLS_DESC_CALL has zero
1015 size field.
1016 * elf64-x86-64.c (x86_64_elf_howto_table): R_X86_64_TLSDESC_CALL
1017 has zero size field.
1018
1019 2021-04-22 Clément Chigot <clement.chigot@atos.net>
1020
1021 * hash.c (struct bfd_strtab_hash): Remove xcoff field.
1022 Add length_field_size field.
1023 (_bfd_stringtab_init): Change prototype.
1024 Adapt to new length_field_size.
1025 (_bfd_xcoff_stringtab_init): Likewise.
1026 (_bfd_stringtab_add): Likewise.
1027 (_bfd_stringtab_emit): Likewise.
1028 * libbfd-in.h (_bfd_xcoff_stringtab_init):
1029 Change prototype.
1030 * libbfd.h: Regenerate.
1031 * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create):
1032 Call _bfd_xcoff_stringtab_init with isxcoff64 value.
1033
1034 2021-04-22 Clément Chigot <clement.chigot@atos.net>
1035
1036 * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Add errors for
1037 unsupported storage class or auxialiry entries.
1038 Improve and adapt to new aux structures.
1039 Add C_DWARF support.
1040 (_bfd_xcoff_swap_aux_out): Likewise.
1041 * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Likewise.
1042 (_bfd_xcoff64_swap_aux_out): Likewise.
1043
1044 2021-04-21 Eli Zaretskii <eliz@gnu.org>
1045
1046 PR 27760
1047 * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add display
1048 of IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP,
1049 IMAGE_FILE_NET_RUN_FROM_SWAP and IMAGE_FILE_UP_SYSTEM_ONLY flags.
1050 Decode the contents of the DllCharacteristics field.
1051
1052 2021-04-21 Nick Clifton <nickc@redhat.com>
1053
1054 PR 27759
1055 * srec.c (srec_read_section): Replace assertions with error
1056 returns.
1057
1058 2021-04-20 Clément Chigot <clement.chigot@atos.net>
1059
1060 PR binutils/21700
1061 * reloc.c (BFD_RELOC_PPC_NEG): New relocation.
1062 * bfd-in2.h: Regenerate.
1063 * libbfd.h: Regenerate.
1064 * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Add
1065 BFD_RELOC_PPC_NEG handler.
1066 (xcoff_reloc_type_neg): Correctly substract addend.
1067 * coff64-rs6000.c (xcoff64_howto_table): Add R_NEG_32
1068 howto.
1069 (xcoff64_rtype2howto): Add handler for R_NEG_32.
1070 (xcoff64_reloc_type_lookup): Add BFD_RELOC_PPC_NEG handler.
1071 * xcofflink.c (xcoff_need_ldrel_p): Check output section
1072 for R_POS-like relocations. New argument added.
1073 (xcoff_mark): Adapt to new xcoff_need_ldrel_p argument.
1074 (xcoff_link_input_bfd): Likewise.
1075
1076 2021-04-16 Alan Modra <amodra@gmail.com>
1077
1078 PR 27567
1079 * coffcode.h (styp_to_sec_flags): Use an unsigned long styp_flags.
1080 (coff_write_object_contents): Pass bfd to COFF_ENCODE_ALIGNMENT,
1081 ignore alignment checks when return is false. Formatting.
1082
1083 2021-04-15 Nelson Chu <nelson.chu@sifive.com>
1084
1085 PR27584
1086 * elfnn-riscv.c (riscv_elf_is_target_special_symbol): Added to
1087 omit local and empty symbols since they usually generated to
1088 mark the auipc instructions.
1089
1090 2021-04-15 Lifang Xia<lifang_xia@c-sky.com>
1091
1092 * elf32-csky.c (csky_elf_howto_table)
1093 <R_CKCORE_PCREL_IMM16BY2>: Set special_function to
1094 bfd_elf_generic_reloc.
1095 <R_CKCORE_PCREL_IMM16BY4>: Likewise.
1096 <R_CKCORE_PCREL_IMM10BY4>: Likewise.
1097 <R_CKCORE_PCREL_IMM18BY2>: Likewise.
1098 <R_CKCORE_PCREL_FLRW_IMM8BY4>: Likewise.
1099
1100 2021-04-14 H.J. Lu <hongjiu.lu@intel.com>
1101
1102 PR binutils/27708
1103 * elf.c (assign_file_positions_for_non_load_sections): Set
1104 p_memsz to p_filesz for the loadable PT_NOTE segment.
1105
1106 2021-04-14 Frederic Cambus <fred@statdns.com>
1107
1108 * elf.c (elfcore_grok_netbsd_note): Remove unneeded #ifdef
1109 checks for NT_NETBSDCORE_AUXV and NT_NETBSDCORE_LWPSTATUS.
1110
1111 2021-04-14 Alan Modra <amodra@gmail.com>
1112
1113 PR 27631
1114 * elf32-metag.c (elf_metag_relocate_section): Don't use &hh->elf
1115 when hh might be NULL, test for NULL first.
1116
1117 2021-04-14 Alan Modra <amodra@gmail.com>
1118
1119 PR 27630
1120 * elf32-arm.c (elf32_arm_size_stubs): Don't use &hash->root when
1121 hash might be NULL, cast instead.
1122
1123 2021-04-13 Clément Chigot <clement.chigot@atos.net>
1124
1125 * xcofflink.c (xcoff_link_check_ar_symbols): Update esym earlier.
1126
1127 2021-04-13 Nelson Chu <nelson.chu@sifive.com>
1128
1129 * elfnn-riscv.c (riscv_version_mismatch): Do not report the warning
1130 when the version of input or output is RISCV_UNKNOWN_VERSION, since
1131 the extension is added implicitly.
1132 * elfxx-riscv.c: Updated the obsolete comments.
1133 (RISCV_UNKNOWN_VERSION): Moved to elfxx-riscv.h.
1134 * elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Added.
1135
1136 2021-04-12 Alan Modra <amodra@gmail.com>
1137
1138 * elf-bfd.h (ENABLE_CHECKING): Define.
1139 (elf_link_hash_lookup): Abort if wrong type of hash table.
1140 * configure.ac (--enable-checking): Add support.
1141 * config.in: Regenerate.
1142 * configure: Regenerate.
1143
1144 2021-04-12 Alan Modra <amodra@gmail.com>
1145
1146 * elf-bfd.h (is_elf_hash_table): Convert macro to inline function.
1147 (elf_link_hash_lookup, elf_link_hash_traverse): Likewise.
1148 (elf_hash_table, elf_hash_table_id): Likewise.
1149 * elf32-arm.c (elf32_arm_setup_section_lists): Delete redundant
1150 is_elf_hash_table check.
1151 * elf32-csky.c (elf32_csky_setup_section_lists): Likewise.
1152 * elf32-hppa.c (clobber_millicode_symbols): Correct param types.
1153 * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
1154 * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free: Likewise.
1155 (elfNN_ia64_global_dyn_sym_thunk: Likewise.
1156 * elf64-ia64-vms.c (elf64_ia64_global_dyn_info_free): Likewise.
1157 (elf64_ia64_global_dyn_sym_thunk): Likewise.
1158 (elf64_vms_link_add_object_symbols): Pass base type of hash table
1159 to is_elf_hash_table.
1160 * elflink.c (_bfd_elf_dynamic_symbol_p): Likewise.
1161 (_bfd_elf_symbol_refs_local_p, _bfd_elf_add_dynamic_entry): Likewise.
1162 (_bfd_elf_strip_zero_sized_dynamic_sections): Likewise.
1163 (_bfd_elf_link_check_relocs, elf_link_add_object_symbols): Likewise.
1164 (bfd_elf_final_link): Likewise.
1165 * elfnn-aarch64.c (elfNN_aarch64_setup_section_lists): Likewise.
1166 * elf64-ppc.c (ppc64_elf_set_toc): Likewise. Use bfd_link_hash_lookup.
1167
1168 2021-04-12 Alan Modra <amodra@gmail.com>
1169
1170 * elf-bfd.h (struct elf_backend_data): Return bfd_link_hash_entry*
1171 from elf_backend_archive_symbol_lookup.
1172 (_bfd_elf_archive_symbol_lookup): Return bfd_link_hash_entry*.
1173 * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Likewise. Check
1174 we have a ppc_hash_table before accessing ppc_link_hash_entry
1175 fields.
1176 * elflink.c (_bfd_elf_archive_symbol_lookup): Return
1177 bfd_link_hash_entry*.
1178 (elf_link_add_archive_symbols): Adjust to suit.
1179
1180 2021-04-12 Nelson Chu <nelson.chu@sifive.com>
1181
1182 * elfxx-riscv.c (riscv_parse_std_ext): Fixed the wrong versions of
1183 i-ext when expanding g-ext.
1184
1185 2021-04-12 Nelson Chu <nelson.chu@sifive.com>
1186
1187 * elfxx-riscv.c (riscv_ext_dont_care_version): Removed.
1188 (riscv_parse_add_subset): Always add the implicit extensions, even if
1189 their versions are RISCV_UNKNOWN_VERSION.
1190 (riscv_parse_std_ext): Delay to add i-ext as the implicit extension
1191 in the riscv_parse_add_implicit_subsets. Besides, add g-ext as the
1192 implicit extension after it has been expanded.
1193 (riscv_parse_add_implicit_subsets): Updated.
1194
1195 2021-04-12 Nelson Chu <nelson.chu@sifive.com>
1196
1197 * elfxx-riscv.c (riscv_std_z_ext_strtab): Moved forward.
1198 (riscv_std_s_ext_strtab): Likewise.
1199 (riscv_std_h_ext_strtab): Likewise.
1200 (riscv_std_zxm_ext_strtab): Added for the zxm prefix.
1201 (enum riscv_prefix_ext_class): Moved forward and renamed from
1202 riscv_isa_ext_class. Reorder them according to the parsing order,
1203 since the enum values are used to check the orders in the
1204 riscv_compare_subsets.
1205 (struct riscv_parse_prefix_config): Moved forward and renamed from
1206 riscv_parse_config_t. Also removed the ext_valid_p field, the
1207 related functions are replaced by riscv_valid_prefixed_ext.
1208 (parse_config): Moved forward and updated. The more letters of the
1209 prefix string, the more forward it must be defined. Otherwise, we
1210 will get the wrong mapping when using strncmp in riscv_get_prefix_class.
1211 (riscv_get_prefix_class): Moved forward. Support to parse the
1212 multi-letter prefix, like zxm.
1213 (riscv_known_prefixed_ext): New function, check if the prefixed
1214 extension is supported according to the right riscv_std_*_ext_strtab.
1215 (riscv_valid_prefixed_ext): New function, used to replace the
1216 riscv_ext_*_valid_p functions.
1217 (riscv_init_ext_order): Do not set the values for prefix keywords
1218 since they may have multiple letters for now.
1219 (riscv_compare_subsets): Set the order values of prefix keywords
1220 to negative numbers according to the riscv_prefix_ext_class.
1221 (riscv_parse_std_ext): Call riscv_get_prefix_class to see if we
1222 have parsed the prefixed extensions.
1223 (riscv_parse_prefixed_ext): Updated and removed the parameter config.
1224 Report error when the prefix is unknown.
1225 (riscv_parse_subset): Do not parse the prefixed extensions according
1226 to the orders in the parse_config. Remove the confused message and
1227 let riscv_parse_prefixed_ext to report the details.
1228 * elfxx-riscv.h (enum riscv_isa_ext_class): Moved to elfxx-riscv.c.
1229 (riscv_get_prefix_class): Removed to static.
1230
1231 2021-04-08 Mike Frysinger <vapier@gentoo.org>
1232
1233 * configure.ac (ACX_BUGURL): Use https://.
1234 * configure.com (COPY_TEXT): Likewise.
1235 * configure: Regenerate.
1236
1237 2021-04-05 Alan Modra <amodra@gmail.com>
1238
1239 * configure.ac: Don't check for long long or long double type.
1240 Don't check for alloca.h, limits.h, stddef.h, stdlib.h, string.h,
1241 strings.h, time.h, wchar.h, wctype.h or sys/time.h. Don't check
1242 for strtoull, free, malloc, realloc, getenv, strstr, snprintf,
1243 vsnprintf, strlen or setitimer. Sort AC_CHECK_DECLS.
1244 (AC_ISC_POSIX): Don't invoke.
1245 (AC_HEADER_TIME, AC_HEADER_DIRENT, ACX_HEADER_STRING): Likewise.
1246 * sysdep.h: Remove many HAVE_*_H checks and fallback declarations.
1247 Do test HAVE_SYS_TYPES_H. Don't include sys/time.h. Reorder
1248 header order as per automake AC_INCLUDES_DEFAULT.
1249 * bfd-in.h: Include inttypes.h unconditionally.
1250 * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Assume long long and
1251 long double are available.
1252 (bfd_scan_vma): Assume long long and strtoull are available.
1253 * elflink.c: Include limits.h unconditionally.
1254 * elfnn-riscv.c: Likewise.
1255 * wasm-module.c: Likewise.
1256 * hpux-core.c: Include dirent.h unconditionally.
1257 * trad-core.c: Likewise.
1258 * hosts/x86-64linux.h: Include stdlib.h unconditionally.
1259 * peXXigen.c: Remove HAVE_WCHAR_H and HAVE_WCTYPE_H checks.
1260 * elf32-m68hc1x.c: Don't include alloca-conf.h.
1261 * elf64-hppa.c: Likewise.
1262 * som.c: Likewise.
1263 * wasm-module.c: Likewise.
1264 * xsym.c: Likewise.
1265 * bfd-in2.h: Regenerate.
1266 * config.in: Regenerate.
1267 * configure: Regenerate.
1268
1269 2021-04-01 Tamar Christina <tamar.christina@arm.com>
1270
1271 PR ld/26659
1272 * cofflink.c (_bfd_coff_generic_relocate_section): Ignore overflow.
1273
1274 2021-04-01 Martin Liska <mliska@suse.cz>
1275
1276 * ecoff.c (strneq): Remove strneq and use startswith.
1277 (_bfd_ecoff_slurp_armap): Likewise.
1278
1279 2021-04-01 Martin Liska <mliska@suse.cz>
1280
1281 * elf-bfd.h (bfd_section_is_ctf): Use startswith function.
1282 * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
1283 (elf_get_reloc_section): Likewise.
1284 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1285 * elf32-m32r.c (m32r_elf_section_flags): Likewise.
1286 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections): Likewise.
1287 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1288 (nds32_elf_relocate_section): Likewise.
1289 (nds32_elf_action_discarded): Likewise.
1290 (nds32_elf_check_relocs): Likewise.
1291 (nds32_elf_section_flags): Likewise.
1292 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1293 * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
1294 * elf32-rx.c (rx_table_find): Likewise.
1295 (rx_table_map): Likewise.
1296 * elf32-spu.c (spu_elf_backend_symbol_processing): Likewise.
1297 (spu_elf_find_overlays): Likewise.
1298 (needs_ovl_stub): Likewise.
1299 (allocate_spuear_stubs): Likewise.
1300 (build_spuear_stubs): Likewise.
1301 (mark_overlay_section): Likewise.
1302 (spu_elf_auto_overlay): Likewise.
1303 (spu_elf_output_symbol_hook): Likewise.
1304 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1305 * elf32-xtensa.c (xtensa_property_section_name): Likewise.
1306 * elf64-ppc.c (ppc64_elf_section_flags): Likewise.
1307 (ppc64_elf_relocate_section): Likewise.
1308 * elflink.c (resolve_section): Likewise.
1309 (UNARY_OP): Likewise.
1310 (BINARY_OP_HEAD): Likewise.
1311 (elf_link_input_bfd): Likewise.
1312 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1313 * elfxx-riscv.c (riscv_parse_subset): Likewise.
1314 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1315 * opncls.c (get_build_id): Likewise.
1316
1317 2021-03-31 Alan Modra <amodra@gmail.com>
1318
1319 PR 27671
1320 * bfd-in.h: Don't poison FALSE or TRUE.
1321 * bfd-in2.h: Regenerate.
1322
1323 2021-03-31 Alan Modra <amodra@gmail.com>
1324
1325 * sysdep.h: POISON_BFD_BOOLEAN: Define.
1326 * aix5ppc-core.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h,
1327 * aoutx.h, * arc-got.h, * archive.c, * archive64.c, * archures.c,
1328 * bfd-in.h, * bfd.c, * bfdwin.c, * binary.c, * cache.c,
1329 * coff-alpha.c, * coff-arm.c, * coff-arm.h, * coff-bfd.c,
1330 * coff-bfd.h, * coff-go32.c, * coff-i386.c, * coff-ia64.c,
1331 * coff-mcore.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c,
1332 * coff-stgo32.c, * coff-tic30.c, * coff-tic4x.c, * coff-tic54x.c,
1333 * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c,
1334 * coffcode.h, * coffgen.c, * cofflink.c, * compress.c,
1335 * corefile.c, * cpu-aarch64.c, * cpu-aarch64.h, * cpu-alpha.c,
1336 * cpu-arc.c, * cpu-arm.c, * cpu-arm.h, * cpu-avr.c, * cpu-bfin.c,
1337 * cpu-bpf.c, * cpu-cr16.c, * cpu-cris.c, * cpu-crx.c,
1338 * cpu-csky.c, * cpu-d10v.c, * cpu-d30v.c, * cpu-dlx.c,
1339 * cpu-epiphany.c, * cpu-fr30.c, * cpu-frv.c, * cpu-ft32.c,
1340 * cpu-h8300.c, * cpu-hppa.c, * cpu-i386.c, * cpu-ia64.c,
1341 * cpu-iamcu.c, * cpu-ip2k.c, * cpu-iq2000.c, * cpu-k1om.c,
1342 * cpu-l1om.c, * cpu-lm32.c, * cpu-m10200.c, * cpu-m10300.c,
1343 * cpu-m32c.c, * cpu-m32r.c, * cpu-m68hc11.c, * cpu-m68hc12.c,
1344 * cpu-m68k.c, * cpu-m9s12x.c, * cpu-m9s12xg.c, * cpu-mcore.c,
1345 * cpu-mep.c, * cpu-metag.c, * cpu-microblaze.c, * cpu-mips.c,
1346 * cpu-mmix.c, * cpu-moxie.c, * cpu-msp430.c, * cpu-mt.c,
1347 * cpu-nds32.c, * cpu-nfp.c, * cpu-nios2.c, * cpu-ns32k.c,
1348 * cpu-or1k.c, * cpu-pdp11.c, * cpu-pj.c, * cpu-powerpc.c,
1349 * cpu-pru.c, * cpu-riscv.c, * cpu-rl78.c, * cpu-rs6000.c,
1350 * cpu-rx.c, * cpu-s12z.c, * cpu-s390.c, * cpu-score.c,
1351 * cpu-sh.c, * cpu-sparc.c, * cpu-spu.c, * cpu-tic30.c,
1352 * cpu-tic4x.c, * cpu-tic54x.c, * cpu-tic6x.c, * cpu-tilegx.c,
1353 * cpu-tilepro.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-vax.c,
1354 * cpu-visium.c, * cpu-wasm32.c, * cpu-xc16x.c, * cpu-xgate.c,
1355 * cpu-xstormy16.c, * cpu-xtensa.c, * cpu-z80.c, * cpu-z8k.c,
1356 * dwarf1.c, * dwarf2.c, * ecoff-bfd.h, * ecoff.c, * ecofflink.c,
1357 * elf-attrs.c, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h,
1358 * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-nacl.c,
1359 * elf-nacl.h, * elf-properties.c, * elf-s390-common.c,
1360 * elf-s390.h, * elf-strtab.c, * elf-vxworks.c, * elf-vxworks.h,
1361 * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c,
1362 * elf32-arm.h, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c,
1363 * elf32-bfin.h, * elf32-cr16.c, * elf32-cr16.h, * elf32-cris.c,
1364 * elf32-crx.c, * elf32-csky.c, * elf32-csky.h, * elf32-d10v.c,
1365 * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
1366 * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-gen.c,
1367 * elf32-h8300.c, * elf32-hppa.c, * elf32-hppa.h, * elf32-i386.c,
1368 * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
1369 * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
1370 * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c,
1371 * elf32-m68k.h, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
1372 * elf32-metag.h, * elf32-microblaze.c, * elf32-mips.c,
1373 * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
1374 * elf32-nios2.c, * elf32-nios2.h, * elf32-or1k.c, * elf32-pj.c,
1375 * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
1376 * elf32-rx.c, * elf32-s12z.c, * elf32-s390.c, * elf32-score.c,
1377 * elf32-score.h, * elf32-score7.c, * elf32-sh-relocs.h,
1378 * elf32-sh.c, * elf32-sparc.c, * elf32-spu.c, * elf32-spu.h,
1379 * elf32-tic6x.c, * elf32-tic6x.h, * elf32-tilegx.c,
1380 * elf32-tilepro.c, * elf32-v850.c, * elf32-v850.h,
1381 * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
1382 * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c,
1383 * elf32-xtensa.c, * elf32-z80.c, * elf64-alpha.c, * elf64-bpf.c,
1384 * elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c,
1385 * elf64-mips.c, * elf64-mmix.c, * elf64-nfp.c, * elf64-ppc.c,
1386 * elf64-ppc.h, * elf64-s390.c, * elf64-sparc.c,
1387 * elf64-tilegx.c, * elf64-x86-64.c, * elfcode.h,
1388 * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c,
1389 * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c,
1390 * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h,
1391 * elfxx-mips.c, * elfxx-mips.h, * elfxx-riscv.c, * elfxx-riscv.h,
1392 * elfxx-sparc.c, * elfxx-sparc.h, * elfxx-target.h,
1393 * elfxx-tilegx.c, * elfxx-tilegx.h, * elfxx-x86.c, * elfxx-x86.h,
1394 * format.c, * genlink.h, * hash.c, * i386aout.c, * i386lynx.c,
1395 * i386msdos.c, * ihex.c, * libaout.h, * libbfd-in.h,
1396 * libbfd.c, * libcoff-in.h, * libecoff.h, * libpei.h,
1397 * libxcoff.h, * linker.c, * mach-o-aarch64.c, * mach-o-arm.c,
1398 * mach-o-i386.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h,
1399 * merge.c, * mmo.c, * netbsd.h, * opncls.c, * pc532-mach.c,
1400 * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-sh.c,
1401 * pe-x86_64.c, * peXXigen.c, * pef.c, * pei-arm.c, * pei-i386.c,
1402 * pei-ia64.c, * pei-mcore.c, * pei-sh.c, * pei-x86_64.c,
1403 * peicode.h, * plugin.c, * plugin.h, * ppcboot.c, * reloc.c,
1404 * reloc16.c, * rs6000-core.c, * section.c, * simple.c, * som.c,
1405 * som.h, * srec.c, * stabs.c, * syms.c, * targets.c, * tekhex.c,
1406 * verilog.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * vms.h,
1407 * wasm-module.c, * xcofflink.c, * xcofflink.h, * xsym.c,
1408 * xsym.h: Replace bfd_boolean with bool, FALSE with false, and
1409 TRUE with true throughout.
1410 * bfd-in2.h: Regenerate.
1411 * libbfd.h: Regenerate.
1412 * libcoff.h: Regenerate.
1413
1414 2021-03-31 Alan Modra <amodra@gmail.com>
1415
1416 * bfd-in.h: Include stdbool.h.
1417 (bfd_boolean): Define as bool
1418 * bfd-in2.h: Regenerate.
1419
1420 2021-03-31 Alan Modra <amodra@gmail.com>
1421
1422 * .gitignore: Delete bfd_stdint.h entry.
1423 * Makefile.am (bfdinclude_HEADERS): Delete bfd_stdint.h.
1424 (BUILD_HFILES, LOCAL_H_DEPS): Likewise.
1425 * bfd-in.h: Include stdint.h in place of bfd_stdint.h.
1426 * configure.ac: Don't invoke GCC_HEADER_STDINT.
1427 * configure.com: Don't create bfd_stdint.h.
1428 * Makefile.in: Regenerate.
1429 * aclocal.m4: Regenerate.
1430 * bfd-in2.h: Regenerate.
1431 * config.in: Regenerate.
1432 * configure: Regenerate.
1433 * doc/Makefile.in: Regenerate.
1434 * po/BLD-POTFILES.in: Regenerate.
1435
1436 2021-03-31 Alan Modra <amodra@gmail.com>
1437
1438 * bfd-in.h: Include string.h.
1439 (LITMEMCPY, LITSTRCPY): Delete.
1440 * bfd-in2.h: Regenerate.
1441
1442 2021-03-30 Alan Modra <amodra@gmail.com>
1443
1444 * elflink.c (elf_link_add_object_symbols): Don't set h->indx
1445 unless is_elf_hash_table.
1446
1447 2021-03-29 Alan Modra <amodra@gmail.com>
1448
1449 * aoutx.h (aout_link_write_symbols): Don't cast boolean expression
1450 to bfd_boolean.
1451 * elf32-or1k.c (or1k_set_got_and_rela_sizes): Dont compare booleans
1452 against FALSE.
1453 * elf32-arc.c (name_for_global_symbol): Don't compare boolean to TRUE.
1454 (is_reloc_PC_relative): Don't use "boolean_condition ? TRUE : FALSE".
1455 (is_reloc_SDA_relative, is_reloc_for_GOT): Likewise.
1456 (is_reloc_for_PLT, is_reloc_for_TLS): Likewise.
1457 * elf32-arm.c (stm32l4xx_need_create_replacing_stub): Likewise.
1458 * elf32-nds32.c (insert_nds32_elf_blank): Likewise.
1459 * elf32-rx.c (rx_set_section_contents): Likewise.
1460 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1461 * elfxx-mips.c (_bfd_mips_elf_ignore_undef_symbol): Likewise.
1462 * mach-o.c (bfd_mach_o_read_command): Likewise.
1463 * targets.c (bfd_get_target_info): Likewise.
1464
1465 2021-03-29 Alan Modra <amodra@gmail.com>
1466
1467 * coff-z80.c (z80_is_local_label_name): Return bfd_boolean.
1468 * elf32-z80.c (z80_is_local_label_name): Likewise.
1469 * elf32-spu.c (spu_elf_modify_headers): Likewise.
1470 * elf32-nds32.h (struct elf_nds32_link_hash_table <hyper_relax>):
1471 Change type to int.
1472 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Correct test
1473 for error return from vms_write_data_block.
1474
1475 2021-03-29 Alan Modra <amodra@gmail.com>
1476
1477 * elf32-i386.c (elf_i386_finish_local_dynamic_symbol): Return int.
1478 * elf64-ia64-vms.c (elf64_ia64_local_dyn_info_free): Likewise.
1479 (elf64_ia64_local_dyn_sym_thunk): Likewise.
1480 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol): Likewise.
1481 * elfnn-aarch64.c (elfNN_aarch64_allocate_local_ifunc_dynrelocs),
1482 (elfNN_aarch64_finish_local_dynamic_symbol): Likewise.
1483 * elfnn-ia64.c (elfNN_ia64_local_dyn_info_free): Likewise.
1484 (elfNN_ia64_local_dyn_sym_thunk): Likewise.
1485 * elfnn-riscv.c (allocate_local_ifunc_dynrelocs): Likewise.
1486 (riscv_pcrel_reloc_eq): Likewise.
1487 (riscv_elf_finish_local_dynamic_symbol): Likewise.
1488 * elfxx-sparc.c (allocate_local_dynrelocs): Likewise.
1489 (finish_local_dynamic_symbol): Likewise.
1490 * elfxx-x86.c (elf_x86_allocate_local_dynreloc): Likewise.
1491 * elfxx-mips.c (mips_elf_resolve_got_page_ref): Likewise.
1492 (mips_elf_count_got_symbols): Change return type to bfd_boolean.
1493
1494 2021-03-29 Alan Modra <amodra@gmail.com>
1495
1496 * elflink.c (elf_link_output_symstrtab): Make flinfo parameter
1497 a void pointer.
1498 (bfd_elf_final_link): Delete out_sym_func typedef and don't cast
1499 elf_link_output_symstrtab when calling output_arch_syms and
1500 output_arch_local_syms.
1501 * elf-bfd.h (struct elf_backend_data <elf_backend_output_arch_syms,
1502 elf_backend_output_arch_local_syms>): Change return type of func
1503 arg to match elf_link_output_symstrtab.
1504 * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Correct
1505 return type.
1506 * elf32-nds32.c (nds32_elf_output_symbol_hook): Correct return type.
1507 (nds32_elf_output_arch_syms): Correct func return type.
1508
1509 2021-03-29 Alan Modra <amodra@gmail.com>
1510
1511 * elf-m10200.c (mn10200_elf_relocate_section): Return int.
1512 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1513 * elf32-arc.c (elf_arc_relocate_section): Likewise.
1514 * elf32-arm.c (elf32_arm_relocate_section): Likewise.
1515 * elf32-avr.c (elf32_avr_relocate_section): Likewise.
1516 * elf32-bfin.c (bfin_relocate_section): Likewise.
1517 (bfinfdpic_relocate_section): Likewise.
1518 * elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
1519 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1520 * elf32-crx.c (elf32_crx_relocate_section): Likewise.
1521 * elf32-csky.c (csky_elf_relocate_section): Likewise.
1522 * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
1523 * elf32-epiphany.c (epiphany_elf_relocate_section): Likewise.
1524 * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
1525 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1526 * elf32-ft32.c (ft32_elf_relocate_section): Likewise.
1527 * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
1528 * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
1529 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1530 * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
1531 * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
1532 * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
1533 * elf32-m32c.c (m32c_elf_relocate_section): Likewise.
1534 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1535 * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
1536 * elf32-m68hc1x.h (elf32_m68hc11_relocate_section): Likewise.
1537 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1538 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1539 * elf32-mep.c (mep_elf_relocate_section): Likewise.
1540 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1541 * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
1542 * elf32-moxie.c (moxie_elf_relocate_section): Likewise.
1543 * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
1544 * elf32-mt.c (mt_elf_relocate_section): Likewise.
1545 * elf32-nds32.c (nds32_elf_relocate_section): Likewise.
1546 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1547 * elf32-or1k.c (or1k_elf_relocate_section): Likewise.
1548 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1549 * elf32-pru.c (pru_elf32_relocate_section): Likewise.
1550 * elf32-rl78.c (rl78_elf_relocate_section): Likewise.
1551 * elf32-rx.c (rx_elf_relocate_section): Likewise.
1552 * elf32-s390.c (elf_s390_relocate_section): Likewise.
1553 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1554 (_bfd_score_elf_relocate_section): Likewise.
1555 * elf32-score.h (s7_bfd_score_elf_relocate_section): Likewise.
1556 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1557 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1558 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1559 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1560 * elf32-v850.c (v850_elf_relocate_section): Likewise.
1561 * elf32-vax.c (elf_vax_relocate_section): Likewise.
1562 * elf32-visium.c (visium_elf_relocate_section): Likewise.
1563 * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
1564 * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
1565 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1566 * elf32-z80.c (z80_elf_relocate_section): Likewise.
1567 * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise.
1568 (elf64_alpha_relocate_section): Likewise.
1569 * elf64-bpf.c (bpf_elf_relocate_section): Likewise.
1570 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1571 * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
1572 * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
1573 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1574 * elf64-s390.c (elf_s390_relocate_section): Likewise.
1575 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1576 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1577 * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
1578 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1579 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
1580 * elfxx-mips.h (_bfd_mips_elf_relocate_section): Likewise.
1581 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1582 * elfxx-sparc.h (_bfd_sparc_elf_relocate_section): Likewise.
1583 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1584 * elfxx-tilegx.h (tilegx_elf_relocate_section): Likewise.
1585
1586 2021-03-26 Keith Seitz <keiths@redhat.com>
1587
1588 * elfcore.h (_bfd_elf_core_find_build_id): Seek file
1589 offset of program headers after calling elf_read_notes.
1590
1591 2021-03-23 Jan Beulich <jbeulich@suse.com>
1592
1593 * dwarf2.c (read_indexed_string): Rename index to idx.
1594
1595 2021-03-22 Martin Liska <mliska@suse.cz>
1596
1597 * bfd-in.h (startswith): Add startswith function.
1598 (CONST_STRNEQ): Remove.
1599 * bfd-in2.h (startswith): Regenerate with make headers.
1600 * archive.c (bfd_slurp_armap): Replace usage of CONST_STRNEQ with startswith.
1601 (_bfd_slurp_extended_name_table): Likewise.
1602 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1603 * bfd.c (bfd_get_sign_extend_vma): Likewise.
1604 (bfd_convert_section_size): Likewise.
1605 (bfd_convert_section_contents): Likewise.
1606 * coff-stgo32.c (go32exe_create_stub): Likewise.
1607 (go32exe_check_format): Likewise.
1608 * coffcode.h (styp_to_sec_flags): Likewise.
1609 (GNU_DEBUGALTLINK): Likewise.
1610 * coffgen.c (_bfd_coff_section_already_linked): Likewise.
1611 (coff_gc_sweep): Likewise.
1612 (bfd_coff_gc_sections): Likewise.
1613 * cofflink.c (coff_link_add_symbols): Likewise.
1614 (process_embedded_commands): Likewise.
1615 * compress.c (bfd_is_section_compressed_with_header): Likewise.
1616 (bfd_init_section_decompress_status): Likewise.
1617 * dwarf2.c (find_debug_info): Likewise.
1618 (place_sections): Likewise.
1619 * ecoff.c (_bfd_ecoff_slurp_armap): Likewise.
1620 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
1621 * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
1622 (assign_section_numbers): Likewise.
1623 (elfcore_grok_win32pstatus): Likewise.
1624 * elf32-arm.c (cmse_scan): Likewise.
1625 (elf32_arm_gc_mark_extra_sections): Likewise.
1626 (elf32_arm_size_dynamic_sections): Likewise.
1627 (is_arm_elf_unwind_section_name): Likewise.
1628 * elf32-bfin.c (bfin_size_dynamic_sections): Likewise.
1629 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1630 * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise.
1631 * elf32-csky.c (csky_elf_size_dynamic_sections): Likewise.
1632 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
1633 * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
1634 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1635 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1636 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1637 * elf32-metag.c (elf_metag_size_dynamic_sections): Likewise.
1638 * elf32-msp430.c (msp430_elf_relax_delete_bytes): Likewise.
1639 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1640 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1641 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1642 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1643 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
1644 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
1645 * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
1646 * elf32-tic6x.c (is_tic6x_elf_unwind_section_name): Likewise.
1647 (elf32_tic6x_size_dynamic_sections): Likewise.
1648 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1649 * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise.
1650 (xtensa_is_insntable_section): Likewise.
1651 (xtensa_is_littable_section): Likewise.
1652 (xtensa_is_proptable_section): Likewise.
1653 (xtensa_property_section_name): Likewise.
1654 (xtensa_callback_required_dependence): Likewise.
1655 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1656 * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
1657 * elf64-ia64-vms.c (is_unwind_section_name): Likewise.
1658 (get_reloc_section): Likewise.
1659 (elf64_ia64_size_dynamic_sections): Likewise.
1660 (elf64_ia64_object_p): Likewise.
1661 * elf64-mmix.c (mmix_elf_add_symbol_hook): Likewise.
1662 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
1663 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1664 * elflink.c (elf_link_add_object_symbols): Likewise.
1665 (_bfd_elf_gc_mark_extra_sections): Likewise.
1666 (bfd_elf_parse_eh_frame_entries): Likewise.
1667 (_bfd_elf_section_already_linked): Likewise.
1668 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise.
1669 * elfnn-ia64.c (is_unwind_section_name): Likewise.
1670 (elfNN_ia64_size_dynamic_sections): Likewise.
1671 (elfNN_ia64_object_p): Likewise.
1672 * elfxx-mips.c (FN_STUB_P): Likewise.
1673 (CALL_STUB_P): Likewise.
1674 (CALL_FP_STUB_P): Likewise.
1675 (_bfd_mips_elf_section_from_shdr): Likewise.
1676 (_bfd_mips_elf_fake_sections): Likewise.
1677 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1678 (_bfd_mips_final_write_processing): Likewise.
1679 (_bfd_mips_elf_final_link): Likewise.
1680 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1681 * elfxx-x86.c (elf_i386_is_reloc_section): Likewise.
1682 (elf_x86_64_is_reloc_section): Likewise.
1683 * hpux-core.c (thread_section_p): Likewise.
1684 * libcoff.h (bfd_pei_p): Likewise.
1685 * linker.c (REAL): Likewise.
1686 (unwrap_hash_lookup): Likewise.
1687 (_bfd_generic_link_add_one_symbol): Likewise.
1688 * mmo.c (mmo_internal_write_section): Likewise.
1689 * osf-core.c (osf_core_core_file_p): Likewise.
1690 * pef.c (bfd_pef_print_symbol): Likewise.
1691 * pei-x86_64.c (pex64_print_all_pdata_sections): Likewise.
1692 * som.c (som_slurp_symbol_table): Likewise.
1693 (som_slurp_armap): Likewise.
1694 * wasm-module.c (wasm_compute_custom_section_file_position): Likewise.
1695
1696 2021-03-22 Jan Beulich <jbeulich@suse.com>
1697
1698 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Add missing
1699 language translation wrapping to _bfd_error_handler()
1700 invocations.
1701
1702 2021-03-21 Alan Modra <amodra@gmail.com>
1703
1704 * bfd-in.h (startswith): New inline.
1705 (CONST_STRNEQ): Use startswith.
1706 * bfd-in2.h: Regenerate.
1707
1708 2021-03-20 Alan Modra <amodra@gmail.com>
1709
1710 PR 27590
1711 * elf.c (_bfd_elf_make_section_from_shdr): Remove SHF_EXCLUDE
1712 test for .gnu.debuglto*.
1713
1714 2021-03-18 H.J. Lu <hongjiu.lu@intel.com>
1715
1716 PR ld/27590
1717 * elf.c (_bfd_elf_make_section_from_shdr): Treat
1718 .gnu.debuglto_.debug_ section as debugging section unless it is
1719 marked with SHF_EXCLUDE.
1720 * elflink.c (elf_create_symbuf): Revert commit 994b2513281.
1721 (bfd_elf_match_symbols_in_sections): Ignore section symbols when
1722 matching non-debugging sections or linkonce section with comdat
1723 section.
1724
1725 2021-03-18 H.J. Lu <hongjiu.lu@intel.com>
1726
1727 PR ld/27587
1728 * dwarf2.c (read_attribute_value): Check version >= 3 for
1729 DW_FORM_ref_addr.
1730
1731 2021-03-16 Nick Clifton <nickc@redhat.com>
1732
1733 * peXXigen.c (_bfd_XXi_swap_aux_out): Avoid potential buffer
1734 overrun by using sizeof of the destination x_fname field as the
1735 limit for a memcpy.
1736
1737 2021-03-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1738
1739 * elfxx-riscv.c (riscv_std_z_ext_strtab): Add zba, zbb and zbc.
1740
1741 2021-03-12 Clément Chigot <clement.chigot@atos.net>
1742
1743 * reloc.c (BFD_RELOC_PPC_TLS_LE, BFD_RELOC_PPC_TLS_IE,
1744 BFD_RELOC_PPC_TLS_M, BFD_RELOC_PPC_TLS_ML, BFD_RELOC_PPC64_TLS_GD,
1745 BFD_RELOC_PPC64_TLS_LD, BFD_RELOC_PPC64_TLS_LE,
1746 BFD_RELOC_PPC64_TLS_IE, BFD_RELOC_PPC64_TLS_M,
1747 BFD_RELOC_PPC64_TLS_ML): New relocations.
1748 * bfd-in2.h: Regenerate.
1749 * libbfd.h: Regenerate.
1750 * coff-rs6000.c (xcoff_calculate_relocation): Call
1751 xcoff_reloc_type_tls for TLS relocations.
1752 (xcoff_howto_table): Implement TLS relocations.
1753 (_bfd_xcoff_reloc_type_lookup): Add cases TLS relocations.
1754 (xcoff_reloc_type_tls): New function.
1755 * coff64-rs6000.c (xcoff_calculate_relocation): Likewise.
1756 (xcoff_howto_table): Likewise.
1757 (_bfd_xcoff_reloc_type_lookup): Likewise.
1758 * coffcode.h (sec_to_styp_flags): Handle TLS sections.
1759 (styp_to_sec_flags): Likewise.
1760 (coff_compute_section_file_positions): Avoid file offset
1761 optimisation for .data when the previous section is .tdata.
1762 (coff_write_object_contents): Handle TLS sections.
1763 * coffswap.h (coff_swap_aouthdr_out): Add support for
1764 new fields in aouthdr.
1765 * libxcoff.h (xcoff_reloc_type_tls): Add prototype.
1766 * xcofflink.c (xcoff_link_add_symbols): Handle XMC_UL.
1767 (xcoff_need_ldrel_p): Add cases for TLS relocations.
1768 (xcoff_create_ldrel): Add l_symndx for TLS sections.
1769
1770 2021-03-12 Clément Chigot <clement.chigot@atos.net>
1771
1772 * reloc.c (BFD_RELOC_PPC_TOC16_HI, BFD_RELOC_PPC_TOC16_LO):
1773 New relocations.
1774 * bfd-in2.h: Regenerate.
1775 * libbfd.h: Regenerate.
1776 * coff-rs6000.c (xcoff_calculate_relocation): Call
1777 xcoff_reloc_type_toc for R_TOCU and R_TOCL.
1778 (xcoff_howto_table): Remove src_mask for TOC relocations.
1779 Add R_TOCU and R_TOCL howtos.
1780 (_bfd_xcoff_reloc_type_lookup): Add cases for
1781 BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO.
1782 (xcoff_reloc_type_toc): Compute the whole offset.
1783 Implement R_TOCU and R_TOCL.
1784 * coff64-rs6000.c (xcoff64_calculate_relocation):
1785 Likewise.
1786 (xcoff64_howto_table): Likewise.
1787 (xcoff64_reloc_type_lookup): Likewise.
1788
1789 2021-03-12 Clément Chigot <clement.chigot@atos.net>
1790
1791 * coff-rs6000.c (xcoff_calculate_relocation): Correct and
1792 add new relocations.
1793 (xcoff_howto_table): Likewise.
1794 (xcoff_rtype2howto): Increase r_type maximum value.
1795 (xcoff_ppc_relocate_section): Reuse predefined HOWTOs instead
1796 of create a new one from scratch. Enable only some relocations
1797 to have a changing r_size.
1798 * coff64-rs6000.c (xcoff64_calculate_relocation): Likewise.
1799 (xcoff64_howto_table): Likewise.
1800 (xcoff64_rtype2howto): Likewise.
1801 (xcoff64_ppc_relocate_section): Likewise.
1802 * libxcoff.h (XCOFF_MAX_CALCULATE_RELOCATION): Fix value.
1803
1804 2021-03-12 Clément Chigot <clement.chigot@atos.net>
1805
1806 * coff64-rs6000.c (xcoff64_ppc_relocate_section): Move.
1807
1808 2021-03-12 Clément Chigot <clement.chigot@atos.net>
1809
1810 * coff64-rs6000.c (xcoff64_write_object_contents): Remove.
1811 * coffcode.h (coff_write_object_contents): Add bfd_mach_ppc_620
1812 support for o_cputype field. Avoid creating an empty a.out header
1813 for XCOFF64.
1814
1815 2021-03-12 Clément Chigot <clement.chigot@atos.net>
1816
1817 * coff64-rs6000.c (xcoff64_create_csect_from_smclas): Add
1818 missing smclass.
1819
1820 2021-03-11 Nelson Chu <nelson.chu@sifive.com>
1821
1822 * elfnn-riscv.c (riscv_elf_link_hash_table): New boolean
1823 restart_relax, used to check if we need to run the whole
1824 relaxations from relax pass 0 to 2 again.
1825 (riscv_elf_link_hash_table_create): Init restart_relax to FALSE.
1826 (_bfd_riscv_relax_align): Remove obsolete sec_flg0 set.
1827 (_bfd_riscv_relax_delete): Set again to TRUE if we do delete the code.
1828 (bfd_elfNN_riscv_restart_relax_sections): New function. Called by
1829 after_allocation to check if we need to run the whole relaxations again.
1830 (_bfd_riscv_relax_section): We will only enter into the relax pass 3
1831 when the restart_relax is FALSE; At last set restart_relax to TRUE if
1832 again is TRUE, too.
1833 * elfxx-riscv.h (bfd_elf32_riscv_restart_relax_sections): Declaration.
1834 (bfd_elf64_riscv_restart_relax_sections): Likewise.
1835
1836 2021-03-10 Jan Beulich <jbeulich@suse.com>
1837
1838 * cofflink.c (_bfd_coff_write_global_sym): Range-check symbol
1839 offset.
1840
1841 2021-03-10 Alan Modra <amodra@gmail.com>
1842 Jan Beulich <jbeulich@suse.com>
1843
1844 * elf.c (bfd_elf_generic_reloc): Make references between debug
1845 sections use section relative values.
1846
1847 2021-03-09 Jan Beulich <jbeulich@suse.com>
1848
1849 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Diagnose out of range RVA.
1850
1851 2021-03-05 H.J. Lu <hongjiu.lu@intel.com>
1852
1853 PR ld/27425
1854 PR ld/27432
1855 * bfd.c (_bfd_get_link_info): New function.
1856 * elf-bfd.h (output_elf_obj_tdata): Add link_info.
1857 (elf_link_info): New.
1858 * libbfd-in.h (_bfd_get_link_info): New prototype.
1859 * coff-x86_64.c (coff_amd64_reloc): Also subtract __ImageBase for
1860 R_AMD64_IMAGEBASE when generating x86-64 ELF executable.
1861 * pe-x86_64.c: Include "coff/internal.h" and "libcoff.h".
1862 (pex64_link_add_symbols): New function.
1863 (coff_bfd_link_add_symbols): New macro.
1864 * libbfd.h: Regenerated.
1865
1866 2021-03-05 Craig Blackmore <craig.blackmore@embecosm.com>
1867 Andrew Burgess <andrew.burgess@embecosm.com>
1868
1869 * elf-bfd.h (elfcore_write_riscv_csr): Declare.
1870 * elf.c (elfcore_grok_riscv_csr): New function.
1871 (elfcore_grok_note): Handle NT_RISCV_CSR.
1872 (elfcore_write_riscv_csr): New function.
1873 (elfcore_write_register_note): Handle '.reg-riscv-csr'.
1874
1875 2021-03-05 Craig Blackmore <craig.blackmore@embecosm.com>
1876 Andrew Burgess <andrew.burgess@embecosm.com>
1877
1878 * elfnn-riscv.c (PRPSINFO_PR_FNAME_LENGTH): Define.
1879 (PRPSINFO_PR_PSARGS_LENGTH): Define.
1880 (riscv_write_core_note): New function.
1881 (riscv_elf_grok_psinfo): Make use of two new length defines.
1882 (elf_backend_write_core_note): Define.
1883
1884 2021-03-05 Craig Blackmore <craig.blackmore@embecosm.com>
1885 Andrew Burgess <andrew.burgess@embecosm.com>
1886
1887 * elf-bfd.h (elfcore_write_gdb_tdesc): Declare new function.
1888 * elf.c (elfcore_grok_gdb_tdesc): New function.
1889 (elfcore_grok_note): Handle NT_GDB_TDESC.
1890 (elfcore_write_gdb_tdesc): New function.
1891 (elfcore_write_register_note): Handle NT_GDB_TDESC.
1892
1893 2021-03-05 Nick Clifton <nickc@redhat.com>
1894
1895 PR 27521
1896 * dwarf2.c (is_str_attr): Add DW_FORM_strx* forms.
1897 (read_indexed_string): Placeholder function.
1898 (read_attribute_value): Handle DW_FORM_strx* and DW_FORM_addrx*
1899 forms.
1900
1901 2021-03-05 Alan Modra <amodra@gmail.com>
1902
1903 * reloc.c (bfd_perform_relocation): Revert 2021-01-12 and
1904 2020-09-16 changes.
1905 * coff-x86_64.c (coff_amd64_reloc): Do more or less the same
1906 adjustments here instead. Separate pc-relative adjustments
1907 from symbol related adjustments. Tidy comments and formatting.
1908
1909 2021-03-04 Jan Beulich <jbeulich@suse.com>
1910
1911 * coffcode.h (sec_to_styp_flags): Don't set IMAGE_SCN_LNK_* in
1912 final PE images.
1913
1914 2021-03-04 Alan Modra <amodra@gmail.com>
1915
1916 * rs6000-core.c (rs6000coff_core_p): Correct prototype.
1917
1918 2021-03-03 Alan Modra <amodra@gmail.com>
1919
1920 PR 27500
1921 * elflink.c (_bfd_elf_gc_mark_rsec): Do special start/stop
1922 processing not when start/stop symbol section is unmarked but
1923 on first time a start/stop symbol is processed.
1924
1925 2021-03-03 Alan Modra <amodra@gmail.com>
1926
1927 * reloc.c: Include x86_64.h rather than internal.h.
1928
1929 2021-03-02 Nick Clifton <nickc@redhat.com>
1930
1931 PR 27484
1932 * dwarf2.c (scan_unit_for_symbols): Scan twice, once to accumulate
1933 function and variable tags and a second time to resolve their
1934 attributes.
1935
1936 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
1937
1938 * elf-strtab.c (_bfd_elf_strtab_str): Skip strings with zero refcount.
1939
1940 2021-03-02 Alan Modra <amodra@gmail.com>
1941
1942 PR 27451
1943 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore synthesized
1944 linker defined start/stop symbols when start_stop_gc.
1945
1946 2021-03-02 Alan Modra <amodra@gmail.com>
1947
1948 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimise got
1949 indirect to pc-relative or toc-relative for undefined symbols.
1950
1951 2021-03-01 Alan Modra <amodra@gmail.com>
1952 Fangrui Song <maskray@google.com>
1953
1954 * elflink.c (_bfd_elf_gc_mark_rsec): Ignore synthesized linker
1955 defined start/stop symbols when start_stop_gc.
1956 (bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
1957 (bfd_elf_define_start_stop): Don't modify ldscript_def syms.
1958 * linker.c (bfd_generic_define_start_stop): Likewise.
1959
1960 2021-02-25 Alan Modra <amodra@gmail.com>
1961
1962 PR 27441
1963 * elf-bfd.h (struct elf_link_hash_entry): Add ref_ir_nonweak.
1964 * elflink.c (elf_link_add_object_symbols): Set ref_ir_nonweak and
1965 use when deciding an as-needed library should be loaded instead
1966 of using the binding of the library definition.
1967
1968 2021-02-24 Alan Modra <amodra@gmail.com>
1969
1970 PR 27459
1971 * coff-stgo32.c (go32exe_check_format): Sanity check size of
1972 header to avoid a buffer overflow.
1973
1974 2021-02-22 Alan Modra <amodra@gmail.com>
1975
1976 * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Remove BFD_RELOC_16.
1977 * coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise.
1978
1979 2021-02-19 Nelson Chu <nelson.chu@sifive.com>
1980
1981 PR 27158
1982 * elfnn-riscv.c (perform_relocation): Updated encoding macros.
1983 (_bfd_riscv_relax_call): Likewise.
1984 (_bfd_riscv_relax_lui): Likewise.
1985 * elfxx-riscv.c (howto_table): Likewise.
1986
1987 2021-02-18 Nelson Chu <nelson.chu@sifive.com>
1988
1989 * Makefile.am: Added cpu-riscv.h.
1990 * Makefile.in: Regenerated.
1991 * po/SRC-POTFILES.in: Regenerated.
1992 * cpu-riscv.h: Added to support spec versions controlling.
1993 Also added extern arrays and functions for cpu-riscv.c.
1994 (enum riscv_spec_class): Define all spec classes here uniformly.
1995 (struct riscv_spec): Added for all specs.
1996 (RISCV_GET_SPEC_CLASS): Added to reduce repeated code.
1997 (RISCV_GET_SPEC_NAME): Likewise.
1998 (RISCV_GET_ISA_SPEC_CLASS): Added to get ISA spec class.
1999 (RISCV_GET_PRIV_SPEC_CLASS): Added to get privileged spec class.
2000 (RISCV_GET_PRIV_SPEC_NAME): Added to get privileged spec name.
2001 * cpu-riscv.c (struct priv_spec_t): Replaced with struct riscv_spec.
2002 (riscv_get_priv_spec_class): Replaced with RISCV_GET_PRIV_SPEC_CLASS.
2003 (riscv_get_priv_spec_name): Replaced with RISCV_GET_PRIV_SPEC_NAME.
2004 (riscv_priv_specs): Moved below.
2005 (riscv_get_priv_spec_class_from_numbers): Likewise, updated.
2006 (riscv_isa_specs): Moved from include/opcode/riscv.h.
2007 * elfnn-riscv.c: Included cpu-riscv.h.
2008 (riscv_merge_attributes): Initialize in_priv_spec and out_priv_spec.
2009 * elfxx-riscv.c: Included cpu-riscv.h and opcode/riscv.h.
2010 (RISCV_UNKNOWN_VERSION): Moved from include/opcode/riscv.h.
2011 * elfxx-riscv.h: Removed extern functions to cpu-riscv.h.
2012
2013 2021-02-17 Alan Modra <amodra@gmail.com>
2014
2015 * wasm-module.c: Guard include of limits.h.
2016 (CHAR_BIT): Provide backup define.
2017 (wasm_read_leb128): Use CHAR_BIT to size "result" in bits.
2018 Correct signed overflow checking.
2019
2020 2021-02-17 Nelson Chu <nelson.chu@sifive.com>
2021
2022 PR 27200
2023 * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Delay
2024 copying the elf flags from input BFD to output BFD, until we have
2025 checked if the input BFD has no code section or not. Also fix the
2026 problem that we only check the first section rather than the entire
2027 sections for input BFD.
2028
2029 2021-02-16 Alan Modra <amodra@gmail.com>
2030
2031 * libbfd.c (_bfd_read_unsigned_leb128): Avoid excessive shift.
2032 (_bfd_safe_read_leb128, _bfd_read_signed_leb128): Likewise.
2033
2034 2021-02-15 Jan Beulich <jbeulich@suse.com>
2035
2036 * doc/Makefile.am: Replace "cp -p" by "$(LN_S)".
2037 * doc/Makefile.in: Re-generate.
2038
2039 2021-02-15 Alan Modra <amodra@gmail.com>
2040
2041 * elf32-nds32.c (nds32_get_section_contents): Replace
2042 bfd_malloc_and_get_section with bfd_get_full_section_contents.
2043 (nds32_elf_relax_delete_blanks): Init contents.
2044 (nds32_elf_relax_section, nds32_relax_fp_as_gp): Likewise.
2045
2046 2021-02-15 Alan Modra <amodra@gmail.com>
2047
2048 * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use
2049 bfd_get_full_section_contents.
2050
2051 2021-02-14 Alan Modra <amodra@gmail.com>
2052
2053 * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Apply
2054 all fixes to bfd_generic_get_relocated_section_contents since this
2055 function was split out.
2056
2057 2021-02-11 Alan Modra <amodra@gmail.com>
2058
2059 * config.bfd: Remove ia64 from obsolete list.
2060
2061 2021-02-11 Alan Modra <amodra@gmail.com>
2062
2063 PR ld/22269
2064 * elfnn-ia64.c: Revert 2017-10-14 git commit db41f6eb5234.
2065
2066 2021-02-11 Alan Modra <amodra@gmail.com>
2067
2068 PR 27294
2069 * elf32-avr.c (avr_elf32_load_records_from_section): Use
2070 bfd_malloc_and_get_section. Use bfd_byte* vars and remove then
2071 unnecessary casts.
2072
2073 2021-02-11 Alan Modra <amodra@gmail.com>
2074
2075 PR 27291
2076 * section.c (bfd_get_section_contents): Avoid possible overflow
2077 when range checking offset and count.
2078 (bfd_set_section_contents): Likewise.
2079
2080 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
2081
2082 * configure.ac (SHARED_LIBADD): Remove explicit -lintl population in
2083 favour of LIBINTL.
2084 * configure: Regenerated.
2085
2086 2021-02-09 Alan Modra <amodra@gmail.com>
2087
2088 * config.bfd (arm*-*-symbianelf*): Move from obsolete to removed.
2089 * configure.ac: Delete symbian entries.
2090 * elf-bfd.h (enum elf_target_os): Delete is_symbian.
2091 * elf32-arm.c: Remove symbian support. Formatting.
2092 * targets.c: Delete symbian entries.
2093 * configure: Regenerate.
2094
2095 2021-02-04 H.J. Lu <hongjiu.lu@intel.com>
2096
2097 PR ld/19609
2098 * elf64-x86-64.c (elf_x86_64_relocate_section): Provide more
2099 info when failed to convert GOTPCREL relocation.
2100
2101 2021-02-04 Nelson Chu <nelson.chu@sifive.com>
2102
2103 * elfxx-riscv.c (riscv_parse_prefixed_ext): Removed zb*.
2104
2105 2021-02-04 Alan Modra <amodra@gmail.com>
2106
2107 PR 27311
2108 * elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
2109 libraries for IR references on pass over libraries after LTO
2110 recompilation.
2111
2112 2021-02-03 Alan Modra <amodra@gmail.com>
2113
2114 PR 27311
2115 * elflink.c (_bfd_elf_add_default_symbol): Revert last two changes.
2116 (elf_link_add_object_symbols): Here too. Don't pull in as-needed
2117 libraries when H is an indirect symbol after calling
2118 _bfd_elf_add_default_symbol.
2119
2120 2021-02-03 Alan Modra <amodra@gmail.com>
2121
2122 PR 27311
2123 * elflink.c (_bfd_elf_add_default_symbol): Clear override when
2124 undecorated symbol will have a different version.
2125
2126 2021-02-02 Alan Modra <amodra@gmail.com>
2127
2128 PR 27311
2129 * elflink.c (_bfd_elf_add_default_symbol): Add override parameter.
2130 Use when handling default versioned symbol. Rename existing
2131 override variable to nondef_override and use for non-default
2132 versioned symbol.
2133 (elf_link_add_object_symbols): Adjust call to suit. Don't
2134 pull in as-needed libraries when override is set.
2135
2136 2021-02-01 Emery Hemingway <ehmry@posteo.net>
2137
2138 * config.bfd: Add *-*-genode* as a target for AArch64 and x86.
2139
2140 2021-02-01 Egor Vishnyakov <lenvampir@yandex.ru>
2141
2142 PR 27254
2143 * elf32-rl78.c (rl78_elf_relocate_section): Fix calculation of
2144 offset for the R_RL78_RH_SADDR relocation.
2145
2146 2021-01-29 Alan Modra <amodra@gmail.com>
2147
2148 PR 27271
2149 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't segfault
2150 on symbols defined in absolute or other special sections.
2151
2152 2021-01-28 Alan Modra <amodra@gmail.com>
2153
2154 PR 27259
2155 * elflink.c (_bfd_elf_gc_mark_extra_sections): Use linker_mark to
2156 prevent endless looping of linked-to sections.
2157
2158 2020-12-17 Mihails Strasuns <mihails.strasuns@intel.com>
2159
2160 * bfd-elf.h (elfcore_write_file_note): New function.
2161 * elf.c (elfcore_write_file_note): New function.
2162
2163 2021-01-26 Alan Modra <amodra@gmail.com>
2164
2165 * elf32-ft32.c (ft32_reloc_type_lookup): Don't miss ft32_reloc_map[0].
2166
2167 2021-01-24 H.J. Lu <hongjiu.lu@intel.com>
2168
2169 PR binutils/27231
2170 * dwarf2.c (read_rnglists): Ignore empty range when parsing line
2171 number tables.
2172
2173 2021-01-23 H.J. Lu <hongjiu.lu@intel.com>
2174
2175 PR binutils/27231
2176 * dwarf2.c (read_rnglists): Advance rngs_ptr after
2177 _bfd_safe_read_leb128 when parsing DW_RLE_offset_pair.
2178
2179 2021-01-20 Alan Modra <amodra@gmail.com>
2180
2181 * elf32-ppc.c: Delete outdated comment.
2182 (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
2183 * elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
2184
2185 2021-01-20 Alan Modra <amodra@gmail.com>
2186
2187 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't assume
2188 section symbols are present.
2189
2190 2021-01-19 Alan Modra <amodra@gmail.com>
2191
2192 * elf64-ppc.c (elf_hash_entry): New inline function. Use
2193 throughout to replace casts.
2194 (branch_reloc_hash_match): Remove const from params.
2195 (use_local_plt): New function.
2196 (allocate_dynrelocs, ppc_build_one_stub, ppc_size_one_stub),
2197 (build_global_entry_stubs_and_plt, ppc64_elf_relocate_section):
2198 Use use_local_plt.
2199 * elf32-ppc.c (use_local_plt): New function.
2200 (allocate_dynrelocs, ppc_elf_relocate_section),
2201 (write_global_sym_plt): Use use_local_plt.
2202
2203 2021-01-17 H.J. Lu <hongjiu.lu@intel.com>
2204
2205 PR ld/27193
2206 * elflink.c (elf_create_symbuf): Also ignore section symbols.
2207
2208 2021-01-16 H.J. Lu <hongjiu.lu@intel.com>
2209
2210 PR ld/23169
2211 * elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): Don't
2212 check pointer_equality_needed.
2213
2214 2021-01-15 H.J. Lu <hongjiu.lu@intel.com>
2215
2216 * elf-linker-x86.h (elf_linker_x86_params): Add
2217 report_relative_reloc.
2218 * elf32-i386.c (elf_i386_relocate_section): Call
2219 _bfd_x86_elf_link_report_relative_reloc to report relative
2220 relocations for -z report-relative-reloc.
2221 (elf_i386_finish_dynamic_symbol): Likewse.
2222 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewse.
2223 (elf_x86_64_finish_dynamic_symbol): Likewse.
2224 * elfxx-x86.c (_bfd_x86_elf_link_report_relative_reloc): New
2225 function.
2226 * elfxx-x86.h (_bfd_x86_elf_link_report_relative_reloc): New
2227 prototype.
2228
2229 2021-01-16 Alan Modra <amodra@gmail.com>
2230
2231 * compress.c (decompress_contents): Tidy inflateEnd result test.
2232
2233 2021-01-16 Alan Modra <amodra@gmail.com>
2234
2235 PR 26002
2236 * elflink.c (elf_link_output_extsym): Use version 1 in
2237 .gnu.version for undefined unversioned symbols.
2238
2239 2021-01-15 Nelson Chu <nelson.chu@sifive.com>
2240
2241 * elfnn-riscv.c (riscv_relax_delete_bytes): Fixed the indent that
2242 caused the by previous commit accidentally.
2243
2244 2021-01-15 Nelson Chu <nelson.chu@sifive.com>
2245
2246 * elfnn-riscv.c: Indent, labels and GNU coding standards tidy,
2247 also aligned the code.
2248
2249 2021-01-15 Nelson Chu <nelson.chu@sifive.com>
2250
2251 * elfnn-riscv.c (riscv_merge_attributes): Fix typos of messages.
2252
2253 2021-01-15 Nelson Chu <nelson.chu@sifive.com>
2254
2255 * elfnn-riscv.c: Comments tidy and improvement.
2256 * elfxx-riscv.c: Likewise.
2257 * elfxx-riscv.h: Likewise.
2258
2259 2021-01-14 H.J. Lu <hongjiu.lu@intel.com>
2260
2261 PR ld/26688
2262 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
2263 section for R_BFIN_FUNCDESC.
2264
2265 2021-01-14 Nick Clifton <nickc@redhat.com>
2266
2267 * elf.c (elfcore_grok_win32pstatus): Check for a note type of 0.
2268
2269 2021-01-13 Alan Modra <amodra@gmail.com>
2270
2271 * Makefile.in: Regenerate.
2272 * doc/Makefile.in: Regenerate.
2273
2274 2021-01-13 Alan Modra <amodra@gmail.com>
2275
2276 PR 27160
2277 * section.c (struct bfd_section): Remove pattern field.
2278 (BFD_FAKE_SECTION): Adjust to suit.
2279 * bfd-in2.h: Regenerate.
2280 * elflink.c (compare_link_order, elf_fixup_link_order): Delete.
2281 (bfd_elf_final_link): Don't call elf_fixup_link_order.
2282
2283 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
2284
2285 PR binutils/26792
2286 * configure.ac: Use GNU_MAKE_JOBSERVER.
2287 * aclocal.m4: Regenerated.
2288 * configure: Likewise.
2289
2290 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
2291
2292 PR ld/27171
2293 * reloc.c (bfd_perform_relocation): Adjust R_AMD64_DIR64 and
2294 R_AMD64_DIR32 relocations for PE/x86-64 inputs.
2295
2296 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
2297
2298 PR ld/27173
2299 * configure: Regenerated.
2300
2301 2021-01-11 Nick Clifton <nickc@redhat.com>
2302
2303 * po/fr.po: Updated French translation.
2304 * po/pt.po: Updated Portuguese translation.
2305 * po/sr.po: Updated Serbian translation.
2306 * po/uk.po: Updated Ukranian translation.
2307
2308 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
2309
2310 * configure: Regenerated.
2311
2312 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
2313
2314 PR ld/27166
2315 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle
2316 -z lam-u48 and -z lam-u57.
2317
2318 2021-01-09 Nick Clifton <nickc@redhat.com>
2319
2320 * version.m4: Change to 2.36.50.
2321 * configure: Regenerate.
2322 * po/bfd.pot: Regenerate.
2323
2324 2021-01-09 Nick Clifton <nickc@redhat.com>
2325
2326 * 2.36 release branch crated.
2327
2328 2021-01-08 H.J. Lu <hongjiu.lu@intel.com>
2329
2330 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Also set
2331 LAM_U57 when setting LAM_U48.
2332
2333 2021-01-08 H.J. Lu <hongjiu.lu@intel.com>
2334
2335 PR ld/26256
2336 PR ld/27160
2337 * elflink.c (elf_fixup_link_order): Verify that fixing up
2338 SHF_LINK_ORDER doesn't increase the output section size.
2339
2340 2021-01-09 Alan Modra <amodra@gmail.com>
2341
2342 * configure: Regenerate.
2343
2344 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
2345
2346 * configure: Regenerate.
2347
2348 2021-01-07 H.J. Lu <hongjiu.lu@intel.com>
2349
2350 PR 27109
2351 * aix386-core.c (core_aix386_vec): Initialize
2352 keep_unused_section_symbol to TARGET_KEEP_UNUSED_SECTION_SYMBOLS.
2353 * aout-target.h (MY (vec)): Likewise.
2354 * binary.c (binary_vec): Likewise.
2355 * cisco-core.c (core_cisco_be_vec): Likewise.
2356 (core_cisco_le_vec): Likewise.
2357 * coff-alpha.c (alpha_ecoff_le_vec): Likewise.
2358 * coff-i386.c (TARGET_SYM): Likewise.
2359 (TARGET_SYM_BIG): Likewise.
2360 * coff-ia64.c (TARGET_SYM): Likewise.
2361 * coff-mips.c (mips_ecoff_le_vec): Likewise.
2362 (mips_ecoff_be_vec): Likewise.
2363 (mips_ecoff_bele_vec): Likewise.
2364 * coff-rs6000.c (rs6000_xcoff_vec): Likewise.
2365 (powerpc_xcoff_vec): Likewise.
2366 * coff-sh.c (sh_coff_small_vec): Likewise.
2367 (sh_coff_small_le_vec): Likewise.
2368 * coff-tic30.c (tic30_coff_vec): Likewise.
2369 * coff-tic54x.c (tic54x_coff0_vec): Likewise.
2370 (tic54x_coff0_beh_vec): Likewise.
2371 (tic54x_coff1_vec): Likewise.
2372 (tic54x_coff1_beh_vec): Likewise.
2373 (tic54x_coff2_vec): Likewise.
2374 (tic54x_coff2_beh_vec): Likewise.
2375 * coff-x86_64.c (TARGET_SYM): Likewise.
2376 (TARGET_SYM_BIG): Likewise.
2377 * coff64-rs6000.c (rs6000_xcoff64_vec): Likewise.
2378 (rs6000_xcoff64_aix_vec): Likewise.
2379 * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): Likewise.
2380 (CREATE_BIGHDR_COFF_TARGET_VEC): Likewise.
2381 (CREATE_LITTLE_COFF_TARGET_VEC): Likewise.
2382 * elfxx-target.h (TARGET_BIG_SYM): Likewise.
2383 (TARGET_LITTLE_SYM): Likewise.
2384 * hppabsd-core.c (core_hppabsd_vec): Likewise.
2385 * hpux-core.c (core_hpux_vec): Likewise.
2386 * i386msdos.c (i386_msdos_vec): Likewise.
2387 * ihex.c (ihex_vec): Likewise.
2388 * irix-core.c (core_irix_vec): Likewise.
2389 * mach-o-target.c (TARGET_NAME): Likewise.
2390 * mmo.c (mmix_mmo_vec): Likewise.
2391 * netbsd-core.c (core_netbsd_vec): Likewise.
2392 * osf-core.c (core_osf_vec): Likewise.
2393 * pdp11.c (MY (vec)): Likewise.
2394 * pef.c (pef_vec): Likewise.
2395 (pef_xlib_vec): Likewise.
2396 * plugin.c (plugin_vec): Likewise.
2397 * ppcboot.c (powerpc_boot_vec): Likewise.
2398 * ptrace-core.c (core_ptrace_vec): Likewise.
2399 * sco5-core.c (core_sco5_vec): Likewise.
2400 * som.c (hppa_som_vec): Likewise.
2401 * srec.c (srec_vec): Likewise.
2402 (symbolsrec_vec): Likewise.
2403 * tekhex.c (tekhex_vec): Likewise.
2404 * trad-core.c (core_trad_vec): Likewise.
2405 * verilog.c (verilog_vec): Likewise.
2406 * vms-alpha.c (alpha_vms_vec): Likewise.
2407 * vms-lib.c (alpha_vms_lib_txt_vec): Likewise.
2408 * wasm-module.c (wasm_vec): Likewise.
2409 * xsym.c (sym_vec): Likewise.
2410 * elf.c (ignore_section_sym): Return TRUE if BSF_SECTION_SYM_USED
2411 isn't set.
2412 (elf_map_symbols): Don't include ignored section symbols.
2413 * elfcode.h (elf_slurp_symbol_table): Also set
2414 BSF_SECTION_SYM_USED on STT_SECTION symbols.
2415 * elflink.c (bfd_elf_final_link): Generated section symbols only
2416 when emitting relocations or reqired.
2417 * elfxx-x86.h (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
2418 * syms.c (BSF_SECTION_SYM_USED): New.
2419 * targets.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
2420 (bfd_target): Add keep_unused_section_symbols.
2421 (bfd_keep_unused_section_symbols): New.
2422 * bfd-in2.h: Regenerated.
2423
2424 2021-01-07 Nick Clifton <nickc@redhat.com>
2425
2426 PR 25713
2427 * bfdio.c (_bfd_real_fopen): For Win32 convert relative paths to
2428 absolute paths and check to see if they are longer than MAX_PATH.
2429
2430 2021-01-07 Philipp Tomsich <prt@gnu.org>
2431
2432 * elfxx-riscv.c (riscv_std_z_ext_strtab): Added zihintpause.
2433
2434 2021-01-07 Claire Xenia Wolf <claire@symbioticeda.com>
2435 Jim Wilson <jimw@sifive.com>
2436 Andrew Waterman <andrew@sifive.com>
2437 Maxim Blinov <maxim.blinov@embecosm.com>
2438 Kito Cheng <kito.cheng@sifive.com>
2439 Nelson Chu <nelson.chu@sifive.com>
2440
2441 * elfxx-riscv.c (riscv_std_z_ext_strtab): Added zba, zbb and zbc.
2442
2443 2021-01-06 H.J. Lu <hongjiu.lu@intel.com>
2444
2445 * elf32-bfin.c (bfin_check_relocs): Check bfd_link_hash_indirect.
2446 (bfinfdpic_check_relocs): Likewise.
2447
2448 2021-01-06 Alan Modra <amodra@gmail.com>
2449
2450 * elf32-score.c (s3_bfd_score_info_to_howto): Report an error
2451 on unknown r_type.
2452 * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.
2453
2454 2021-01-06 Alan Modra <amodra@gmail.com>
2455
2456 * config.bfd (sparc-*-solaris2*): Add sparc_elf32_vec.
2457 (sparc64-*-solaris2*): Add sparc_elf64_vec and
2458 sparc_elf32_vec.
2459
2460 2021-01-06 Marcus Comstedt <marcus@mc.pp.se>
2461
2462 * config.bfd: Added targets riscv64be*-*-*, riscv32be*-*-* and
2463 riscvbe*-*-*. Also added riscv_elf[32|64]_be_vec.
2464 * configure.ac: Handle riscv_elf[32|64]_be_vec.
2465 * configure: Regenerate.
2466 * elfnn-riscv.c: Include <limits.h> and define CHAR_BIT for
2467 riscv_is_insn_reloc.
2468 (riscv_get_insn): RISC-V instructions are always little endian, but
2469 bfd_get may be used for big-endian, so add new riscv_get_insn to handle
2470 the insturctions.
2471 (riscv_put_insn): Likewsie.
2472 (riscv_is_insn_reloc): Check if we are relocaing an instruction.
2473 (perform_relocation): Call riscv_is_insn_reloc to decide if we should
2474 use riscv_[get|put]_insn or bfd_[get|put].
2475 (riscv_zero_pcrel_hi_reloc): Use riscv_[get|put]_insn, bfd_[get|put]l32
2476 or bfd_[get|put]l16 for code.
2477 (riscv_elf_relocate_section): Likewise.
2478 (riscv_elf_finish_dynamic_symbol): Likewise.
2479 (riscv_elf_finish_dynamic_sections): Likewise.
2480 (_bfd_riscv_relax_call): Likewise.
2481 (_bfd_riscv_relax_lui): Likewise.
2482 (_bfd_riscv_relax_align): Likewise.
2483 (_bfd_riscv_relax_pc): Likewise.
2484 (riscv_elf_object_p): Handled for big endian.
2485 (TARGET_BIG_SYM, TARGET_BIG_NAME): Defined.
2486 * targets.c: Add riscv_elf[32|64]_be_vec.
2487 (_bfd_target_vector): Likewise.
2488
2489 2021-01-05 Alan Modra <amodra@gmail.com>
2490
2491 * elflink.c (bfd_elf_link_record_dynamic_symbol): Handle no_export
2492 for relocatable executable.
2493
2494 2021-01-05 Alan Modra <amodra@gmail.com>
2495
2496 * vms-alpha.c (_bfd_vms_slurp_egsd): Read flags after size check.
2497
2498 2021-01-05 Nelson Chu <nelson.chu@sifive.com>
2499
2500 * elfnn-riscv.c (allocate_dynrelocs): When we are generating pde,
2501 make sure gp symbol is output as a dynamic symbol.
2502
2503 2021-01-04 H.J. Lu <hongjiu.lu@intel.com>
2504
2505 PR ld/26256
2506 * elflink.c (compare_link_order): Place unordered sections before
2507 ordered sections.
2508 (elf_fixup_link_order): Add a link info argument. Allow mixed
2509 ordered and unordered input sections for non-relocatable link.
2510 Sort the consecutive bfd_indirect_link_order sections with the
2511 same pattern. Change the offsets of the bfd_indirect_link_order
2512 sections only.
2513 (bfd_elf_final_link): Pass info to elf_fixup_link_order.
2514 * section.c (bfd_section): Add pattern.
2515 (BFD_FAKE_SECTION): Initialize pattern to NULL.
2516 * bfd-in2.h: Regenerated.
2517
2518 2021-01-04 Alexander Fedotov <alfedotov@gmail.com>
2519
2520 * elf32-arm.c (elf32_arm_print_private_bfd_data): Prefix hex value
2521 of private flags with 0x.
2522 * elfnn-aarch64.c (elfNN_aarch64_print_private_bfd_data): Likewise.
2523
2524 2021-01-04 Alan Modra <amodra@gmail.com>
2525
2526 PR 26822
2527 * elflink.c (elf_link_input_bfd): Use the file base name in
2528 linker generated STT_FILE symbols.
2529
2530 2021-01-04 Nelson Chu <nelson.chu@sifive.com>
2531
2532 * elfxx-riscv.c (riscv_compare_subsets): Removed static.
2533 * elfxx-riscv.h: Add declaration.
2534 * elfnn-riscv.c (riscv_merge_multi_letter_ext): Use
2535 riscv_compare_subsets to check the orders.
2536 (riscv_skip_prefix): Removed.
2537 (riscv_prefix_cmp): Removed.
2538
2539 2021-01-04 Alan Modra <amodra@gmail.com>
2540
2541 PR 26741
2542 * elfxx-riscv.c (riscv_parse_prefixed_ext): Free subset after
2543 calculating subset version length.
2544
2545 2021-01-01 Nicolas Boulenguez <nicolas@debian.org>
2546
2547 * xcofflink.c: Correct spelling in comments.
2548
2549 2021-01-01 Alan Modra <amodra@gmail.com>
2550
2551 Update year range in copyright notice of all files.
2552
2553 For older changes see ChangeLog-2020
2554 \f
2555 Copyright (C) 2021-2022 Free Software Foundation, Inc.
2556
2557 Copying and distribution of this file, with or without modification,
2558 are permitted in any medium without royalty provided the copyright
2559 notice and this notice are preserved.
2560
2561 Local Variables:
2562 mode: change-log
2563 left-margin: 8
2564 fill-column: 74
2565 version-control: never
2566 End: