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