]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/ChangeLog
Use htab->c64_rel more, do not use GOT_CAP
[thirdparty/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
5fa80905
AC
12022-02-03 Alex Coplan <alex.coplan@arm.com>
2 Matthew Malcomson <matthew.malcomson@arm.com>
3
4 * elfnn-aarch64.c (pcc_low): New.
5 (pcc_high): New.
6 (elfNN_c64_resize_sections): Update new global variables
7 pcc_{low,high} instead of local variables to track PCC span.
8 (enum c64_section_perm_type): New.
9 (c64_symbol_section_adjustment): New.
10 (c64_fixup_frag): Rework to calculate size appropriately for
11 symbols that need adjustment.
12 (c64_symbol_adjust): New. Use it ...
13 (elfNN_aarch64_final_link_relocate): ... here.
14
f3ecc5c8
AC
152022-01-17 Alex Coplan <alex.coplan@arm.com>
16
17 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Skip over TLS
18 relocations against weak undef symbols.
19 (elfNN_aarch64_check_relocs): Likewise, but also warn.
20
ffbda24e
LM
212021-05-25 Luis Machado <luis.machado@arm.com>
22
23 * elf-bfd.h (elfcore_write_aarch_morello): New prototype.
24 * elf.c (elfcore_grok_aarch_morello): New function.
25 (elfcore_grok_note): Handle NT_ARM_MORELLO.
26 (elfcore_write_aarch_morello): New function.
27 (elfcore_write_register_note): Handle reg-aarch-morello.
28 (elfcore_make_memtag_note_section): New function.
29 (elfcore_grok_note): Handle NT_MEMTAG note types.
30
4ca9b406
SP
312020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
32
33 * elfnn-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Add Morello
34 relocations.
35 (elfNN_aarch64_tlsdesc_small_plt_c64_entry): New Morello
36 tlsdesc PLT entry.
37 (elfNN_aarch64_howto_table): Add TLSDESC_ADR_PAGE20,
38 TLSDESC_LD128_LO12, TLSDESC_CALL, TLSDESC relocations for
39 Morello.
40 (aarch64_tls_transition_without_check): Add INFO and
41 MORELLO_RELOC arguments. Add morello TLSDESC relocations.
42 (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate,
43 elfNN_aarch64_tls_relax, elfNN_aarch64_check_relocs,
44 aarch64_can_relax_tls): Add morello TLSDESC relocations.
45 (aarch64_tls_transition): Add transitions for morello TLSDESC
46 relocations.
47 (elfNN_aarch64_tls_relax): Add relaxations for morello
48 TLSDESC.
49 (elfNN_aarch64_relocate_section): Emit dynamic relocation for
50 Morello static relocations.
51 (elfNN_aarch64_allocate_dynrelocs): Allocate dynamic
52 relocation space for Morello TLSDESC.
53 (elfNN_aarch64_finish_dynamic_sections): Emit Morello tlsdesc
54 PLT entry.
55 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend,
56 _bfd_aarch64_elf_resolve_relocation): Add Morello relocations.
57 * reloc.c: Add Morello relocations.
58 * bfd-in2.h: Regenerate.
59 * libbfd.h: Regenerate.
60
7ff36d1a
SP
612020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
62
63 * elfnn-aarch64.c (elf_aarch64_link_hash_table): New member.
64 (section_start_symbol, c64_valid_cap_range, exponent): Move
65 up.
66 (sec_change_queue): New structure.
67 (queue_section_padding, record_section_change,
68 elfNN_c64_resize_sections): New functions.
69 (bfd_elfNN_aarch64_init_maps): Add info argument. Adjust
70 callers.
71 * elfxx-aarch64.h (bfd_elf64_aarch64_init_maps,
72 bfd_elf32_aarch64_init_maps): Add info argument.
73 (elf64_c64_resize_sections, elf32_c64_resize_sections): New
74 function declarations.
75
fa6ca5e2
SP
762020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
77
78 * elf-bfd.h (elf_backend_data): New callback
79 elf_backend_eh_frame_augmentation_char.
80 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Use it.
81 * elfnn-aarch64.c (elf64_aarch64_eh_frame_augmentation_char):
82 New function.
83 (elf_backend_eh_frame_augmentation_char): New macro.
84
85 * elfxx-target.h [!elf_backend_eh_frame_augmentation_char]:
86 Set elf_backend_eh_frame_augmentation_char to NULL.
87 (elfNN_bed): Initialise
88 elf_backend_eh_frame_augmentation_char.
89
50e192f0
SP
902020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
91
92 * elfnn-aarch64.c (STUB_ENTRY_NAME): Add format specifier for
93 veneer type.
94 (C64_MAX_ADRP_IMM, C64_MIN_ADRP_IMM): New macros.
95 (aarch64_branch_reloc_p, c64_valid_for_adrp_p,
96 aarch64_interwork_stub): New functions.
97 (aarch64_c64_branch_stub, c64_aarch64_branch_stub): New stubs.
98 (elf_aarch64_stub_type): New members.
99 (aarch64_type_of_stub): Support C64 stubs.
100 (aarch64_lookup_stub_type_suffix): New function.
101 (elfNN_aarch64_stub_name): Use it.
102 (elfNN_aarch64_get_stub_entry): Add stub_type argument.
103 Adjust callers. Support C64 stubs.
104 (aarch64_build_one_stub): Likewise.
105 (aarch64_size_one_stub): Likewise.
106 (elfNN_aarch64_size_stubs): Likewise.
107 (elfNN_aarch64_build_stubs): Save and return error if stub
108 building failed.
109 (elfNN_aarch64_final_link_relocate): Emit stubs based on
110 whether source and target of a branch are different.
111 (aarch64_map_one_stub): Emit mapping symbol for C64 stubs.
112
e19e9199
SP
1132020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
114
115 * elfnn-aarch64.c (elfNN_c64_small_plt0_entry,
116 elfNN_c64_small_plt_entry): New variables.
117 (elfNN_aarch64_howto_table): Add relocations.
118 (setup_plt_values): Choose C64 PLT when appropriate.
119 (bfd_elfNN_aarch64_set_options): Defer setup_plt_values
120 call...
121 (elfNN_aarch64_link_setup_gnu_properties) ... from here as
122 well...
123 (elfNN_aarch64_size_dynamic_sections): ... to here.
124 (elfNN_aarch64_final_link_relocate,
125 elfNN_aarch64_check_relocs, elfNN_aarch64_reloc_type_class):
126 Support new relocations.
127 (map_symbol_type): New member AARCH64_MAP_C64.
128 (elfNN_aarch64_output_arch_local_syms): Use it.
129 (aarch64_update_c64_plt_entry): New function.
130 (elfNN_aarch64_create_small_pltn_entry): Use it.
131 (elfNN_aarch64_init_small_plt0_entry): Emit C64 PLT when
132 appropriate.
133 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend,
134 _bfd_aarch64_elf_resolve_relocation): Add new relocations.
135 * libbfd.h (bfd_reloc_code_real_names): Likewise.
136 * reloc.c: New relocations BFD_RELOC_MORELLO_TSTBR14,
137 BFD_RELOC_MORELLO_BRANCH19, BFD_RELOC_MORELLO_JUMP26,
138 BFD_RELOC_MORELLO_CALL26, BFD_RELOC_MORELLO_JUMP_SLOT and
139 BFD_RELOC_MORELLO_IRELATIVE.
140 * bfd-in2.h: Regenerate.
141
8d4edc5f
SP
1422020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
143
144 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Emit
145 relative C64 relocations for static binaries early.
146 (aarch64_elf_init_got_section): Add capability relocations to
147 SRELCAPS for non-PIE static binaries.
148 (elfNN_aarch64_allocate_dynrelocs): Likewise.
149 (elfNN_aarch64_always_size_sections): Emit
150 __cap_dynrelocs_start and __cap_dynrelocs_end.
151
a1bdea65
SP
1522020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
153
154 * elfnn-aarch64.c (GOT_ENTRY_SIZE): Adjust for C64
155 relocations. Adjust callers.
156 (GOT_RESERVED_HEADER_SLOTS, GOT_CAP): New macros.
157 (elfNN_aarch64_howto_table): Add R_MORELLO_LD128_GOT_LO12_NC
158 and R_MORELLO_GLOB_DAT.
159 (elf_aarch64_link_hash_table): New member c64_rel.
160 (bfd_elfNN_aarch64_set_options): Initialise it.
161 (cap_meta, c64_get_capsize): New functions.
162 (aarch64_reloc_got_type): Use GOT_CAP.
163 (elfNN_aarch64_final_link_relocate): Add
164 R_MORELLO_LD128_GOT_LO12_NC and R_MORELLO_GLOB_DAT.
165 (aarch64_elf_create_got_section): Move section initialisation
166 into a...
167 (aarch64_elf_init_got_section): ... New function.
168 (elfNN_aarch64_size_dynamic_sections): Call it.
169 (elfNN_aarch64_check_relocs): Add R_MORELLO_LD128_GOT_LO12_NC
170 and R_MORELLO_GLOB_DAT.
171 (elfNN_aarch64_finish_dynamic_symbol): Emit C64 relocations
172 when appropriate.
173 (elfNN_aarch64_got_elt_size): New function.
174 (elfNN_aarch64_got_header_size): Return GOT entry size based
175 on c64_rel.
176 (elf_backend_got_elt_size): New macro.
177 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend,
178 _bfd_aarch64_elf_resolve_relocation): Add
179 BFD_RELOC_MORELLO_LD128_GOT_LO12_NC.
180 * libbfd.h (bfd_reloc_code_real_names): Add
181 BFD_RELOC_MORELLO_GLOB_DAT and
182 BFD_RELOC_MORELLO_LD128_GOT_LO12_NC.
183 * reloc.c: Likewise.
184 * bfd-in2.h: Regenerate.
185
f938669f
SP
1862020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
187 Tamar Christina <tamar.christina@arm.com>
188
189 * elf-bfd.h (elf_backend_data): Make got_header_size a
190 function. Add callbacks to all targets that use it.
191 * elflink.c (_bfd_elf_create_got_section,
192 bfd_elf_gc_common_finalize_got_offsets,
193 _bfd_elf_common_section): Adjust got_header_size usage.
194
d2beed31
SP
1952020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
196
197 * elfxx-aarch64.c (reencode_ldst_pos_imm): Support loads and
198 stores with alternate base.
199
40bbb79e
SP
2002020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
201
202 * elfnn-aarch64.c (elfNN_aarch64_howto_table,
203 elfNN_aarch64_final_link_relocate, elfNN_aarch64_check_relocs,
204 elfNN_aarch64_relocate_section): Add R_MORELLO_CAPINIT and
205 R_MORELLO_RELATIVE.
206 (elf_aarch64_link_hash_table): New member srelcaps.
207 (c64_valid_cap_range, exponent, cap_meta,
208 section_start_symbol, c64_fixup_frag): New functions.
209 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend,
210 _bfd_aarch64_elf_resolve_relocation): Add
211 BFD_RELOC_MORELLO_CAPINIT and BFD_RELOC_MORELLO_RELATIVE.
212 * libbfd.h (bfd_reloc_code_real_names): Likewise.
213 * reloc.c: Likewise.
214 * bfd-in2.h: Regenerate.
215
92504105
SP
2162020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
217
218 * reloc.c: Add MORELLO_ADR_HI20_PCREL,
219 MORELLO_ADR_HI20_NC_PCREL and MORELLO_ADR_GOT_PAGE.
220 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
221 (aarch64_reloc_got_type): Add MORELLO_ADR_GOT_PAGE.
222 (_bfd_aarch64_erratum_843419_branch_to_stub): Add C64 argument
223 to _bfd_aarch64_reencode_adr_imm.
224 (elfNN_aarch64_final_link_relocate,
225 elfNN_aarch64_check_relocs): Add MORELLO_ADR_GOT_PAGE,
226 MORELLO_ADR_HI20_PCREL and MORELLO_ADR_HI20_NC_PCREL.
227 * elfxx-aarch64.c (_bfd_aarch64_reencode_adr_imm): Add C64
228 argument.
229 (_bfd_aarch64_elf_put_addend): Adjust callers.
230 * elfxx-aarch64.h (_bfd_aarch64_reencode_adr_imm): Add C64
231 argument.
232 * libbfd.h (bfd_reloc_code_real_names): Add
233 MORELLO_ADR_GOT_PAGE, MORELLO_ADR_HI20_PCREL and
234 MORELLO_ADR_HI20_NC_PCREL.
235 * bfd-in2.h: Regenerate.
236
f7d2c675
SP
2372020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
238
239 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add
240 LD_PREL_LO17.
241 (elfNN_aarch64_final_link_relocate,
242 elfNN_aarch64_check_relocs): Likewise.
243 * elfxx-aarch64.c (reencode_ld_lit_ofs_17): New function.
244 (_bfd_aarch64_elf_put_addend,
245 _bfd_aarch64_elf_resolve_relocation): Add LD_PREL_LO17.
246 * libbfd.h (bfd_reloc_code_real_names): Add
247 BFD_RELOC_MORELLO_LD_LO17_PCREL.
248 * reloc.c: Add BFD_RELOC_AARCH64_LD_LO17_PCREL.
249 * bfd-in2.h: Regenerate.
250
f0070c1e
SP
2512020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
252
253 * elf-bfd.h (bfd_elf_section_data): New member
254 is_target_section_data.
255 * elfnn-aarch64.c (_aarch64_elf_section_data): New member
256 sorted.
257 (elf_aarch64_section_data_get, c64_value_p): New functions.
258 (elf_aarch64_compare_mapping): Move function up in the file.
259 (elf_aarch64_obj_tdata): New member secmaps_initialised.
260 (bfd_elfNN_aarch64_init_maps, bfd_elfNN_aarch64_set_options):
261 Use it.
262 (elfNN_aarch64_size_stubs): Use symbol cache.
263 (elfNN_aarch64_check_relocs): Call
264 bfd_elfNN_aarch64_init_maps. Mark C64 symbols in relocations
265 in the symbol cache.
266
c774f507
SP
2672020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
268
269 * elfnn-aarch64.c (section_list,
270 sections_with_aarch64_elf_section_data,
271 record_section_with_aarch64_elf_section_data,
272 find_aarch64_elf_section_entry,
273 unrecord_section_with_aarch64_elf_section_data,
274 unrecord_section_via_map_over_sections,
275 bfd_elfNN_close_and_cleanup, bfd_elfNN_bfd_free_cached_info):
276 Remove. Adjust all users.
277
8b21361b
SP
2782020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
279
280 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Set LSB for C64 symbols.
281 (elfNN_aarch64_output_map_sym, elfNN_aarch64_output_stub_sym):
282 Initialise st_target_internal.
283 (aarch64_elfNN_swap_symbol_in, aarch64_elfNN_swap_symbol_out):
284 New functions.
285 (elfNN_aarch64_size_info): Add them as callbacks.
286
3979cf50
SP
2872020-10-20 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
288
289 * cpu-aarch64.c (bfd_is_aarch64_special_symbol_name): Add
290 capability mapping symbol.
291 * elfnn-aarch64.c (elfNN_aarch64_output_map_sym,
292 is_aarch64_mapping_symbol): Likewise.
293
51a8a7c2
NC
2942020-10-16 Nelson Chu <nelson.chu@sifive.com>
295
296 * elfnn-riscv.c (riscv_elf_link_hash_table): Add last_iplt_index.
297 (riscv_elf_size_dynamic_sections): Initialize the last_iplt_index.
298 (riscv_elf_relocate_section): Use riscv_elf_append_rela.
299 (riscv_elf_finish_dynamic_symbol): If the use_elf_append_rela is
300 false, then we should add the dynamic relocs from the last of
301 the .rela.iplt, and don't use the riscv_elf_append_rela to add.
302
02dd9d25
NC
3032020-10-16 Nelson Chu <nelson.chu@sifive.com>
304
305 * elfnn-riscv.c: Include "objalloc.h" since we need objalloc_alloc.
306 (riscv_elf_link_hash_table): Add loc_hash_table and loc_hash_memory
307 for local STT_GNU_IFUNC symbols.
308 (riscv_elf_got_plt_val): Removed.
309 (riscv_elf_local_htab_hash, riscv_elf_local_htab_eq): New functions.
310 Use to compare local hash entries.
311 (riscv_elf_get_local_sym_hash): New function. Find a hash entry for
312 local symbol, and create a new one if needed.
313 (riscv_elf_link_hash_table_free): New function. Destroy an riscv
314 elf linker hash table.
315 (riscv_elf_link_hash_table_create): Create hash table for local ifunc.
316 (riscv_elf_check_relocs): Create a fake global symbol to track the
317 local ifunc symbol. Add support to check and handle the relocations
318 reference to ifunc symbols.
319 (allocate_dynrelocs): Let allocate_ifunc_dynrelocs and
320 allocate_local_ifunc_dynrelocs to handle the ifunc symbols if they
321 are defined and referenced in a non-shared object.
322 (allocate_ifunc_dynrelocs): New function. Allocate space in .plt,
323 .got and associated reloc sections for ifunc dynamic relocs.
324 (allocate_local_ifunc_dynrelocs): Likewise, but for local ifunc
325 dynamic relocs.
326 (riscv_elf_relocate_section): Add support to handle the relocation
327 referenced to ifunc symbols.
328 (riscv_elf_size_dynamic_sections): Updated.
329 (riscv_elf_adjust_dynamic_symbol): Updated.
330 (riscv_elf_finish_dynamic_symbol): Finish up the ifunc handling,
331 including fill the PLT and GOT entries for ifunc symbols.
332 (riscv_elf_finish_local_dynamic_symbol): New function. Called by
333 riscv_elf_finish_dynamic_symbol to handle the local ifunc symbols.
334 (_bfd_riscv_relax_section): Don't do the relaxation for ifunc.
335 * elfxx-riscv.c: Add R_RISCV_IRELATIVE.
336 * configure.ac: Link elf-ifunc.lo to use the generic ifunc support.
337 * configure: Regenerated.
338
e7f2f959
AM
3392020-10-16 Alan Modra <amodra@gmail.com>
340
341 * elf32-arc.c (replace_func): Correct return type.
342 (get_replace_function): Use a replace_func function pointer rather
343 than void*. Update associated ARC_RELOC_HOWTO define.
344
db75b8f7
AM
3452020-10-16 Alan Modra <amodra@gmail.com>
346
347 * elf32-cr16.c: Formatting.
348 (cr16_elf_final_link_relocate): Sign extend rather than clumsy
349 "add or subtract" of offset value. Simplify range checks. Move
350 common code out of "if" branches. Don't refetch insn fields
351 needlessly.
352
fba8689a
AM
3532020-10-16 Alan Modra <amodra@gmail.com>
354
355 * elf64-ppc.c (ppc64_elf_relocate_section): Tighten sanity check
356 on R_PPC64_GOT_LO_DS and R_PPC64_GOT_HA instructions.
357
fa40fbe4
AM
3582020-10-09 Alan Modra <amodra@gmail.com>
359
360 * elf64-ppc.c (write_plt_relocs_for_local_syms): Don't do local
361 entry offset optimisation.
362
32930e4e
L
3632020-10-09 H.J. Lu <hongjiu.lu@intel.com>
364
365 PR gas/26703
366 * elf-linker-x86.h (elf_linker_x86_params): Add isa_level.
367 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge
368 GNU_PROPERTY_X86_ISA_1_V[234].
369 (_bfd_x86_elf_link_setup_gnu_properties): Generate
370 GNU_PROPERTY_X86_ISA_1_V[234] for -z x86-64-v[234].
371
574df58f
L
3722020-10-06 H.J. Lu <hongjiu.lu@intel.com>
373
374 PR ld/26711
375 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Merge -z ibt
376 and -z shstk only with GNU_PROPERTY_X86_FEATURE_1_AND.
377
6afcdeb3
BB
3782020-10-06 Brandon Bergren <bdragon@FreeBSD.org>
379
380 * config.bfd: Add powerpc64le-*-freebsd*.
381 * configure.ac: Add powerpc_elf64_fbsd_le_vec.
382 * elf64-ppc.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define for
383 freebsd.
384 * targets.c (powerpc_elf64_fbsd_le_vec): Declare.
385 (_bfd_target_vector): Add it.
386 * configure: Regenerate.
387
c0b31344
NC
3882020-10-05 Kamil Rytarowski <n54@gmx.com>
389
390 * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
391
b71702f1
NC
3922020-10-05 Nick Clifton <nickc@redhat.com>
393
394 PR 26253
395 * elf.c (_bfd_elf_setup_sections): Do not complain about an
396 sh_link value of zero when the SLF_LINK_ORDER flag is set.
397 (assign_section_numbers): Likewise.
398
7026832e
L
3992020-10-02 H.J. Lu <hongjiu.lu@intel.com>
400
401 PR 26681
402 * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
403 sections which are linked to another section.
404
394e9bf6
PW
4052020-09-28 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
406
407 * cpu-arm.c: (processors) Add Cortex-X1.
408
12cf8b93
AM
4092020-09-28 Alan Modra <amodra@gmail.com>
410
411 PR 26656
412 * elf64-ppc.c (ppc_build_one_stub, ppc_size_one_stub): Check for
413 NULL stub_entry->h before calling is_tls_get_addr.
414
3cd7c7d7
AM
4152020-09-26 Alan Modra <amodra@gmail.com>
416
417 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Depend on has_plt_localentry0.
418 (LD_R0_0R11, ADD_R11_R0_R11): Define.
419 (ppc64_elf_tls_setup): Disable params->plt_localentry0 when power10
420 code detected.
421 (ppc64_elf_size_stubs): Update __glink_PLTresolve eh_frame.
422 (ppc64_elf_build_stubs): Move r2 save to start of __glink_PLTresolve,
423 and only emit for has_plt_localentry0. Don't use r2 in the stub.
424
29433886
AM
4252020-09-24 Alan Modra <amodra@gmail.com>
426
427 PR 26656
428 * elf64-ppc.c (plt_stub_size): Add "odd" param. Use it with
429 size_power10_offset rather than calculating from start of stub.
430 Add size for notoc tls_get_addr_opt stub.
431 (plt_stub_pad): Add "odd" param, pass to plt_stub_size.
432 (build_tls_get_addr_head, build_tls_get_addr_tail): New functions.
433 (build_tls_get_addr_stub): Delete.
434 (ppc_build_one_stub): Use a temp for htab->params->stub_bfd.
435 Emit notoc tls_get_addr_opt stub. Move eh_frame code to
436 suit. Adjust code to use bfd_tls_get_addr_head/tail in place
437 of build_tls_get_addr_stub.
438 (ppc_size_one_stub): Size notoc tls_get_addr_opt stub.
439 Adjust plt_stub_size and plt_stub_pad calls. Correct "odd"
440 when padding stub. Size eh_frame for notoc stub too.
441 Correct lr_restore value.
442 (ppc64_elf_relocate_section): Don't skip over first insn of
443 notoc tls_get_addr_opt stub.
444
c9405344
AM
4452020-09-24 Alan Modra <amodra@gmail.com>
446
447 PR 26655
448 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to..
449 (ppc64_elf_edit): Call params->edit.
450 (ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a
451 bfd_boolean.
452 * elf64-ppc.h (struct ppc64_elf_params): Add "edit".
453 (ppc64_elf_tls_setup): Update declaration.
454
b1b11e92
AM
4552020-09-21 Alan Modra <amodra@gmail.com>
456
457 PR 26569
458 * elfxx-riscv.c (howto_table): Correct size and bitsize of
459 R_RISCV_RVC_BRANCH, R_RISCV_RVC_JUMP, and R_RISCV_RVC_LUI.
460 Correct size for R_RISCV_TLS_DTPMOD32, R_RISCV_TLS_DTPREL32,
461 R_RISCV_CALL, and R_RISCV_CALL_PLT. Make R_RISCV_TPREL_ADD and
462 R_RISCV_ALIGN like R_RISCV_NONE. Correct dst_mask many relocs.
463
dd80eb2c
MP
4642020-09-17 Mikael Pettersson <mikpelinux@gmail.com>
465
466 PR ld/18808
467 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC
468 relocations in debug sections, change abort to _bfd_error_handler.
469
36068e2f
L
4702020-09-16 H.J. Lu <hongjiu.lu@intel.com>
471
472 PR ld/26583
473 * config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec
474 to x86_64_pei_vec.
475 * reloc.c: Include "coff/internal.h".
476 (bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.
477
c1229f84
AM
4782020-09-16 Alan Modra <amodra@gmail.com>
479
480 * elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter.
481 * elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data),
482 (swap_out_syms): Adjust elf_symbol_from invocation.
483
ec74481d
AM
4842020-09-16 Alan Modra <amodra@gmail.com>
485
486 PR 26623
487 * elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
488
ec6653d8
L
4892020-09-15 H.J. Lu <hongjiu.lu@intel.com>
490
491 * coff-x86_64.c (howto_table): Display PE relocation names.
492
4a8f181d
HPN
4932020-09-15 Hans-Peter Nilsson <hp@axis.com>
494
495 PR ld/26589
496 * elf32-cris.c (cris_elf_check_relocs): Add missing NULL check
497 on argument before calling UNDEFWEAK_NO_DYNAMIC_RELOC.
498
496afd17
L
4992020-09-12 H.J. Lu <hongjiu.lu@intel.com>
500
501 PR ld/26391
502 * elflink.c (elf_final_link_info): Add local_hash_table.
503 (local_hash_entry): New.
504 (local_hash_newfunc): Likewise.
505 (elf_link_output_symstrtab): Append ".COUNT" to duplicated local
506 symbols.
507 (bfd_elf_final_link): Initialize and free local_hash_table for
508 "-z unique-symbol".
509
c7cd2917
SP
5102020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
511
512 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
513 changes in 7e05773767820b441b23a16628b55c98cb1aef46. Set
514 error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
515 BFD_RELOC_AARCH64_TSTBR14 relocations.
516
10556cdc
NC
5172020-09-09 Nick Clifton <nickc@redhat.com>
518
519 * cofflink.c (coff_link_check_archive_element): Move the check for
520 coff type input to the start of the function.
521
47485a31
AM
5222020-09-09 Alan Modra <amodra@gmail.com>
523
524 * libbfd-in.h (_bfd_write_unsigned_leb128): Declare.
525 * libbfd.h: Regenerate.
526
7d81bc93 5272020-09-08 Jozef Lawrynowicz <jozef.l@mittosystems.com>
47485a31 528 Kuan-Lin Chen <kuanlinchentw@gmail.com>
7d81bc93
JL
529
530 * bfd-in2.h (bfd_reloc_code_real): Add
531 BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
532 * elf32-msp430.c (msp430_elf_ignore_reloc): New.
533 (elf_msp430_howto_table): Add R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
534 (msp430_reloc_map): Add R_MSP430_GNU_{SET,SUB}_ULEB128.
535 (msp430x_reloc_map): Add R_MSP430X_GNU_{SET,SUB}_ULEB128.
536 (write_uleb128): New.
537 (msp430_final_link_relocate): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
538 * libbfd.c (_bfd_write_unsigned_leb128): New.
539 * libbfd.h (_bfd_write_unsigned_leb128): New prototype.
540 Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
541 * reloc.c: Document BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
542
95830c98
AC
5432020-09-08 Alex Coplan <alex.coplan@arm.com>
544
545 * archures.c (bfd_mach_aarch64_8R): New.
546 * bfd-in2.h: Regenerate.
547 * cpu-aarch64.c (bfd_aarch64_arch_v8_r): New.
548 (bfd_aarch64_arch_ilp32): Update tail pointer.
549
7ba11550
AM
5502020-09-08 Alan Modra <amodra@gmail.com>
551
552 PR 13250
553 PR 26580
554 * elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**.
555 Return oldbfd in override when old common should override new
556 common.
557 (_bfd_elf_add_default_symbol): Adjust to suit.
558 (elf_link_add_object_symbols): Likewise. Pass "override" to
559 _bfd_generic_link_add_one_symbol. Save and restore common u.c.p
560 field for --as-needed shared libraries. Revert pr13250 changes.
561
b5ffa918
NC
5622020-09-08 Nick Clifton <nickc@redhat.com>
563
564 * plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
565 unrecognized symbol type in a weak definition.
566
8642dafa
AM
5672020-09-04 Alan Modra <amodra@gmail.com>
568
569 PR 26574
570 * elfcode.h (elf_object_p): Sanity check section header offset.
571 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
572 sh_entsize.
573
1e3b96fd
AM
5742020-09-04 Alan Modra <amodra@gmail.com>
575
576 PR 15146
577 PR 26314
578 PR 26530
579 * elflink.c (elf_link_add_object_symbols): Do set def_regular
580 and ref_regular for IR symbols. Don't clear dynsym, allowing
581 IR symbols to load --as-needed shared libraries, but prevent
582 IR symbols from becoming dynamic.
583
ac267c75
NC
5842020-09-03 Nick Clifton <nickc@redhat.com>
585
586 PR 26521
587 * elf.c (_bfd_elf_write_secondary_reloc_section): Check for
588 secondary reloc sections with a zero sh_entsize field.
589
9184ef8a
NC
5902020-09-03 Nelson Chu <nelson.chu@sifive.com>
591
592 * elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
593 (riscv_merge_std_ext): Likewise.
594 (riscv_merge_arch_attr_info): Likewise.
595 (riscv_merge_attributes): Likewise and fix comment typos.
596
32f0ce4d
NC
5972020-09-03 Nelson Chu <nelson.chu@sifive.com>
598
599 * elfnn-riscv.c (riscv_version_mismatch): Change the return type
600 from void to bfd_boolean. Report warnings rather than errors
601 when the ISA versions are mis-matched. Afterwards, remember to
602 update the output ISA versions to the newest ones.
603 (riscv_merge_std_ext): Allow to link objects with different
604 standard ISA versions. Try to add output ISA versions to
605 merged_subsets first.
606 (riscv_merge_multi_letter_ext): Likewise. But for standard additional
607 ISA and non-standard ISA versions.
608
72bd6912
KC
6092020-09-03 Kito Cheng <kito.cheng@sifive.com>
610
611 * elfnn-riscv.c (riscv_merge_std_ext): Fix to report the correct
612 error message when the versions of extension are mis-matched.
613 * elfxx-riscv.c (riscv_parse_subset): Don't issue the error when
614 the string is empty.
615
d48b742b
AM
6162020-09-03 Alan Modra <amodra@gmail.com>
617
618 * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info
619 on the output bfd objalloc memory.
620
26009aa7
AM
6212020-09-02 Alan Modra <amodra@gmail.com>
622
623 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Correct type
624 of constant shifted left.
625
2f26cc79
AM
6262020-09-02 Alan Modra <amodra@gmail.com>
627
628 * elf32-pru.c (pru_elf32_do_ldi32_relocate): Use an unsigned
629 type for "relocation".
630
821e059c
AM
6312020-09-01 Alan Modra <amodra@gmail.com>
632
633 * reloc.c (N_ONES): Handle N=0.
634 * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
635 for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
636
f911bb22
AM
6372020-09-01 Alan Modra <amodra@gmail.com>
638
639 PR 26429
640 * elf32-arm.c (elf32_arm_allocate_local_sym_info): Allocate arrays
641 in descending order of alignment.
642
00c91124
AM
6432020-09-01 Alan Modra <amodra@gmail.com>
644
645 PR 26423
646 * elf32-arm.c (calculate_group_reloc_mask): Use 3u in shift.
647
1174d920
AM
6482020-08-31 Alan Modra <amodra@gmail.com>
649
650 PR 26493
651 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to
652 unsigned when using with RISCV_ITYPE.
653 (_bfd_riscv_relax_call): Use an unsigned foff.
654
227d539b
AM
6552020-08-31 Alan Modra <amodra@gmail.com>
656
657 PR 26476
658 PR 26477
659 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO),
660 (CRINFO_RELVADDR): Make unsigned.
661 (mips_elf_nullify_got_load): Use unsigned constant when shifting
662 into sign bit.
663
1a211fc7
AM
6642020-08-31 Alan Modra <amodra@gmail.com>
665
666 PR 26466
667 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u"
668 variable and rewrite signed overflow check.
669 * elf32-mep.c: Regenerate.
670 (mep_final_link_relocate): Delete "s".
671
108f6f97
AM
6722020-08-31 Alan Modra <amodra@gmail.com>
673
674 PR 26461
675 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned
676 that might shift values into sign bit.
677
f2173852
AM
6782020-08-31 Alan Modra <amodra@gmail.com>
679
680 PR 26445
681 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma,
682 and similarly for variables dealing with overflow.
683
c1f138f9
AM
6842020-08-31 Alan Modra <amodra@gmail.com>
685
686 PR 26442
687 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits
688 without undefined behaviour. Tidy excess casts.
689
8f383897
AM
6902020-08-31 Alan Modra <amodra@gmail.com>
691
692 * elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate
693 alignment from reloc addend after reloc type R_MN10300_ALIGN is
694 found.
695
34d8e6d0
AM
6962020-08-30 Alan Modra <amodra@gmail.com>
697
698 PR 26435
699 PR 26436
700 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits
701 without undefined behaviour.
702
e6f04d55
NC
7032020-08-29 Nick Clifton <nickc@redhat.com>
704
705 PR 26520
706 * dwarf2.c (scan_unit_for_symbols): Add member entries to the
707 variable table.
708
736c9875
AM
7092020-08-29 Alan Modra <amodra@gmail.com>
710
55b8e31a 711 PR 26459
736c9875
AM
712 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last
713 element when count is zero. bfd_realloc when shrinking.
714
07319acc
AM
7152020-08-28 Alan Modra <amodra@gmail.com>
716
717 PR 26418
718 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write
719 zero size buffers.
720
7ca371db
AM
7212020-08-28 Alan Modra <amodra@gmail.com>
722
723 PR 26418
724 * ecofflink.c (WRITE): Really don't write zero size chunks.
725
1e597a89
T
7262020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
727
728 PR 26543
729 * linker.c (bfd_generic_define_common_symbol): Force the alignment
730 to 1 if the section has now alignment requirement.
731
0861f561
CQ
7322020-08-28 Cooper Qu <cooper.qu@linux.alibaba.com>
733
734 * elf32-csky.c (csky_archs): Fix arch names.
735 (csky_find_arch_with_name): New.
736 (elf32_csky_merge_attributes): New.
737 (csky_elf_merge_private_bfd_data): Add process of merge
738 attribute section.
739 (elf32_csky_obj_attrs_arg_type): New.
740 (elf32_csky_obj_attrs_handle_unknown): New.
741 (elf_backend_obj_attrs_vendor): Define.
742 (elf_backend_obj_attrs_section): Define.
743 (elf_backend_obj_attrs_arg_type): Define.
744 (elf_backend_obj_attrs_section_type): Define.
745
6194b866
NC
7462020-08-28 Nick Clifton <nickc@redhat.com>
747
748 PR19011
749 * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value
750 for undefined symbols which will not generate extra warning
751 messages about truncated relocs.
752
3b1450b3
NC
7532020-08-28 Nelson Chu <nelson.chu@sifive.com>
754
755 * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL
756 and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs.
757 (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the
758 unresolved reloc checks.
759
9e7ed8b0
JDA
7602020-08-27 John David Anglin <danglin@gcc.gnu.org>
761
762 PR 26356
763 * som.c (som_bfd_copy_private_section_data): Issue error when a
764 subspace is specified without its containing space.
765
4b69ce9b
AM
7662020-08-27 Alan Modra <amodra@gmail.com>
767
768 PR 26469
769 * elflink.c: Include limits.h.
770 (CHAR_BIT): Provide fallback define.
771 (set_symbol_value): Correct complex reloc comment.
772 (undefined_reference): Set bfd_error.
773 (BINARY_OP_HEAD, BINARY_OP_TAIL): Split out from..
774 (BINARY_OP): ..this.
775 (eval_symbol): Limit shifts. Force unsigned for left shift.
776 Catch divide by zero.
777 * configure.ac (AC_CHECK_HEADERS): Combine, sort and add limits.h.
778 * configure: Regenerate.
779 * config.in: Regenerate.
780
cd570d49
AM
7812020-08-27 Alan Modra <amodra@gmail.com>
782
783 PR 26462
784 * reloc.c (bfd_check_overflow): Return early if zero bitsize.
785
2ac865ac
AM
7862020-08-27 Alan Modra <amodra@gmail.com>
787
788 * elf32-arm.c (elf32_arm_final_link_relocate): Don't segfault
789 on sym_sec not being output.
790
c415c83b
AM
7912020-08-27 Alan Modra <amodra@gmail.com>
792
793 PR 26416
794 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Correct "dynamic".
795
b74a6c60
NC
7962020-08-26 Nick Clifton <nickc@redhat.com>
797
8c51f2f2
NC
798 PR 26433
799 * elf32-avr.c (avr_final_link_relocate): Fix undefined shift
800 behaviour.
801 (avr_elf32_load_records_from_section): Use bfd_get_16 and
802 bfd_get_32 to load values from potentially unaligned pointers.
803
eae0b5c3
NC
804 PR 26416
805 * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Test for and
806 ignore local symbols.
807 (elf64_alpha_relax_got_load): Do not check for local dynamic
808 symbols.
809 (OP_LDA, OP_LDAH, OP_LDQ, OP_BR, OP_BSR): Use unsigned constant
810 values.
811 (INSN_A) Cast the A parameter to unsigned.
812 (INSN_AB): Define in terms of INSN_A.
813 (INSN_ABC): Likewise.
814 (INSN_ABO): Likewise.
815 (INSN_AD): Likewise.
816
b74a6c60
NC
817 PR 26411
818 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use an
819 unsigned long constant when creating a mask to test for alignment
820 issues.
821
4d430725
AM
8222020-08-26 Alan Modra <amodra@gmail.com>
823
824 PR 26507
825 * elf32-xtensa.c (find_removed_literal): Don't bsearch empty map.
826
252e57fd
AM
8272020-08-26 Alan Modra <amodra@gmail.com>
828
829 PR 26506
830 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early
831 when section is empty.
832
2d0ce677
AM
8332020-08-26 Alan Modra <amodra@gmail.com>
834
835 PR 26498
836 * elf32-spu.c (find_function_stack_adjust): Use unsigned vars to
837 avoid UB left shift.
838
9e51d549
AM
8392020-08-26 Alan Modra <amodra@gmail.com>
840
841 PR 26484
842 PR 26485
843 PR 26486
844 PR 26487
845 PR 26488
846 PR 26490
847 * elf64-ppc.c (is_tls_get_addr): Avoid UB &h->elf when h is NULL.
848 (ppc64_elf_tls_setup): Likewise.
849 (branch_reloc_hash_match): Likewise.
850 (build_plt_stub): Likewise.
851 (ppc64_elf_relocate_section): Likewise.
852
00bc5e68
AM
8532020-08-26 Alan Modra <amodra@gmail.com>
854
855 PR 26478
856 * mmo.c (mmo_write_symbols_and_terminator): Don't memcpy empty table.
857
55e61b8a
AM
8582020-08-26 Alan Modra <amodra@gmail.com>
859
860 PR 26475
861 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Check
862 sstubs->contents != NULL.
863
66ad6b44
AM
8642020-08-26 Alan Modra <amodra@gmail.com>
865
866 PR 26453
867 * som.c (som_prep_for_fixups): Return early when no symbols.
868
9863cbb7
AM
8692020-08-26 Alan Modra <amodra@gmail.com>
870
871 PR 26418
872 * ecofflink.c (WRITE): Don't write size 0 chunks.
873
c01de193
AM
8742020-08-26 Alan Modra <amodra@gmail.com>
875
876 * bfdio.c (bfd_get_file_size): Don't segv on NULL adata.
877
b4e125d9
AM
8782020-08-26 Alan Modra <amodra@gmail.com>
879
880 PR 26415
881 * vms-misc.c (vms_time_t_to_vms_time): Don't use unsigned short vars.
882
4449c81a
DF
8832020-08-26 David Faust <david.faust@oracle.com>
884
885 * archures.c (bfd_mach_xbpf): Define.
886 * bfd-in2.h: Regenerate.
887 * cpu-bpf.c (bfd_xbpf_arch) New.
888 (bfd_bpf_arch) Update next in list field to point to xbpf arch.
889
13f8a246
AM
8902020-08-26 Alan Modra <amodra@gmail.com>
891
892 * archures.c (bfd_mach_ck860): Define.
893
c3757b58
MW
8942020-08-25 Mark Wielaard <mark@klomp.org>
895
896 * dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
897 and dwarf_rnglists_size fields.
898 (dwarf_debug_sections): Add debug_rnglists.
899 (dwarf_debug_section_enum): Likewise.
900 (read_debug_rnglists): New function.
901 (read_rangelist): New function to call either read_ranges or
902 read_rnglists. Rename original function to...
903 (read_ranges): ...this.
904 (read_rnglists): New function.
905
1ab8d928
AM
9062020-08-25 Alan Modra <amodra@gmail.com>
907
908 PR 26505
909 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check
910 is_elf_hash_table before accessing elf fields.
911
a93ba4c0
AM
9122020-08-25 Alan Modra <amodra@gmail.com>
913
914 PR 26482
915 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
916 won't be output.
917
1438dd86
AM
9182020-08-25 Alan Modra <amodra@gmail.com>
919
920 PR 26463
921 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
922 before accessing elf fields.
923
2186273a
AM
9242020-08-25 Alan Modra <amodra@gmail.com>
925
926 PR 26452
927 * som.c (som_compute_checksum): XOR 32-bit words in header,
928 not unsigned long sized words.
929
0c1438eb
AM
9302020-08-25 Alan Modra <amodra@gmail.com>
931
932 PR 26430
933 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
934 amount copied for elf_segment_map defined with one element
935 sections array.
936
d2327e47
AM
9372020-08-25 Alan Modra <amodra@gmail.com>
938
939 PR 26422
940 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
941 bfd_get_x size function to read addends out of fields. Apply
942 rightshift adjustment too. Don't apply the now unnecessary
943 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
944 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
945 Correct R_ARM_THM_JUMP6 addend.
946
b8ff233b
AM
9472020-08-25 Alan Modra <amodra@gmail.com>
948
949 PR 26419
950 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
951 before start of section.
952
0f55320b
AM
9532020-08-25 Alan Modra <amodra@gmail.com>
954
955 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
956 before accessing elf_hash_table_id.
957 * elf32-arc.c (elf_arc_hash_table): Likewise.
958 * elf32-arm.c (elf32_arm_hash_table): Likewise.
959 * elf32-avr.c (avr_link_hash_table): Likewise.
960 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
961 * elf32-cris.c (elf_cris_hash_table): Likewise.
962 * elf32-csky.c (csky_elf_hash_table): Likewise.
963 * elf32-frv.c (frvfdpic_hash_table): Likewise.
964 * elf32-hppa.c (hppa_link_hash_table): Likewise.
965 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
966 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
967 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
968 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
969 * elf32-metag.c (metag_link_hash_table): Likewise.
970 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
971 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
972 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
973 * elf32-s390.c (elf_s390_hash_table): Likewise.
974 * elf32-sh.c (sh_elf_hash_table): Likewise.
975 * elf32-spu.c (spu_hash_table): Likewise.
976 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
977 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
978 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
979 * elf64-hppa.c (hppa_link_hash_table): Likewise.
980 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
981 * elf64-s390.c (elf_s390_hash_table): Likewise.
982 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
983 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
984 * elfxx-mips.c (mips_elf_hash_table): Likewise.
985 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
986 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
987
3cdad084
JT
9882020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
989
990 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
991 int. Use '%u' format with _bfd_error_handler to render it.
992
918dc783
AM
9932020-08-25 Alan Modra <amodra@gmail.com>
994
995 PR 26489
996 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
997 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
998
573eb292
AM
9992020-08-25 Alan Modra <amodra@gmail.com>
1000
1001 PR 26492
1002 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
1003 accessing elf_hash_table_id.
1004
a8d549c0
AM
10052020-08-25 Alan Modra <amodra@gmail.com>
1006
1007 PR 26483
1008 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
1009 accessing elf_hash_table_id.
1010
19d80e5f
MW
10112020-08-24 Mark Wielaard <mark@klomp.org>
1012
1013 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
1014 (read_formatted_entries): Likewise. And skip zero entry.
1015
531c73a3
CQ
10162020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
1017
1018 * bfd-in2.h (bfd_mach_ck860): New.
1019 * cpu-csky.c (arch_info_struct): Add item for CK860.
1020
252dcdf4
AM
10212020-08-24 Alan Modra <amodra@gmail.com>
1022
1023 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
1024 high part tprel16 relocs.
1025 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
1026 Clear do_tls_opt on odd instructions.
1027 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
1028 Don't sanity check them here.
1029 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
1030 high part tprel16 relocs.
1031 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
1032 Clear do_tls_opt on odd instructions.
1033 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
1034
c40e6650
JDA
10352020-08-23 John David Anglin <danglin@gcc.gnu.org>
1036
1037 PR binutils/26357
1038 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
1039 * configure: Regenerate.
1040
3f2e9699
L
10412020-08-22 H.J. Lu <hongjiu.lu@intel.com>
1042
1043 PR ld/26382
1044 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
1045 versioned symbols, which are defined in shared objects, in
1046 symbol string table.
1047
ccf61261
NC
10482020-08-21 Nick Clifton <nickc@redhat.com>
1049
1050 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
1051 the data map if there are entries in it.
1052 (_bfd_aarch64_erratum_843419_scan): Likewise.
1053
610ed3e0
JB
10542020-08-21 Jan Beulich <jbeulich@suse.com>
1055
1056 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
1057 last byte of debug dir, not first.
1058
01147b20
NC
10592020-08-20 Nick Clifton <nickc@redhat.com>
1060
1061 PR 26428
1062 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
1063 field in the ELF header of the compressed sections.
1064
44466e45
NC
10652020-08-20 Nick Clifton <nickc@redhat.com>
1066
1067 PR 26406
1068 * elf-bfd.h (struct bfd_elf_section_data): Add
1069 has_secondary_relocs field.
1070 * elf.c (_bfd_elf_copy_special_section_fields): Set the
1071 has_secondary_relocs field for sections which have associated
1072 secondary relocs.
1073 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
1074 on sections which have associated secondary relocs.
1075
10885e24
AM
10762020-08-15 Alan Modra <amodra@gmail.com>
1077
1078 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
1079 small common section.
1080 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
1081 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
1082 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
1083 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
1084 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
1085 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
1086 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
1087 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
1088 * elf32-v850.c (v850_elf_check_relocs): Likewise.
1089 (v850_elf_add_symbol_hook): Likewise.
1090 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
1091 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
1092 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
1093 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
1094
4d182367
AM
10952020-08-15 Alan Modra <amodra@gmail.com>
1096
1097 PR 26389
1098 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
1099 SEC_SMALL_DATA.
1100 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
1101 on small common section.
1102 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
1103 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
1104 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
1105 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
1106 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
1107 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
1108
19bddbe9
AM
11092020-08-14 Alan Modra <amodra@gmail.com>
1110
1111 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
1112 rather than another copy of primes. Increase maximum default
1113 size allowed.
1114
2b6ba032
AM
11152020-08-13 Alan Modra <amodra@gmail.com>
1116
73d0dc16 1117 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
2b6ba032 1118
6738c8a7
AM
11192020-08-13 Alan Modra <amodra@gmail.com>
1120
1121 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
1122 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
1123 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
1124 optimization when --no-pcrel-optimize.
1125
75e100a3
AM
11262020-08-13 Alan Modra <amodra@gmail.com>
1127
1128 PR 26348
1129 * bfd.c (struct bfd): Add read_only.
1130 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
1131 Set read_only on warning.
1132 (elf_object_p): Sanity check program header alignment. Set
1133 read_only on warning.
1134 * bfd-in2.h: Regenerate.
1135
2fef9373
JT
11362020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
1137
1138 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
1139 win32pstatus note type to avoid signedness comparison warning.
1140
404ec933
JT
11412020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
1142
1143 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
1144 win32pstatus notes, and return TRUE so we continue rather than
1145 stopping as if it was an error.
1146
d61f3d03
JT
11472020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1148
1149 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
1150
04ec0fa2
JT
11512020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1152
1153 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
1154 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
1155 appropriate size constraint for each win32pstatus note type.
1156
03c29a6f
JT
11572020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1158
1159 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
1160 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
1161 win32pstatus note.
1162
8fbac78b
JT
11632020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
1164
1165 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
1166 (elfcore_grok_win32pstatus): Use.
1167
ff2084b9
JT
11682020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
1169
1170 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
1171 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
1172 offsets used to read NOTE_INFO_PROCESS.
1173
79ddc884
NC
11742020-08-12 Nick Clifton <nickc@redhat.com>
1175
1176 * po/ru.po: Updated Russian translation.
1177 * po/sr.po: Updated Serbian translation.
1178
d844f10a
DF
11792020-08-07 David Faust <david.faust@oracle.com>
1180
1181 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
1182 DISP16 and DISP32 relocations.
1183
3ee9565c
DF
11842020-08-05 David Faust <david.faust@oracle.com>
1185
1186 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
1187 (bpf_elf_howto_table): Use it here.
1188 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
1189 instruction and data relocations.
1190
e44a1d7b
AM
11912020-08-03 Alan Modra <amodra@gmail.com>
1192
1193 * vms-lib.c (vms_traverse_index): Sanity check size remaining
1194 before accessing vms_idx or vms_elfidx.
1195
b5f386d5
AM
11962020-08-03 Alan Modra <amodra@gmail.com>
1197
1198 PR 26330
1199 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
1200 size against file size. Correct LONG_MAX limit check.
1201 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
1202 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
1203 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1204 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
1205 bfd_malloc_and_get_section.
1206
a896df97
AM
12072020-07-31 Alan Modra <amodra@gmail.com>
1208
1209 PR 26314
1210 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
1211 IR symbols to become dynamic.
1212 (elf_link_add_object_symbols): Don't exclude IR symbols when
1213 deciding whether an as-needed shared library is needed.
1214
4d3bb356
SN
12152020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
1216
1217 PR ld/26312
1218 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
1219 to 0.
1220 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
1221
c8693053
RO
12222020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1223
1224 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
1225 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
1226 Don't define _STRUCTURED_PROC.
1227 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
1228 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
1229 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
1230 * configure, config.in: Regenerate.
1231 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
1232 * Makefile.in, doc/Makefile.in: Regenerate.
1233
f1dfbfdb
L
12342020-07-30 H.J. Lu <hongjiu.lu@intel.com>
1235
1236 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
1237 (elf_link_hash_table): Add sym_cache.
1238 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
1239 (elf32_arm_check_relocs): Updated.
1240 (elf32_arm_size_dynamic_sections): Likewise.
1241 * elf32-bfin.c (bfin_link_hash_table): Removed.
1242 (bfin_link_hash_newfunc): Updated.
1243 (bfin_hash_table): Removed.
1244 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
1245 (csky_elf_check_relocs): Updated.
1246 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
1247 (elf32_hppa_check_relocs): Updated.
1248 * elf32-i386.c (elf_i386_tls_transition): Updated.
1249 (elf_i386_convert_load_reloc): Likewise.
1250 (elf_i386_check_relocs): Likewise.
1251 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
1252 (m32r_elf_hash_table): Updated.
1253 (m32r_elf_link_hash_table_create): Likewise.
1254 (m32r_elf_create_dynamic_sections): Likewise.
1255 (m32r_elf_adjust_dynamic_symbol): Likewise.
1256 (allocate_dynrelocs): Likewise.
1257 (m32r_elf_size_dynamic_sections): Likewise.
1258 (m32r_elf_relocate_section): Likewise.
1259 (m32r_elf_finish_dynamic_symbol): Likewise.
1260 (m32r_elf_check_relocs): Likewise.
1261 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
1262 sym_cache.
1263 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
1264 (elf_m68k_check_relocs): Updated.
1265 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
1266 (elf_metag_check_relocs): Updated.
1267 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
1268 (microblaze_elf_check_relocs): Updated.
1269 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
1270 (nds32_elf_create_dynamic_sections): Likewise.
1271 (nds32_elf_adjust_dynamic_symbol): Likewise.
1272 (nds32_elf_check_relocs): Likewise.
1273 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
1274 srelbss and aym_cache.
1275 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
1276 (nios2_elf32_check_relocs): Updated.
1277 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
1278 (or1k_elf_check_relocs): Updated.
1279 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
1280 (ppc_elf_check_relocs): Updated.
1281 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1282 (elf_s390_check_relocs): Updated.
1283 (elf_s390_finish_dynamic_sections): Likewise.
1284 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
1285 and aym_cache.
1286 (sh_elf_create_dynamic_sections): Updated.
1287 (sh_elf_adjust_dynamic_symbol): Likewise.
1288 (sh_elf_size_dynamic_sections): Likewise.
1289 (sh_elf_check_relocs): Likewise.
1290 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
1291 (elf32_tic6x_check_relocs): Updated.
1292 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
1293 (tilepro_elf_hash_table): Updated.
1294 (tilepro_elf_link_hash_table_create): Likewise.
1295 (tilepro_elf_check_relocs): Likewise.
1296 (tilepro_elf_adjust_dynamic_symbol): Likewise.
1297 (allocate_dynrelocs): Likewise.
1298 (tilepro_elf_size_dynamic_sections): Likewise.
1299 (tilepro_elf_relocate_section): Likewise.
1300 (tilepro_elf_finish_dynamic_symbol): Likewise.
1301 (tilepro_finish_dyn): Likewise.
1302 (tilepro_elf_finish_dynamic_sections): Likewise.
1303 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
1304 (ppc64_elf_before_check_relocs): Updated.
1305 (ppc64_elf_check_relocs): Likewise.
1306 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
1307 (elf_s390_check_relocs): Updated.
1308 (elf_s390_relocate_section): Likewise.
1309 (elf_s390_finish_dynamic_sections): Likewise.
1310 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1311 (elf_x86_64_check_relocs): Likewise.
1312 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1313 sym_cache.
1314 (elfNN_aarch64_check_relocs): Updated.
1315 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
1316 (riscv_elf_check_relocs): Updated.
1317 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
1318 (mips_elf_resolve_got_page_ref): Updated.
1319 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1320 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1321 sym_cache.
1322 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
1323 (tilegx_elf_check_relocs): Updated.
1324 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
1325
c77cb2a0
MR
13262020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1327
1328 * elflink.c (bfd_elf_final_link): Give local symbols a name if
1329 so requested.
1330 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
1331 return TRUE if making ET_REL output.
1332
3f1b17bb
MR
13332020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
1334
1335 * elf-bfd.h (elf_backend_data): Add
1336 `elf_backend_elfsym_local_is_section' member.
1337 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
1338 macro.
1339 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
1340 * elflink.c (bfd_elf_final_link): Use it to determine whether
1341 set the `.symtab' section's `sh_info' value to the index of the
1342 first non-local or non-section symbol.
1343 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
1344 function.
1345 (elf_backend_elfsym_local_is_section): New macro.
1346 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
1347 function.
1348 (elf_backend_elfsym_local_is_section): New macro.
1349
4d68fd75
AM
13502020-07-29 Alan Modra <amodra@gmail.com>
1351
1352 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
1353 defined in excluded sections.
1354
67411cbf
AM
13552020-07-28 Alan Modra <amodra@gmail.com>
1356
1357 * elf.c (assign_section_numbers): Comment. Don't segfault on
1358 discarded sections when setting linked-to section for generic
1359 ELF linker.
1360 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
1361
93fd13c7
AM
13622020-07-27 Alan Modra <amodra@gmail.com>
1363
1364 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
1365 similar as absolute.
1366 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
1367 redefinitions here.
1368
04f096fb
NC
13692020-07-24 Nick Clifton <nickc@redhat.com>
1370
1371 * config.bfd: Move xc16x target to the obsolete list.
1372
5efb6779
KB
13732020-07-22 Kevin Buettner <kevinb@redhat.com>
1374
1375 * binary.c (binary_get_section_contents): Seek using offset
1376 from section's file position.
1377
ea57e509
KB
13782020-07-22 Kevin Buettner <kevinb@redhat.com>
1379
1380 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
04f096fb 1381
1ad2776d
MF
13822020-07-22 Max Filippov <jcmvbkbc@gmail.com>
1383
1384 PR 26246
1385 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
1386 type for the first function argument. Rename pointers to reflect
1387 that they have distinct types.
1388
2f5541f3
AM
13892020-07-20 Alan Modra <amodra@gmail.com>
1390
1391 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
1392
e10a07b3
AM
13932020-07-19 Alan Modra <amodra@gmail.com>
1394
1395 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
1396 (select_alt_stub): New function.
1397 (ppc_get_stub_entry): Use it here.
1398 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
1399 power10_stubs.
1400 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
1401 merge notoc stubs with other varieties when power10_stubs is "auto".
1402 Instead dup the stub hash table entry.
1403 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1404 tests of power10_stubs.
1405
28b80303
AM
14062020-07-15 Alan Modra <amodra@gmail.com>
1407
1408 PR 26239
1409 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
1410
4fd8d585
NC
14112020-07-15 Nick Clifton <nickc@redhat.com>
1412
1413 PR26240
1414 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
1415 check for aux entries that overflow the buufer.
1416
a8a48c75
HPN
14172020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
1418
1419 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
1420 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
1421
e8a83e93
MB
14222020-07-15 Markus Böck <markus.boeck02@gmail.com>
1423 Alan Modra <amodra@gmail.com>
1424
1425 PR 26198
1426 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
1427 objects both before and after normal object files.
1428 * elflink.c (_bfd_elf_section_already_linked): Likewise.
1429
d3b10ee7
AM
14302020-07-10 Alan Modra <amodra@gmail.com>
1431
1432 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
1433 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1434 power10_stubs.
1435 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
1436 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
1437 uses of power10_stubs.
1438
fe49679d
AM
14392020-07-09 Alan Modra <amodra@gmail.com>
1440
1441 * coff-ppc.c: Delete.
1442 * pe-ppc.c: Delete.
1443 * pei-ppc.c: Delete.
1444 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
1445 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
1446 PPCMAGIC code.
1447 (coff_write_object_contents): Remove PPC_PE code.
1448 * config.bfd: Move powerpcle-pe to removed targets.
1449 * configure.ac: Remove powerpc PE entries.
1450 * libcoff-in.h (ppc_allocate_toc_section): Delete.
1451 (ppc_process_before_allocation): Delete.
1452 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
1453 * targets.c: Remove powerpc PE vectors.
1454 * po/SRC-POTFILES.in: Regenerate.
1455 * libcoff.h: Regenerate.
1456 * Makefile.in: Regenerate.
1457 * configure: Regenerate.
1458
7646efdf
NC
14592020-07-09 Nick Clifton <nickc@redhat.com>
1460
1461 * po/fr.po: Updated French translation.
1462
23f5e55e
AM
14632020-07-07 Alan Modra <amodra@gmail.com>
1464
1465 * xcofflink.c (xcoff_mark): Don't mark const sections.
1466 (bfd_xcoff_record_link_assignment): Add FIXME.
1467 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
1468 sections being discarded by linker script.
1469
c8001886
AM
14702020-07-07 Alan Modra <amodra@gmail.com>
1471
1472 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
1473 time, uid, gid and mode for deterministic archive.
1474 (xcoff_write_archive_contents_big): Likewise.
1475
8af7926f
AM
14762020-07-07 Alan Modra <amodra@gmail.com>
1477
1478 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
1479 C_AIX_WEAKEXT.
1480
17550be7
NC
14812020-07-06 Nick Clifton <nickc@redhat.com>
1482
1483 * po/pt.po: Updated Portuguese translation.
1484 * po/uk.po: Updated Ukranian translation.
1485
b4396c5e
NC
14862020-07-04 Nick Clifton <nickc@redhat.com>
1487
1488 * version.m4: Set version to 2.35.50.
1489 * configure: Regenerate.
1490 * po/bbfd.pot: Regenerate.
1491
b115b9fd
NC
14922020-07-04 Nick Clifton <nickc@redhat.com>
1493
1494 Binutils 2.35 branch created.
1495
33d1369f
AM
14962020-07-01 Alan Modra <amodra@gmail.com>
1497
1498 PR 26188
1499 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
1500 raw syment index before dereferencing.
1501
cc574a35
AM
15022020-07-01 Alan Modra <amodra@gmail.com>
1503
1504 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
1505
3443489c
AM
15062020-07-01 Alan Modra <amodra@gmail.com>
1507
1508 * config.bfd: Obsolete xc16x.
1509
bbd19b19
L
15102020-06-30 H.J. Lu <hongjiu.lu@intel.com>
1511
1512 * archures.c (bfd_mach_i386_nacl): Removed.
1513 (bfd_mach_i386_i386_nacl): Likewise.
1514 (bfd_mach_x86_64_nacl): Likewise.
1515 (bfd_mach_x64_32_nacl): Likewise.
1516 * config.bfd: Remove *-*-nacl* targets.
1517 * configure.ac: Remove x86 NaCl target vectors.
1518 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
1519 (bfd_x64_32_nacl_arch): Likewise.
1520 (bfd_x86_64_nacl_arch): Likewise.
1521 (bfd_i386_nacl_arch): Likewise.
1522 (bfd_x64_32_arch_intel_syntax): Updated.
1523 * elf32-i386.c: Don't include "elf-nacl.h".
1524 (elf_i386_nacl_plt): Removed.
1525 (elf_i386_nacl_plt0_entry): Likewise.
1526 (elf_i386_nacl_plt_entry): Likewise.
1527 (elf_i386_nacl_pic_plt0_entry): Likewise.
1528 (elf_i386_nacl_pic_plt_entry): Likewise.
1529 (elf_i386_nacl_eh_frame_plt): Likewise.
1530 (elf_i386_nacl_plt): Likewise.
1531 (elf32_i386_nacl_elf_object_p): Likewise.
1532 (elf_i386_get_synthetic_symtab): Updated.
1533 (elf_i386_link_setup_gnu_properties): Likewise.
1534 * elf64-x86-64.c: Don't include "elf-nacl.h".
1535 (elf_x86_64_nacl_plt): Removed.
1536 (elf64_x86_64_nacl_elf_object_p): Likewise.
1537 (elf_x86_64_nacl_plt0_entry): Likewise.
1538 (elf_x86_64_nacl_plt_entry): Likewise.
1539 (elf_x86_64_nacl_eh_frame_plt): Likewise.
1540 (elf_x86_64_nacl_plt): Likewise.
1541 (elf32_x86_64_nacl_elf_object_p): Likewise.
1542 (elf_x86_64_get_synthetic_symtab): Updated.
1543 (elf_x86_64_link_setup_gnu_properties): Likewise.
1544 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1545 * targets.c: Remove x86 NaCl target vectors.
1546 * bfd-in2.h: Regenerated.
1547 * configure: Likewise.
1548
a57f74bb
L
15492020-06-29 H.J. Lu <hongjiu.lu@intel.com>
1550
1551 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
1552 _bfd_elf_add_dynamic_tags.
1553
07d22f64
AM
15542020-06-29 Alan Modra <amodra@gmail.com>
1555
1556 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
1557 return value of bfd_bread. Don't read more than requested length.
1558 Sanity check length. Properly terminate file name.
1559
279edac5
AM
15602020-06-29 Alan Modra <amodra@gmail.com>
1561
1562 * arc-got.h: Use C style comments.
1563 * coff-z80.c: Likewise.
1564 * elf32-csky.c: Likewise.
1565 * peXXigen.c: Likewise.
1566 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
1567 code.
1568
85f7484a
PB
15692020-06-26 Pat Bernardi <bernardi@adacore.com>
1570
1571 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
1572 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
1573
ba9b3ef5
AM
15742020-06-26 Alan Modra <amodra@gmail.com>
1575
1576 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
1577 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
1578 (riscv_get_priv_spec_name): Move to..
1579 * cpu-riscv.c: ..here.
1580 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
1581 Use %u to print unsigned numbers.
1582
069057bf
AB
15832020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
1584
1585 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
1586 default architecture.
1587
2c8e3708
L
15882020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1589
1590 PR ld/26083
1591 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
1592 _bfd_elf_add_dynamic_tags.
1593
c679ec98
L
15942020-06-24 H.J. Lu <hongjiu.lu@intel.com>
1595
1596 PR ld/26083
1597 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
1598 _bfd_elf_add_dynamic_tags.
1599
f8b1e5f6
AM
16002020-06-24 Alan Modra <amodra@gmail.com>
1601
1602 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
1603 shifts without undefined behaviour.
1604
3084d7a2
L
16052020-06-23 H.J. Lu <hongjiu.lu@intel.com>
1606
1607 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
1608 dt_jmprel_required.
1609 (_bfd_elf_add_dynamic_tags): New.
1610 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
1611 _bfd_elf_add_dynamic_tags.
1612 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
1613 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
1614 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
1615 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
1616 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
1617 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
1618 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1619 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
1620 Likewise.
1621 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
1622 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
1623 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
1624 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
1625 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
1626 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
1627 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1628 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
1629 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
1630 Likewise.
1631 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
1632 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
1633 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
1634 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1635 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1636 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
1637 Likewise.
1638 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1639 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1640 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
1641 dt_reloc_sz and dt_reloc_ent.
1642 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
1643 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
1644 Likewise.
1645 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
1646 etab.dt_pltgot_required.
1647 (elf32_hppa_size_dynamic_sections): Call
1648 _bfd_elf_add_dynamic_tags.
1649 * elf32-metag.c (elf_metag_link_hash_table_create): Set
1650 etab.dt_pltgot_required.
1651 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
1652 * elf32-sh.c (sh_elf_link_hash_table_create): Set
1653 root.dt_pltgot_required for FDPIC output.
1654 (sh_elf_size_dynamic_sections): Call
1655 _bfd_elf_maybe_vxworks_add_dynamic_tags.
1656 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
1657 elf.dt_pltgot_required.
1658 (elf_xtensa_size_dynamic_sections): Call
1659 _bfd_elf_add_dynamic_tags.
1660 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
1661 root.dt_pltgot_required.
1662 (elf64_hppa_size_dynamic_sections): Call
1663 _bfd_elf_add_dynamic_tags.
1664 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
1665 root.dt_pltgot_required.
1666 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
1667 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
1668 * elflink.c (_bfd_elf_add_dynamic_tags): New.
1669
d768f160
SJ
16702020-06-22 Saagar Jha <saagar@saagarjha.com>
1671
1672 * mach-o.c: Support the new load commands by reading a linkedit
1673 data command for them.
1674
39ff0b81
NC
16752020-06-22 Nelson Chu <nelson.chu@sifive.com>
1676
1677 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
1678 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
1679 (riscv_get_priv_spec_class): Likewise.
1680 (riscv_get_priv_spec_name): Likewise.
1681 (riscv_get_priv_spec_class_from_numbers): New function, convert
1682 the version numbers into string, then call riscv_get_priv_spec_class
1683 to get the priv spec class.
1684 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
1685 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
1686 (riscv_get_priv_spec_name): Likewise.
1687 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
1688 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
1689 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
1690 of input and output objects form their priv spec attributes by
1691 riscv_get_priv_spec_class_from_numbers. Report warning rather than
1692 errors when linking objects with differnet priv spec versions. We do
1693 know v1.9.1 may have conflicts to other versions, so report the
1694 warning, too. After that, update the output priv spec version to the
1695 newest one so far.
1696
cbd7581f
NC
16972020-06-22 Nelson Chu <nelson.chu@sifive.com>
1698
1699 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
1700 priv attributes, we will check the conflicts for all of them (major,
1701 minor and revision), and then set the priv_attrs_merged to TRUE to
1702 indicate that we have handled all of the priv attributes. Remove
1703 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
1704
1e927850
AM
17052020-06-21 Alan Modra <amodra@gmail.com>
1706
1707 PR 26132
1708 * configure.ac: Disable plugins by default for some targets.
1709 * plugin.c: Comment typo fix.
1710 * configure: Regenerate.
1711
13aa5ceb
NC
17122020-06-19 Nick Clifton <nickc@redhat.com>
1713
1714 * plugin.c (try_load_plugin): Suppress the error message about
1715 being unable to open a plugin if creating a list of viable
1716 plugins.
1717
a435742a
AM
17182020-06-16 Alan Modra <amodra@gmail.com>
1719
1720 * aout-tic30.c: Delete file.
1721 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
1722 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
1723 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
1724 (xc16x-*-elf): Sort properly.
1725 * configure.ac: Remove tic30_aout_vec.
1726 * targets.c: Likewise.
1727 * Makefile.in: Regenerate.
1728 * configure: Regenerate.
1729 * po/SRC-POTFILES.in: Regenerate.
1730
7a77f1ac
MF
17312020-06-15 Max Filippov <jcmvbkbc@gmail.com>
1732
1733 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
1734 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
1735 (elf32xtensa_abi): New global variable.
1736 (xtensa_abi_choice): New function.
1737 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
1738 XSHAL_ABI to select PLT code.
1739
cae64165
RM
17402020-06-15 Roland McGrath <mcgrathr@google.com>
1741
1742 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
1743 field of bfd_link_info.
1744
40be168c
AM
17452020-06-15 Alan Modra <amodra@gmail.com>
1746
1747 * config.bfd: Obsolete powerpcle-*-pe targets.
1748
75cfe082
AM
17492020-06-15 Alan Modra <amodra@gmail.com>
1750
1751 PR 26103
1752 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
1753 symbols that were defined in discarded sections.
1754 * cofflink.c (coff_link_check_archive_element): Likewise.
1755 (coff_link_add_symbols): Set indx to -3 for symbols defined in
1756 discarded sections.
1757 (_bfd_coff_write_global_sym): Don't emit such symbols.
1758 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
1759 libcoff.h: Regenerate.
1760
f0aa3025
AM
17612020-06-11 Alan Modra <amodra@gmail.com>
1762
1763 PR 26107
1764 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
1765
447f6d86
L
17662020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1767
1768 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
1769 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
1770 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
1771 of reltext.
1772
e1b5d517
L
17732020-06-10 H.J. Lu <hongjiu.lu@intel.com>
1774
1775 PR ld/26094
1776 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
1777 Clear verinfo.verdef.
1778
cebd6b8a
L
17792020-06-09 H.J. Lu <hongjiu.lu@intel.com>
1780
1781 PR ld/18801
1782 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
1783 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
1784 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
1785 resolvers.
1786 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
1787 Set ifunc_resolvers if there are FUNC resolvers.
1788 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
1789 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
1790 with elf.ifunc_resolvers.
1791 (write_plt_relocs_for_local_syms): Likewise.
1792 (ppc64_elf_relocate_section): Likewise.
1793 (ppc64_elf_finish_dynamic_sections): Likewise.
1794 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
1795 Updated.
1796 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1797 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
1798 instead of readonly_dynrelocs_against_ifunc.
1799 * elfxx-x86.h (elf_x86_link_hash_table): Remove
1800 readonly_dynrelocs_against_ifunc.
1801
efb2a7b4
AM
18022020-06-09 Alan Modra <amodra@gmail.com>
1803
1804 * elf64-ppc.c (struct ppc_link_hash_table): Delete
1805 maybe_local_ifunc_resolver field.
1806 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
1807 cases where maybe_local_ifunc_resolver was set.
1808 (ppc64_elf_relocate_section): Likewise.
1809 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
1810 error to a warning.
1811
9bcc30e4
L
18122020-06-08 H.J. Lu <hongjiu.lu@intel.com>
1813
1814 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
1815 tlsdesc_got.
1816 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
1817 and dt_tlsdesc_got.
1818 (elf32_arm_size_dynamic_sections): Updated. Clear
1819 root.tlsdesc_plt for DF_BIND_NOW.
1820 (elf32_arm_finish_dynamic_sections): Updated.
1821 (elf32_arm_output_arch_local_syms): Likewise.
1822 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
1823 Clear root.tlsdesc_plt for DF_BIND_NOW.
1824 (nds32_elf_finish_dynamic_sections): Updated.
1825 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
1826 dt_tlsdesc_plt and dt_tlsdesc_got.
1827 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
1828 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
1829 tlsdesc_plt and dt_tlsdesc_got.
1830 (elfNN_aarch64_allocate_dynrelocs): Updated.
1831 (elfNN_aarch64_finish_dynamic_sections): Likewise.
1832 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
1833 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
1834 twice.
1835 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1836 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1837 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1838 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
1839 tlsdesc_got.
1840
845b83d7
L
18412020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1842
1843 * elf32-tic6x.c (elf32_bed): Defined the default to
1844 elf32_tic6x_bed.
1845
9b8a8575
L
18462020-06-07 H.J. Lu <hongjiu.lu@intel.com>
1847
1848 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
1849 plt_rel_sec.
1850 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
1851 root.splt/root.srelplt.
1852 (elf64_hppa_create_dynamic_sections): Likewise.
1853 (elf64_hppa_size_dynamic_sections): Likewise.
1854 (elf64_hppa_finish_dynamic_symbol): Likewise.
1855 (elf_hppa_final_link): Likewise.
1856 (elf_hppa_final_link_relocate): Likewise.
1857
bcab203d
L
18582020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1859
1860 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
1861 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
1862 is_vxworks.
1863
90c14f0c
L
18642020-06-06 H.J. Lu <hongjiu.lu@intel.com>
1865
1866 * elf-bfd.h (elf_target_os): New.
1867 (elf_link_hash_table): Add target_os.
1868 (elf_backend_data): Add target_os.
1869 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
1870 symbian_p and nacl_p.
1871 (create_got_section): Updated.
1872 (elf32_arm_create_dynamic_sections): Likewise.
1873 (arm_type_of_stub): Likewise.
1874 (elf32_arm_create_or_find_stub_sec): Likewise.
1875 (elf32_arm_allocate_plt_entry): Likewise.
1876 (elf32_arm_populate_plt_entry): Likewise.
1877 (elf32_arm_final_link_relocate): Likewise.
1878 (elf32_arm_check_relocs): Likewise.
1879 (allocate_dynrelocs_for_symbol): Likewise.
1880 (elf32_arm_finish_dynamic_symbol): Likewise.
1881 (elf32_arm_finish_dynamic_sections): Likewise.
1882 (elf32_arm_output_plt_map_1): Likewise.
1883 (elf32_arm_output_arch_local_syms): Likewise.
1884 (elf32_arm_add_symbol_hook): Likewise.
1885 (elf32_arm_nacl_link_hash_table_create): Likewise.
1886 (elf32_arm_vxworks_link_hash_table_create): Likewise.
1887 (elf32_arm_symbian_link_hash_table_create): Likewise.
1888 (ELF_TARGET_OS): New.
1889 * elf32-i386.c (elf_i386_arch_bed): Removed.
1890 (elf_backend_arch_data): Likewise.
1891 (elf_i386_solaris_arch_bed): Likewise.
1892 (elf_i386_nacl_arch_bed): Likewise.
1893 (elf_i386_vxworks_arch_bed): Likewise.
1894 (elf_i386_relocate_section): Updated.
1895 (elf_i386_finish_dynamic_sections): Likewise.
1896 (elf_i386_get_synthetic_symtab): Likewise.
1897 (elf_i386_link_setup_gnu_properties): Likewise.
1898 (ELF_TARGET_OS): New.
1899 * elf32-mips.c (ELF_TARGET_OS): New.
1900 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
1901 (ppc_elf_create_got): Updated.
1902 (ppc_elf_create_dynamic_sections): Likewise.
1903 (ppc_elf_check_relocs): Likewise.
1904 (ppc_elf_adjust_dynamic_symbol): Likewise.
1905 (ppc_elf_size_dynamic_sections): Likewise.
1906 (ppc_elf_relocate_section): Likewise.
1907 (ppc_elf_finish_dynamic_sections): Likewise.
1908 (ppc_elf_vxworks_link_hash_table_create): Likewise.
1909 (ELF_TARGET_OS): New.
1910 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
1911 (sh_elf_link_hash_table_create): Updated.
1912 (sh_elf_create_dynamic_sections): Likewise.
1913 (allocate_dynrelocs): Likewise.
1914 (sh_elf_size_dynamic_sections): Likewise.
1915 (sh_elf_relocate_section): Likewise.
1916 (sh_elf_finish_dynamic_symbol): Likewise.
1917 (sh_elf_finish_dynamic_sections): Likewise.
1918 (ELF_TARGET_OS): New.
1919 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1920 Removed.
1921 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1922 (ELF_TARGET_OS): New.
1923 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1924 (elf_x86_64_solaris_arch_bed): Likewise.
1925 (elf_x86_64_nacl_arch_bed): Likewise.
1926 (elf_x86_64_finish_dynamic_sections): Updated.
1927 (elf_x86_64_get_synthetic_symtab): Likewise.
1928 (elf_x86_64_link_setup_gnu_properties): Likewise.
1929 (ELF_TARGET_OS): New.
1930 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1931 target_o.
1932 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1933 (MIPS_ELF_REL_DYN_NAME): Updated.
1934 (ELF_MIPS_GP_OFFSET): Likewise.
1935 (mips_elf_create_local_got_entry): Likewise.
1936 (mips_elf_allocate_dynamic_relocations): Likewise.
1937 (mips_elf_count_got_symbols): Likewise.
1938 (is_gott_symbol): Likewise.
1939 (mips_elf_calculate_relocation): Likewise.
1940 (mips_elf_create_dynamic_relocation): Likewise.
1941 (_bfd_mips_elf_check_relocs): Likewise.
1942 (allocate_dynrelocs): Likewise.
1943 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1944 (mips_elf_lay_out_got): Likewise.
1945 (mips_elf_set_plt_sym_value): Likewise.
1946 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1947 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1948 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1949 (_bfd_mips_elf_final_link): Likewise.
1950 (_bfd_mips_init_file_header): Likewise.
1951 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1952 Likewise.
1953 (allocate_dynrelocs): Likewise.
1954 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1955 (_bfd_sparc_elf_relocate_section): Likewise.
1956 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1957 (sparc_finish_dyn): Likewise.
1958 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1959 * elfxx-target.h (ELF_TARGET_OS): New.
1960 (elfNN_bed): Add ELF_TARGET_OS.
1961 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1962 (_bfd_x86_elf_link_hash_table_create): Likewise.
1963 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1964 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1965 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1966 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1967 * elfxx-x86.h (elf_x86_target_os): Removed.
1968 (elf_x86_backend_data): Likewise.
1969 (get_elf_x86_backend_data): Likewise.
1970 (elf_x86_link_hash_table): Remove target_os.
1971
87c69f97
AM
19722020-06-06 Alan Modra <amodra@gmail.com>
1973
1974 * reloc.c: Rename
1975 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
1976 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
1977 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
1978 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
1979 * elf64-ppc.c: Update throughout for reloc renaming.
1980 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
1981 * libbfd.h: Regenerate.
1982 * bfd-in2.h: Regenerate.
1983
981f1518
L
19842020-06-05 H.J. Lu <hongjiu.lu@intel.com>
1985
8a4ba3a1 1986 PR ld/26080
981f1518
L
1987 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
1988 section.
1989
9c65eeac
NC
19902020-06-05 Nick Clifton <nickc@redhat.com>
1991
1992 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
1993 bug.
1994
41285764
NC
19952020-06-05 Nelson Chu <nelson.chu@sifive.com>
1996
1997 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
1998 priv_may_conflict, in_priv_zero and out_priv_zero to decide
1999 whether the object can be linked according to it's priv
2000 attributes. The object without any priv spec attributes can
2001 be linked with others. If the first input object doesn't contain
2002 any priv attributes, then we need to copy the setting from the
2003 next input one. Also report more detailed error messages to user.
2004
a975c88e
SC
20052020-06-04 Stephen Casner <casner@acm.org>
2006
2007 Extend pdp11-aout symbol table format to accommodate .stab
2008 symbols and implement correct handling of them.
2009
2010 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
2011 (N_STAB, is_stab): Needed new function is_stab to disambiguate
2012 normal vs. .stab symbol table type values, replacing N_STAB mask.
2013 (translate_from_native_sym_flags): Determine correct section for
2014 different .stab types.
2015 (translate_to_native_sym_flags): Leave .stab types intact.
2016 (translate_symbol_table): Error if symbol indicates overlay;
2017 store desc field from .stab symbols.
2018 (write_syms): Output desc field with symbol.
2019 (aout_link_check_ar_symbols): Skip .stab symbols.
2020 (aout_link_add_symbols): Correctly distinguish .stab symbols.
2021 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
2022 (aout_link_write_symbols): Write 0 for desk and ovly fields;
2023 correctly distinguish .stab symbols and select calculate their
2024 section and value; and copy desc and ovly fields from input symbol
2025 to output symbol.
2026
3b9313c4
SC
20272020-06-04 Stephen Casner <casner@acm.org>
2028
2029 * aoutx.h (translate_symbol_table): Comment had external and
2030 internal swapped.
2031 * pdp11.c (translate_symbol_table): Likewise.
2032
add5f777
L
20332020-06-04 H.J. Lu <hongjiu.lu@intel.com>
2034
2035 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
2036 (is_x86_elf): Check elf.hash_table_id instead of target_id.
2037 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
2038
c4b126b8
L
20392020-06-04 H.J. Lu <hongjiu.lu@intel.com>
2040
2041 PR ld/26080
2042 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
2043 in debug section against symbol defined in shared library to 0.
2044 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
2045 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
2046 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
2047 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
2048 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
2049 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
2050 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
2051 * elf32-sh.c (sh_elf_check_relocs): Likewise.
2052 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2053 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
2054 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2055 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2056 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2057 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
2058 reference.
2059 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
2060 there is non-GOT reference.
2061 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
2062 non-alloced sections.
2063
31af1e68
SC
20642020-06-03 Stephen Casner <casner@acm.org>
2065
2066 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
2067
2068 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
2069 files with relocs.
2070 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
2071 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
2072 other size that doesn't qcover the header word.
2073 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
2074 string table, and zero it.
2075 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
2076 message and set bfd_error on finding an invalid name string offset.
2077 (add_to_stringtab): INLINE -> inline
2078 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
2079 bound check.
2080 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
2081 any relocs that could not be recognised.
2082 92744f05809 PR 20929 - Check for relocs without an associated symbol.
2083 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
2084 name exists and is long enough, before attempting to see if it is
2085 for a .o file.
2086 c3864421222 - Correct case for N_SO being the last symbol.
2087 50455f1ab29 PR 20891 - Handle the case where the main file name
2088 and the directory name are both empty.
2089 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
2090 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
2091 range string table offsets.
2092 531336e3a0b PR 20909 - Fix off-by-one error in check for an
cae64165 2093 illegal string offset.
31af1e68
SC
2094 (aout_link_includes_newfunc): Add comment.
2095 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
2096 on unexpected relocation type rather than ASSERT.
2097
d4d8aee3
L
20982020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2099
2100 PR ld/26066
2101 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
2102 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
2103
58ee44ef
L
21042020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2105
2106 PR ld/26066
2107 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
2108 non-alloced sections.
2109
9a689602
L
21102020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2111
2112 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
2113 dynamic relocations for non SEC_ALLOC sections.
2114
0bff7528
GN
21152020-06-03 Gunther Nikl <gnikl@justmail.de>
2116
2117 * aout64.c (BMAGIC, QMAGIC): Do not define.
2118 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
2119 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
2120 to check the file format.
2121 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
2122 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
2123 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
2124
50d03636
L
21252020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2126
2127 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
2128 relocations for non SEC_ALLOC sections.
2129
d49e5065
L
21302020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2131
2132 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
2133 * elf32-arm.c (maybe_set_textrel): Removed.
2134 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
2135 with _bfd_elf_maybe_set_textrel.
2136 * elf32-csky.c (maybe_set_textrel): Removed.
2137 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
2138 with _bfd_elf_maybe_set_textrel.
2139 * elf32-hppa.c (maybe_set_textrel): Removed.
2140 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
2141 with _bfd_elf_maybe_set_textrel.
2142 * elf32-lm32.c (maybe_set_textrel): Removed.
2143 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
2144 with _bfd_elf_maybe_set_textrel.
2145 * elf32-m32r.c (maybe_set_textrel): Removed.
2146 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
2147 with _bfd_elf_maybe_set_textrel.
2148 * elf32-metag.c (maybe_set_textrel): Removed.
2149 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
2150 with _bfd_elf_maybe_set_textrel.
2151 * elf32-nds32.c (maybe_set_textrel): Removed.
2152 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
2153 with _bfd_elf_maybe_set_textrel.
2154 * elf32-or1k.c (maybe_set_textrel): Removed.
2155 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
2156 with _bfd_elf_maybe_set_textrel.
2157 * elf32-ppc.c (maybe_set_textrel): Removed.
2158 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
2159 with _bfd_elf_maybe_set_textrel.
2160 * elf32-s390.c (maybe_set_textrel): Removed.
2161 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2162 with _bfd_elf_maybe_set_textrel.
2163 * elf32-sh.c (maybe_set_textrel): Removed.
2164 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
2165 with _bfd_elf_maybe_set_textrel.
2166 * elf32-tic6x.c (maybe_set_textrel): Removed.
2167 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
2168 with _bfd_elf_maybe_set_textrel.
2169 * elf32-tilepro.c (maybe_set_textrel): Removed.
2170 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
2171 with _bfd_elf_maybe_set_textrel.
2172 * elf64-ppc.c (maybe_set_textrel): Removed.
2173 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
2174 with _bfd_elf_maybe_set_textrel.
2175 * elf64-s390.c (maybe_set_textrel): Removed.
2176 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
2177 with _bfd_elf_maybe_set_textrel.
2178 * elfnn-aarch64.c (maybe_set_textrel): Removed.
2179 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
2180 with _bfd_elf_maybe_set_textrel.
2181 * elfnn-riscv.c (maybe_set_textrel): Removed.
2182 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
2183 with _bfd_elf_maybe_set_textrel.
2184 * elfxx-sparc.c (maybe_set_textrel): Removed.
2185 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
2186 with _bfd_elf_maybe_set_textrel.
2187 * elfxx-tilegx.c (maybe_set_textrel): Removed.
2188 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
2189 with _bfd_elf_maybe_set_textrel.
2190 * elfxx-x86.c (maybe_set_textrel): Removed.
2191 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
2192 with _bfd_elf_maybe_set_textrel.
2193 * elflink.c (_bfd_elf_maybe_set_textrel): New.
2194
ad172eaa
L
21952020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2196
2197 PR ld/26067
2198 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
2199 dyn_relocs.
2200 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
2201 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
2202 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
2203 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
2204 Likewise.
2205 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
2206 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
2207 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
2208 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2209 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
2210 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
2211 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
2212 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
2213 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
2214 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2215 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
2216 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2217 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
2218 (elf_backend_copy_indirect_symbol): Likewise.
2219 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
2220 (elf_backend_copy_indirect_symbol): Likewise.
2221 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
2222
5dbc8b37
L
22232020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2224
2225 PR ld/26067
2226 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
2227 * elf32-arm.c (readonly_dynrelocs): Removed.
2228 (maybe_set_textrel): Replace readonly_dynrelocs with
2229 _bfd_elf_readonly_dynrelocs.
2230 * elf32-csky.c (readonly_dynrelocs): Removed.
2231 (maybe_set_textrel): Replace readonly_dynrelocs with
2232 _bfd_elf_readonly_dynrelocs.
2233 * elf32-hppa.c(readonly_dynrelocs): Removed.
2234 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2235 _bfd_elf_readonly_dynrelocs.
2236 (maybe_set_textrel): Likewise.
2237 * elf32-lm32.c (readonly_dynrelocs): Removed.
2238 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2239 with _bfd_elf_readonly_dynrelocs.
2240 (maybe_set_textrel): Likewise.
2241 * elf32-m32r.c (readonly_dynrelocs): Removed.
2242 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2243 with _bfd_elf_readonly_dynrelocs.
2244 (maybe_set_textrel): Likewise.
2245 * elf32-metag.c (readonly_dynrelocs): Removed.
2246 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
2247 with _bfd_elf_readonly_dynrelocs.
2248 (maybe_set_textrel): Likewise.
2249 * elf32-microblaze.c (readonly_dynrelocs): Removed.
2250 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2251 with _bfd_elf_readonly_dynrelocs.
2252 * elf32-nds32.c (readonly_dynrelocs): Removed.
2253 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2254 with _bfd_elf_readonly_dynrelocs.
2255 (maybe_set_textrel): Likewise.
2256 * elf32-or1k.c (readonly_dynrelocs): Removed.
2257 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2258 with _bfd_elf_readonly_dynrelocs.
2259 * elf32-ppc.c (readonly_dynrelocs): Removed.
2260 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2261 _bfd_elf_readonly_dynrelocs.
2262 (ppc_elf_adjust_dynamic_symbol): Likewise.
2263 (maybe_set_textrel): Likewise.
2264 * elf32-s390.c (readonly_dynrelocs): Removed.
2265 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2266 with _bfd_elf_readonly_dynrelocs.
2267 (maybe_set_textrel): Likewise.
2268 * elf32-sh.c (readonly_dynrelocs): Removed.
2269 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
2270 _bfd_elf_readonly_dynrelocs.
2271 (maybe_set_textrel): Likewise.
2272 * elf32-tic6x.c (readonly_dynrelocs): Removed.
2273 (maybe_set_textrel): Replace readonly_dynrelocs with
2274 _bfd_elf_readonly_dynrelocs.
2275 * elf32-tilepro.c (readonly_dynrelocs): Removed.
2276 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2277 with _bfd_elf_readonly_dynrelocs.
2278 (maybe_set_textrel): Likewise.
2279 * elf64-ppc.c (readonly_dynrelocs): Removed.
2280 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
2281 _bfd_elf_readonly_dynrelocs.
2282 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2283 (maybe_set_textrel): Likewise.
2284 * elf64-s390.c (readonly_dynrelocs): Removed.
2285 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
2286 with _bfd_elf_readonly_dynrelocs.
2287 (maybe_set_textrel): Likewise.
2288 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
2289 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
2290 (maybe_set_textrel): Replace readonly_dynrelocs with
2291 _bfd_elf_readonly_dynrelocs.
2292 * elfnn-riscv.c (readonly_dynrelocs): Removed.
2293 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2294 with _bfd_elf_readonly_dynrelocs.
2295 (maybe_set_textrel): Likewise.
2296 * elfxx-sparc.c (readonly_dynrelocs): Removed.
2297 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
2298 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
2299 (maybe_set_textrel): Likewise.
2300 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
2301 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
2302 with _bfd_elf_readonly_dynrelocs.
2303 (maybe_set_textrel): Likewise.
2304 * elfxx-x86.c (readonly_dynrelocs): Removed.
2305 (maybe_set_textrel): Replace readonly_dynrelocs with
2306 _bfd_elf_readonly_dynrelocs.
2307 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
2308
433953ff
L
23092020-06-03 H.J. Lu <hongjiu.lu@intel.com>
2310
2311 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
2312 -fsanitize=undefined.
2313
67580036
AM
23142020-06-03 Alan Modra <amodra@gmail.com>
2315
2316 PR 26069
2317 PR 18758
2318 * peicode.h (pe_ILF_make_a_section): Align data for compilers
2319 other than gcc.
2320 (pe_ILF_build_a_bfd): Likewise.
2321
0ed18fa1
AM
23222020-06-03 Alan Modra <amodra@gmail.com>
2323
7eea15c5 2324 PR 26069
0ed18fa1
AM
2325 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
2326 core files as well as objects.
2327
190eb1dd
L
23282020-06-01 H.J. Lu <hongjiu.lu@intel.com>
2329
2330 PR ld/26067
2331 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
2332 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
2333 Updated.
2334 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
2335 (elf_arc_link_hash_newfunc): Updated.
2336 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
2337 (elf32_arm_link_hash_newfunc): Updated.
2338 (elf32_arm_copy_indirect_symbol): Likewise.
2339 (elf32_arm_check_relocs): Likewise.
2340 (readonly_dynrelocs): Likewise.
2341 (allocate_dynrelocs_for_symbol): Likewise.
2342 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
2343 (csky_elf_link_hash_newfunc): Updated.
2344 (csky_allocate_dynrelocs): Likewise.
2345 (readonly_dynrelocs): Likewise.
2346 (csky_elf_copy_indirect_symbol): Likewise.
2347 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
2348 (hppa_link_hash_newfunc): Updated.
2349 (elf32_hppa_copy_indirect_symbol): Likewise.
2350 (elf32_hppa_hide_symbol): Likewise.
2351 (elf32_hppa_adjust_dynamic_symbol): Likewise.
2352 (allocate_dynrelocs): Likewise.
2353 (elf32_hppa_relocate_section): Likewise.
2354 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2355 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
2356 (lm32_elf_link_hash_newfunc): Likewise.
2357 (lm32_elf_link_hash_table_create): Updated.
2358 (readonly_dynrelocs): Likewise.
2359 (allocate_dynrelocs): Likewise.
2360 (lm32_elf_copy_indirect_symbol): Likewise.
2361 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
2362 (m32r_elf_link_hash_newfunc): Likewise.
2363 (m32r_elf_link_hash_table_create): Updated.
2364 (m32r_elf_copy_indirect_symbol): Likewise.
2365 (allocate_dynrelocs): Likewise.
2366 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
2367 (metag_link_hash_newfunc): Updated.
2368 (elf_metag_copy_indirect_symbol): Likewise.
2369 (readonly_dynrelocs): Likewise.
2370 (allocate_dynrelocs): Likewise.
2371 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
2372 dyn_relocs.
2373 (link_hash_newfunc): Updated.
2374 (microblaze_elf_check_relocs): Likewise.
2375 (microblaze_elf_copy_indirect_symbol): Likewise.
2376 (readonly_dynrelocs): Likewise.
2377 (allocate_dynrelocs): Likewise.
2378 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
2379 (nds32_elf_link_hash_newfunc): Updated.
2380 (nds32_elf_copy_indirect_symbol): Likewise.
2381 (readonly_dynrelocs): Likewise.
2382 (allocate_dynrelocs): Likewise.
2383 (nds32_elf_check_relocs): Likewise.
2384 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
2385 (link_hash_newfunc): Updated.
2386 (nios2_elf32_copy_indirect_symbol): Likewise.
2387 (nios2_elf32_check_relocs): Likewise.
2388 (allocate_dynrelocs): Likewise.
2389 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
2390 (or1k_elf_link_hash_newfunc): Updated.
2391 (readonly_dynrelocs): Likewise.
2392 (allocate_dynrelocs): Likewise.
2393 (or1k_elf_copy_indirect_symbol): Likewise.
2394 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
2395 (ppc_elf_link_hash_newfunc): Updated.
2396 (ppc_elf_copy_indirect_symbol): Likewise.
2397 (ppc_elf_check_relocs): Likewise.
2398 (readonly_dynrelocs): Likewise.
2399 (ppc_elf_adjust_dynamic_symbol): Likewise.
2400 (allocate_dynrelocs): Likewise.
2401 (ppc_elf_relocate_section): Likewise.
2402 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2403 (link_hash_newfunc): Updated.
2404 (elf_s390_copy_indirect_symbol): Likewise.
2405 (readonly_dynrelocs): Likewise.
2406 (elf_s390_adjust_dynamic_symbol): Likewise.
2407 (allocate_dynrelocs): Likewise.
2408 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
2409 (sh_elf_link_hash_newfunc): Updated.
2410 (readonly_dynrelocs): Likewise.
2411 (allocate_dynrelocs): Likewise.
2412 (sh_elf_copy_indirect_symbol): Likewise.
2413 (sh_elf_check_relocs): Likewise.
2414 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
2415 (elf32_tic6x_link_hash_newfunc): Likewise.
2416 (elf32_tic6x_link_hash_table_create): Updated.
2417 (readonly_dynrelocs): Likewise.
2418 (elf32_tic6x_check_relocs): Likewise.
2419 (elf32_tic6x_allocate_dynrelocs): Likewise.
2420 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
2421 dyn_relocs.
2422 (link_hash_newfunc): Updated.
2423 (tilepro_elf_copy_indirect_symbol): Likewise.
2424 (tilepro_elf_check_relocs): Likewise.
2425 (allocate_dynrelocs): Likewise.
2426 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
2427 (ppc64_elf_copy_indirect_symbol): Updated.
2428 (ppc64_elf_check_relocs): Likewise.
2429 (readonly_dynrelocs): Likewise.
2430 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2431 (dec_dynrel_count): Likewise.
2432 (allocate_dynrelocs): Likewise.
2433 (ppc64_elf_relocate_section): Likewise.
2434 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
2435 (link_hash_newfunc): Updated.
2436 (elf_s390_copy_indirect_symbol): Likewise.
2437 (readonly_dynrelocs): Likewise.
2438 (allocate_dynrelocs): Likewise.
2439 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2440 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
2441 dyn_relocs.
2442 (elfNN_aarch64_link_hash_newfunc): Updated.
2443 (elfNN_aarch64_copy_indirect_symbol): Likewise.
2444 (readonly_dynrelocs): Likewise.
2445 (need_copy_relocation_p): Likewise.
2446 (elfNN_aarch64_allocate_dynrelocs): Likewise.
2447 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
2448 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
2449 (link_hash_newfunc): Updated.
2450 (riscv_elf_copy_indirect_symbol): Likewise.
2451 (riscv_elf_check_relocs): Likewise.
2452 (readonly_dynrelocs): Likewise.
2453 (allocate_dynrelocs): Likewise.
2454 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
2455 dyn_relocs.
2456 (link_hash_newfunc): Updated.
2457 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2458 (_bfd_sparc_elf_check_relocs): Likewise.
2459 (readonly_dynrelocs): Likewise.
2460 (allocate_dynrelocs): Likewise.
2461 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
2462 (link_hash_newfunc): Updated.
2463 (tilegx_elf_copy_indirect_symbol): Likewise.
2464 (tilegx_elf_check_relocs): Likewise.
2465 (readonly_dynrelocs): Likewise.
2466 (allocate_dynrelocs): Likewise.
2467 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
2468 (readonly_dynrelocs): Likewise.
2469 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
2470 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
2471
2fdb65f2
AM
24722020-06-01 Alan Modra <amodra@gmail.com>
2473
2474 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
2475 command against cmd_length, not the end of record. For
2476 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
2477 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
2478 cmd_length test.
2479
12adf805
DF
24802020-05-28 David Faust <david.faust@oracle.com>
2481
2482 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
2483 R_BPF_INSN_{32,64} relocations.
2484
66e3eb08
SC
24852020-05-28 Stephen Casner <casner@acm.org>
2486
2487 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
2488 addreses in .long (used in testsuites) and .stab values.
2489
a6dbf402
L
24902020-05-27 H.J. Lu <hongjiu.lu@intel.com>
2491
2492 PR ld/22909
2493 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
2494 Check bfd_link_dll when issue a DT_TEXTREL warning.
2495 * elfxx-x86.c (maybe_set_textrel): Likewise.
2496 (_bfd_x86_elf_size_dynamic_sections): Likewise.
2497
9e7cb4c3
NC
24982020-05-26 Nick Clifton <nickc@redhat.com>
2499
2500 * plugin.c (try_load_plugin): Extend error message when a plugin
2501 fails to open.
2502
c892b447
AM
25032020-05-23 Alan Modra <amodra@gmail.com>
2504
2505 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
2506
6f3fe02b
AM
25072020-05-22 Alan Modra <amodra@gmail.com>
2508
2509 PR 25882
2510 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
2511 attributes from shared libraries, and do not return an error if
2512 they don't match.
2513
0490dd41
AM
25142020-05-21 Alan Modra <amodra@gmail.com>
2515
2516 PR 25993
2517 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
2518 filename.
2519 (_bfd_delete_bfd): Free the copy.
2520 (_bfd_new_bfd): Free nbfd->memory on error.
2521
c9594989
AM
25222020-05-21 Alan Modra <amodra@gmail.com>
2523
2524 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
2525 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
2526 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
2527 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
2528 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
2529 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
2530 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
2531 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
2532 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
2533 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
2534 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
2535 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
2536 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
2537 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
2538 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
2539 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
2540 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
2541 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
2542 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
2543 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
2544
8f595e9b
NC
25452020-05-20 Nelson Chu <nelson.chu@sifive.com>
2546
2547 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
2548 get_default_version. It is used to find the default version for
2549 the specific extension.
2550 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
2551 default_major_version and default_minor_version. Add new bfd_boolean
2552 parameter *use_default_version. Set it to TRUE if we need to call
2553 the callback rps->get_default_version to find the default version.
2554 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
2555 the default version in riscv_parsing_subset_version, and then call
2556 riscv_add_subset to add the subset into subset list.
2557 (riscv_parse_prefixed_ext): Likewise.
2558 (riscv_std_z_ext_strtab): Support Zicsr extensions.
2559 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
2560 strings rather than characters.
2561 riscv_merge_arch_attr_info): The callback function get_default_version
2562 is only needed for assembler, so set it to NULL int the linker.
2563 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
2564 * elfxx-riscv.h: Updated.
2565
7b958a48
AM
25662020-05-20 Alan Modra <amodra@gmail.com>
2567
2568 PR 25993
2569 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
2570 use bfd_set_filename.
2571 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
2572 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
2573 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
2574 (bfd_create): Likewise.
2575 (_bfd_delete_bfd): Don't free filename.
2576 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
2577 return pointer to the copy or NULL on alloc fail.
2578 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
2579 result of bfd_set_filename.
2580 * bfd-in2.h: Regenerate.
2581
3c568b8a
AM
25822020-05-20 Alan Modra <amodra@gmail.com>
2583
2584 PR 26011
2585 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
2586 section size against file size.
2587 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
2588
6fd1d259
GN
25892020-05-19 Gunther Nikl <gnikl@justmail.de>
2590
2591 PR 26005
11c0dd51
NC
2592 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
2593 and memset when allocating memory for the sections_being_created
2594 array.
6fd1d259 2595
7e94cf6c
SH
25962020-05-19 Stafford Horne <shorne@gmail.com>
2597
2598 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
2599 to relgot.
2600 (or1k_elf_relocate_section): Access srelgot via
2601 htab->root.srelgot. Add assertions for srelgot->contents.
2602 Introduce local variable for srelgot to not reuse global
2603 sreloc.
2604 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
2605 (or1k_set_got_and_rela_sizes): New function.
2606 (or1k_initial_exec_offset): New function.
2607 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
2608 (or1k_elf_relocate_section): Allow for TLS to handle multiple
2609 model access.
2610 (or1k_elf_check_relocs): Use OR to set TLS access.
2611 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
2612 sizes.
2613 (or1k_elf_size_dynamic_sections): Use
2614 or1k_set_got_and_rela_sizes to set sizes.
2615 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
2616 (TCB_SIZE): New macro.
2617 (tpoff): Use TCB_SIZE and alignment to calculate offset.
2618 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
2619 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
2620 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
2621 (tpoff): Add dynamic boolean argument.
2622 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
2623
7e057737
SP
26242020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
2625
2626 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
2627 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
2628 cases with BFD_RELOC_AARCH64_JUMP26.
2629 (elfNN_aarch64_check_relocs): Likewise.
2630
765cf5f6
AM
26312020-05-19 Alan Modra <amodra@gmail.com>
2632
2633 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
2634 bfd_get_filename rather than accessing bfd->filename directly.
2635 * aout-target.h (MY (object_p)): Likewise.
2636 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2637 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
2638 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
2639 (_bfd_archive_bsd44_construct_extended_name_table),
2640 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
2641 (_bfd_bsd_write_armap): Likewise.
2642 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
2643 * cache.c (bfd_open_file): Likewise.
2644 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
2645 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
2646 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2647 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2648 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
2649 * elf32-nds32.c (nds32_elf_output_symbol_hook),
2650 (patch_tls_desc_to_ie): Likewise.
2651 * elf32-spu.c (sort_bfds, print_one_overlay_section),
2652 (spu_elf_auto_overlay): Likewise.
2653 * elf64-hppa.c (elf_hppa_final_link): Likewise.
2654 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
2655 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
2656 * elflink.c (bfd_elf_size_dynamic_sections),
2657 (elf_link_input_bfd): Likewise.
2658 * linker.c (_bfd_generic_link_output_symbols): Likewise.
2659 * mach-o.c (bfd_mach_o_follow_dsym),
2660 (bfd_mach_o_close_and_cleanup): Likewise.
2661 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
2662 (find_separate_debug_file, get_build_id_name): Likewise.
2663 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
2664 * plugin.c (bfd_plugin_open_input): Likewise.
2665 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
2666 * som.c (som_write_armap): Likewise.
2667 * srec.c (srec_write_record, srec_write_symbols): Likewise.
2668 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
2669 (_bfd_vms_lib_write_archive_contents): Likewise.
2670 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
2671
39a1432c
AM
26722020-05-19 Alan Modra <amodra@gmail.com>
2673
2674 PR 25713
2675 * bfdio.c (_bfd_real_fopen): Typo fix.
2676
ed02cdb5
NC
26772020-05-18 Nick Clifton <nickc@redhat.com>
2678
2679 PR 26005
2680 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
2681 for the sections_being_created array.
2682
7a87e9c8
AM
26832020-05-18 Alan Modra <amodra@gmail.com>
2684
2685 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
2686 they can be freed without also freeing internal_relocs.
2687
ca859a89
JC
26882020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2689
2690 PR 25713
2691 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
2692 separators into DOS style when creating a WIN32 fullpath.
2693
fc46e8bd
NC
26942020-05-14 Nelson Chu <nelson.chu@sifive.com>
2695
2696 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
2697 to initialize RISC-V tdata.
2698
533f049e
GN
26992020-05-12 Gunther Nikl <gnikl@justmail.de>
2700
2701 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
2702 relocation size.
2703
94ba9882
AM
27042020-05-11 Alan Modra <amodra@gmail.com>
2705
2706 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
2707
7c1f4227
AM
27082020-05-11 Alan Modra <amodra@gmail.com>
2709
2710 * elf64-ppc.c: Rename powerxx to power10 throughout.
2711
4d5acb1e
AM
27122020-05-11 Alan Modra <amodra@gmail.com>
2713
2714 PR 25961
2715 * coffgen.c (coff_get_normalized_symtab): Check that buffer
2716 contains required number of auxents before processing any auxent.
2717 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
2718 file name from auxents for PE.
2719
7242fa8a
GN
27202020-05-04 Gunther Nikl <gnikl@justmail.de>
2721
2722 * aout-cris.c (DEFAULT_ARCH): Delete define.
2723 (MY_set_arch_mach): Likewise.
2724 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
2725 of bfd_arch_cris.
2726 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
2727 of r_type before the shift.
2728
27292020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
cff69cf4
WD
2730
2731 PR ld/25665
2732 * elfnn-aarch64.c (group_sections): Copy implementation from
2733 elf32-arm.c.
2734
a2714d6c
AM
27352020-05-01 Alan Modra <amodra@gmail.com>
2736
2737 PR 25900
2738 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
2739 accessing root.u.def of symbols. Also check root.u.def.section
2740 is non-NULL. Reverse tests so as to make the logic positive.
2741
a8acd6ee
AM
27422020-05-01 Alan Modra <amodra@gmail.com>
2743
2744 PR 25882
2745 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
2746 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
2747
6b728d32
AM
27482020-05-01 Alan Modra <amodra@gmail.com>
2749
2750 PR 25882
2751 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
2752 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2753 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2754 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
2755 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
2756 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
2757 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
2758 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
2759 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
2760 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
2761
91ed9b71
AM
27622020-05-01 Alan Modra <amodra@gmail.com>
2763
2764 PR 25882
2765 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
2766 from shared libraries.
2767
d548f47d
MF
27682020-04-29 Max Filippov <jcmvbkbc@gmail.com>
2769
2770 * elf32-xtensa.c (relax_section): Don't negate diff_value for
2771 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
2772 equals 0. Report overflow when the result has negative sign but
2773 all significant bits are zero.
2774
dfa85db1
GN
27752020-04-29 Gunther Nikl <gnikl@justmail.de>
2776
2777 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
2778 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
2779
48e5bada
AM
27802020-04-28 Alan Modra <amodra@gmail.com>
2781
2782 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
2783 Emit warning message.
2784
251dae91
TC
27852020-04-27 Tamar Christina <tamar.christina@arm.com>
2786
2787 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
2788 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
2789 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
2790 to x86_64_pe_big_vec as it not a big-endian format.
2791 (vec i386_pe_big_vec): New.
2792 * configure.ac: Likewise.
2793 * targets.c: Likewise.
2794 * configure: Regenerate.
2795 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
2796 COFF_WITH_PE_BIGOBJ): New.
2797 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
2798 New.
2799 (x86_64_pe_be_vec): Moved.
2800
27456742
AK
28012020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
2802
2803 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
2804 * elf.c (elfcore_grok_arc_v2): New function.
2805 (elfcore_grok_note): Call the new function to handle the corresponding
2806 note.
2807 (elfcore_write_arc_v2): New function.
2808 (elfcore_write_register_note): Call the new function to handle the
2809 corresponding pseudo-sections.
2810
30ce8e47
MF
28112020-04-22 Max Filippov <jcmvbkbc@gmail.com>
2812
2813 PR ld/25861
2814 * bfd-in2.h: Regenerated.
2815 * elf32-xtensa.c (elf_howto_table): New entries for
2816 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
2817 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
2818 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
2819 R_XTENSA_NDIFF{8,16,32}.
2820 * libbfd.h (bfd_reloc_code_real_names): Add names for
2821 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
2822 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2823 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
2824 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
2825
c36876fe
TC
28262020-04-21 Tamar Christina <tamar.christina@arm.com>
2827
2828 PR binutils/24753
2829 * compress.c (bfd_get_full_section_contents): Exclude sections with no
2830 content.
2831
6f6fd151
L
28322020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2833
2834 PR ld/25849
2835 * elf-bfd.h (elf_backend_data): Add
2836 elf_backend_strip_zero_sized_dynamic_sections.
2837 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
2838 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
2839 New macro.
2840 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
2841 function.
2842 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
2843 New macro.
2844 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
2845
1f7f2abb
L
28462020-04-21 H.J. Lu <hongjiu.lu@intel.com>
2847
2848 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
2849 sec.
2850 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
2851 DT_TEXTREL with -M.
2852 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
2853
e04f33c0
NC
28542020-04-21 Nick Clifton <nickc@redhat.com>
2855
2856 * po/sr.po: Updated Serbian translation.
2857
fad3d2c1
AM
28582020-04-21 Alan Modra <amodra@gmail.com>
2859
2860 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
2861 processing.
2862
23c8270e
SC
28632020-04-20 Stephen Casner <casner@acm.org>
2864
2865 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
2866 causing globals from linker script to be treated as debug symbols.
2867 (translate_symbol_table): Don't sign-extend symbol values from 16
2868 to 64 bits in nm output.
2869
2efec98b
AM
28702020-04-20 Alan Modra <amodra@gmail.com>
2871
2872 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
2873
18f97353
AM
28742020-04-18 Alan Modra <amodra@gmail.com>
2875
2876 * section.c (bfd_is_const_section): Correct test for special
2877 sections.
2878 * bfd-in2.h: Regenerate.
2879
8d55d10a
AM
28802020-04-17 Alan Modra <amodra@gmail.com>
2881
2882 PR 25842
2883 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
2884 NULL nodename.
2885
8e4979ac
NC
28862020-04-16 Nick Clifton <nickc@redhat.com>
2887
2888 PR 25803
2889 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
2890 abort with a more helpful error message.
2891
aec72fda
AM
28922020-04-16 Alan Modra <amodra@gmail.com>
2893
2894 PR 25827
2895 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
2896 strdup(0).
2897
95a51568
FS
28982020-04-15 Fangrui Song <maskray@google.com>
2899
2900 PR binutils/24613
2901 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
2902 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
2903 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2904 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
2905 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2906 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2907 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2908 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2909 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2910 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2911 * elflink.c (elf_link_output_extsym): Likewise.
2912 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
2913
7ecb5154
AM
29142020-04-15 Alan Modra <amodra@gmail.com>
2915
2916 PR 25823
2917 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2918 pointer into strings that may be freed for section name, always
2919 allocate a new string.
2920
f717994f
JMG
29212020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2922 Jan W. Jagersma <jwjagersma@gmail.com>
2923
2924 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2925 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2926 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2927 (_bfd_go32_mkobject): New functions.
2928 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2929 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2930 (go32exe_mkobject): Call _bfd_go32_mkobject.
2931 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2932 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2933 and COFF_GO32.
2934 (coff_write_relocs): Enable extended reloc counter code if
2935 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2936 (coff_write_object_contents): Likewise. Pad section headers
2937 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2938 instead of coff_swap_scnhdr_out.
2939 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2940 enable extended reloc counter.
2941 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2942 Declare with ATTRIBUTE_UNUSED.
2943 * libcoff-in.h: (struct coff_tdata): New field go32.
2944 (obj_go32): Define.
2945 * libcoff.h: Regenerate.
2946
34ca5531
FS
29472020-04-14 Fangrui Song <maskray@google.com>
2948
2949 PR gas/25768
2950 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2951 12.
2952
fa1477dc
SC
29532020-04-14 Stephen Casner <casner@acm.org>
2954
2955 PR ld/25677
2956 * pdp11.c: Add implementation of --imagic option.
2957 (adjust_o_magic): Fix objcopy --extract-symbol test.
2958 * libaout.h (enum aout_magic): Add i_magic.
2959
a0543b0b
RO
29602020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2961 Nick Clifton <nickc@redhat.com>
2962
2963 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2964 <0>: Ignore.
2965 <default>: Error rather than abort.
2966
3349112e
L
29672020-04-03 H.J. Lu <hongjiu.lu@intel.com>
2968
2969 PR ld/25767
2970 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2971 relocation section from section group.
2972
4d095f5b
JJ
29732020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
2974
2975 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
2976 bfd->origin to file offset.
2977 * bfdwin.c (bfd_get_file_window): Likewise.
2978 * bfd.c: Clarify the use of the bfd->origin field.
2979 * bfd-in2.h: Regenerate.
2980 * coff-i386.c: Don't include go32exe.h. Allow overriding
2981 coff_write_object_contents via COFF_WRITE_CONTENTS.
2982 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
2983 (go32exe_write_object_contents): New functions.
2984 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
2985 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
2986 (create_go32_stub): Remove check for 2k size limit. Read stub
2987 from go32exe_temp_stub if present.
2988 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
2989 copy variable-length stub.
2990 (go32_check_format): Read stub to go32exe_temp_stub, set
2991 origin, return go32exe_cleanup.
2992 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
2993 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
2994 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
2995 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
2996 Remove functions and their associated #defines.
2997 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
2998 * libcoff-in.h: (struct coff_tdata): New field stub_size.
2999 Rename field go32stub to stub.
3000 * libcoff.h: Regenerate.
3001 * coff-stgo32.c (go32_check_format): Rename to...
3002 (go32exe_check_format): ...this.
3003 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
3004 (go32exe_copy_private_bfd_data): ...this.
3005 (stub_bytes): Rename to...
3006 (go32exe_default_stub): ...this.
3007 (create_go32_stub): Rename to...
3008 (go32exe_create_stub): ...this.
3009 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
3010 when possible.
3011
382aae06
L
30122020-04-01 H.J. Lu <hongjiu.lu@intel.com>
3013
3014 PR ld/25749
3015 PR ld/25754
3016 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
3017 relocation to R_386_32 for relocation against non-preemptible
3018 absolute symbol.
3019 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
3020 allocate dynamic relocation for non-preemptible absolute symbol.
3021 (elf_i386_relocate_section): Pass sec to
3022 GENERATE_DYNAMIC_RELOCATION_P.
3023 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
3024 (elf_x86_64_convert_load_reloc): Covert load relocation to
3025 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
3026 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
3027 for non-preemptible absolute symbol if they overflow.
3028 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
3029 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
3030 symbol. Don't allocate dynamic relocation for non-preemptible
3031 absolute symbol.
3032 (elf_x86_64_relocate_section): Don't generate relative relocation
3033 for GOTPCREL relocations aganst local absolute symbol. Pass sec
3034 to GENERATE_DYNAMIC_RELOCATION_P.
3035 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
3036 against non-preemptible absolute symbol.
3037 (_bfd_elf_x86_valid_reloc_p): New function.
3038 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
3039 GOT_ABS GOT slot.
3040 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
3041 argument. Don't generate dynamic relocation against
3042 non-preemptible absolute symbol.
3043 (ABS_SYMBOL_P): New.
3044 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
3045 against non-preemptible absolute symbol.
3046 (GOT_ABS): New.
3047 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
3048 (_bfd_elf_x86_valid_reloc_p): New.
3049
a7618269
TC
30502020-04-01 Tamar Christina <tamar.christina@arm.com>
3051
3052 PR ld/16017
3053 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
3054 address in the GOT if in thumb only mode.
3055
15ccbdd7
TC
30562020-04-01 Tamar Christina <tamar.christina@arm.com>
3057
3058 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
3059
7b948a25
HPN
30602020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
3061
3062 * mmo.c (mmo_scan): Create .text section only when needed, not
3063 from the start.
3064
89b599df
AM
30652020-03-31 Alan Modra <amodra@gmail.com>
3066
3067 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
3068 return value check.
3069
81699544
AM
30702020-03-31 Alan Modra <amodra@gmail.com>
3071
3072 * vms-alpha.c (image_write): Check bounds for sections without
3073 contents too. Error on non-zero write to section without
3074 contents.
3075 (_bfd_vms_slurp_etir): Check return of image_write* functions.
3076
b3b360de
AM
30772020-03-31 Alan Modra <amodra@gmail.com>
3078
3079 * tekhex.c (pass_over): Check is_eof before reading buffer.
3080
00386881
NC
30812020-03-30 Nick Clifton <nickc@redhat.com>
3082
3083 PR binutils/pr25662
3084 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
3085 field to timestamp and make it an integer.
3086 * libcoff.h: Regenerate.
3087 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
3088 field in the pe_data structure rather than the insert_timestamp
3089 field.
3090
988b7300
AM
30912020-03-30 Alan Modra <amodra@gmail.com>
3092
3093 PR 25745
3094 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
3095 statistics message.
3096
aa49fc22
NC
30972020-03-26 Nick Clifton <nickc@redhat.com>
3098
3099 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
3100 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
3101 prototype.
3102 * libbfd.h: Regenerate.
3103
ff768510
AM
31042020-03-26 Alan Modra <amodra@gmail.com>
3105
3106 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
3107
f75fbe8a
AM
31082020-03-26 Alan Modra <amodra@gmail.com>
3109
3110 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
3111 array.
3112 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
3113
aac88046
NC
31142020-03-25 Nick Clifton <nickc@redhat.com>
3115
3116 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
3117 function.
3118 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
3119 * libbfd.h: Regenerate.
3120
cf2611fe
SV
31212020-03-25 Shahab Vahedi <shahab@synopsys.com>
3122
3123 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
3124 correct field name in the output string.
3125
d16e3d2e
AM
31262020-03-25 Alan Modra <amodra@gmail.com>
3127
3128 PR 25662
3129 * elf.c (assign_file_positions_for_load_sections): Adjust offset
3130 for SHT_NOBITS section if first in segment.
3131
1081065c
L
31322020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3133
3134 PR binutils/25708
3135 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
3136 (_bfd_elf_get_symbol_version_string): This.
3137 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
3138 (_bfd_elf_get_symbol_version_string): This.
3139 (bfd_elf_print_symbol): Pass TRUE to
3140 _bfd_elf_get_symbol_version_string.
3141 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
3142 bfd_boolean argument.
3143 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
3144 * targets.c (_bfd_get_symbol_version_string): Likewise.
3145 (bfd_get_symbol_version_string): Likewise.
3146 * bfd-in2.h: Regenerated.
3147
0b8448af 31482020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 3149 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
3150
3151 PR 25713
3152 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
3153 Win32 systems.
3154
ec2e748a
NC
31552020-03-24 Nick Clifton <nickc@redhat.com>
3156
3157 PR 25681
3158 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
3159 segment to use for PT_GNU_RELRO, ignore empty sections in a
3160 segment's current list.
3161
cda7e560
L
31622020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3163
3164 PR binutils/25717
3165 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
3166
7e6e972f
L
31672020-03-24 H.J. Lu <hongjiu.lu@intel.com>
3168
3169 PR binutils/25708
3170 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
3171 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
3172 on the previous _bfd_elf_get_symbol_version_string.
3173 (_bfd_elf_get_symbol_version_string): Use it.
3174
65109548
AM
31752020-03-24 Alan Modra <amodra@gmail.com>
3176
3177 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
3178 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
3179 struct areltdata.
3180
fdde2fb6
SH
31812020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
3182
3183 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
3184
cf28cfef
AM
31852020-03-23 Alan Modra <amodra@gmail.com>
3186
3187 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
3188 symbol count. Allocate an extra byte to ensure name strings
3189 are terminated. Sanity check name offsets. Release memory on
3190 error return.
3191
5e737279
AM
31922020-03-23 Alan Modra <amodra@gmail.com>
3193
3194 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
3195 field hasn't been read. Remove unnecessary casts.
3196
c15a8f17
AM
31972020-03-22 Alan Modra <amodra@gmail.com>
3198
3199 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
3200 enough to read number of symbols.
3201
3d98c460
L
32022020-03-20 H.J. Lu <hongjiu.lu@intel.com>
3203
3204 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
3205 (EXECUTABLE_SUFFIX): Likewise.
3206 * config.in: Regenerated.
3207 * configure: Likewise.
3208 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
3209 _bfd_generic_close_and_cleanup.
3210 (plugin_list_entry): Remove resolution_file, resolution_option,
3211 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
3212 lto_wrapper, gcc_env and initialized,
3213 (need_lto_wrapper_p): Removed.
3214 (get_lto_wrapper): Likewise.
3215 (setup_lto_wrapper_env): Likewise.
3216 (register_all_symbols_read): Likewise.
3217 (egister_cleanup): Likewise.
3218 (get_symbols): Likewise.
3219 (add_input_file): Likewise.
3220 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
3221 (add_symbols): Updated.
3222 (try_claim): Likewise.
3223 (try_load_plugin): Likewise.
3224 (bfd_plugin_canonicalize_symtab): Likewise.
3225 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
3226 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
3227
c3a1714c
L
32282020-03-19 H.J. Lu <hongjiu.lu@intel.com>
3229
3230 PR binutils/25640
3231 * plugin.c (plugin_list_entry): Add has_symbol_type.
3232 (add_symbols_v2): New function.
3233 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
3234 provides symbol type.
3235 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
3236 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
3237 available.
3238
67338173
AM
32392020-03-20 Alan Modra <amodra@gmail.com>
3240
3241 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
3242 enough to read number of symbols.
3243
a859124d
AM
32442020-03-20 Alan Modra <amodra@gmail.com>
3245
3246 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
3247 backend functions for NULL before calling.
3248 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
3249 (bfd_section_from_shdr, assign_section_numbers): Likewise.
3250 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
3251 * elfnn-ia64.c (ignore_errors): New function.
3252 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
3253
f3a08f77
NC
32542020-03-19 Nick Clifton <nickc@redhat.com>
3255
3256 PR 25676
3257 * dwarf2.c (struct varinfo): Add unit_offset field to record the
3258 location of the varinfo in the unit's debug info data. Change the
3259 type of the stack field to a boolean.
3260 (lookup_var_by_offset): New function. Returns the varinfo
3261 structure for the variable described at the given offset in the
3262 unit's debug info.
3263 (scan_unit_for_symbols): Add support for variables which have the
3264 DW_AT_specification attribute.
3265
6a541707
NC
32662020-03-19 Nick Clifton <nickc@redhat.com>
3267
3268 PR 25699
3269 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
3270 error return.
3271
effc14f5
SH
32722020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
3273
3274 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
3275
ac4bf06c
NC
32762020-03-18 Nick Clifton <nickc@redhat.com>
3277
3278 PR 25673
3279 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
3280 memory access when processing a corrupt secondary reloc section.
3281
53215f21
CL
32822020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
3283
3284 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
3285 instead of calling abort.
3286 * elf32-csky.c (csky_build_one_stub): Likewise.
3287 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3288 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3289 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3290 * elf32-metag.c (metag_build_one_stub): Likewise.
3291 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3292 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3293 (ppc_size_one_stub): Likewise.
3294 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3295
327ef784
NC
32962020-03-17 Nick Clifton <nickc@redhat.com>
3297
d3c3c542 3298 PR 25688
327ef784
NC
3299 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
3300 with error messages.
3301
ecbbbdba
NC
33022020-03-17 Nick Clifton <nickc@redhat.com>
3303
3304 PR 25687
3305 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
3306 free. Add free on another failure path.
3307
4b3ecb3b
AM
33082020-03-16 Alan Modra <amodra@gmail.com>
3309
3310 PR 25675
3311 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
3312 we have a non-zero section count. Do lma comparison in octets.
3313
7bac4137
AM
33142020-03-16 Alan Modra <amodra@gmail.com>
3315
3316 * vms-alpha.c (dst_restore_location): Validate index into
3317 dst_ptr_offsets array before accessing. Return status.
3318 (dst_retrieve_location): Similarly, making "loc" parameter a
3319 pointer to return value.
3320 (_bfd_vms_slurp_etir): Update calls to above functions.
3321
8b5d0a4f
KR
33222020-03-14 Kamil Rytarowski <n54@gmx.com>
3323
3324 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
3325 targets.
3326 * configure: Regenerated.
3327
48e81d7f
AM
33282020-03-14 Alan Modra <amodra@gmail.com>
3329
3330 * section.c (BFD_FAKE_SECTIONS): Formatting.
3331 * bfd-in2.h: Regenerate.
3332
06d949ec
KR
33332020-03-13 Kamil Rytarowski <n54@gmx.com>
3334
3335 * elf.c (elfcore_grok_netbsd_note): Add support for
3336 NT_NETBSDCORE_LWPSTATUS notes.
3337
abf874aa
CL
33382020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
3339
3340 * bfd-in2.h: Regenerate.
3341 * section.c (asection): Add already_assigned field.
3342 (BFD_FAKE_SECTION): Add default initializer for it.
3343 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
3344 * elf32-arm.c (arm_build_one_stub): Add support for
3345 non_contiguous_regions.
3346 * elf32-csky.c (csky_build_one_stub): Likewise.
3347 * elf32-hppa.c (hppa_build_one_stub): Likewise.
3348 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
3349 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
3350 * elf32-metag.c (metag_build_one_stub): Likewise.
3351 * elf32-nios2.c (nios2_build_one_stub): Likewise.
3352 * elf64-ppc.c (ppc_build_one_stub): Likewise.
3353 (ppc_size_one_stub): Likewise.
3354 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
3355 * elflink.c (elf_link_input_bfd): Likewise.
3356
74e10d17
L
33572020-03-13 H.J. Lu <hongjiu.lu@intel.com>
3358
3359 PR ld/24920
3360 * elf-linker-x86.h (elf_linker_x86_params): Add
3361 static_before_all_inputs and has_dynamic_linker.
3362 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
3363 dynamic input objects if -static is passed at command-line
3364 before all input files without --dynamic-linker unless
3365 --no-dynamic-linker is used.
3366
015ec493
KR
33672020-03-13 Kamil Rytarowski <n54@gmx.com>
3368
3369 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
3370
66631823
CE
33712020-03-13 Christian Eggers <ceggers@gmx.de>
3372
3373 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
3374 "p_paddr" from "at".
3375 * elfcode.h (bfd_from_remote_memory): Add units to several
3376 parameters. New local "opb". Fix usage of p_align. Fix
3377 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
3378 call of target_read_memory.
3379 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
3380 calculation of "offset" and "output_offset".
3381 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
3382 from "offset" and fix calculation of "end" from "vma+size". Fix
3383 comparison between "sh_addr" and "vma"/"output_offset".
3384 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
3385 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
3386 member.
3387 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
3388 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
3389 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
3390 assignment of p_paddr from phdr_lma. Fix comparison between
3391 "lma+size" and "next->lma".
3392 (elf_sort_segments): Fix assignment from p_paddr to lma.
3393 (assign_file_positions_for_load_sections): Add unit (bytes) to
3394 local "align". Fix calculation of local "off_adjust". Fix
3395 calculation of local "filehdr_vaddr".
3396 (assign_file_positions_for_non_load_sections): New local "opb".
3397 Fix calculation of "end" from "p_size". Fix comparison between
3398 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
3399 from "end" and "p_vaddr".
3400 (rewrite_elf_program_header): Fix comparison between p_vaddr and
3401 vma. Fix assignment to p_paddr from lma. Fix comparison between
3402 p_paddr and lma. Fix assignment to p_paddr from lma.
3403 * merge.c (sec_merge_emit): New local "opb". Convert
3404 "alignment_power" to octets.
3405 (_bfd_add_merge_section): New locals "alignment_power" and
3406 "opb". Fix comparison between "alignment_power" and
3407 "sizeof(align)".
3408 (_bfd_merge_sections): New local "opb". Divide size by opb
3409 before checking align mask.
3410
502794d4
CE
34112020-03-13 Christian Eggers <ceggers@gmx.de>
3412
3413 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
3414 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
3415 section LMA/VMA.
3416 (_bfd_elf_make_section_from_phdr): Similarly.
3417 (elf_fake_sections): Fix calculation of
3418 Elf_Internal_shdr::sh_addr from section VMA.
3419 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
3420 and bytes.
3421 (assign_file_positions_for_load_sections): Fix calculations of
3422 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
3423 comparison between program header address and section LMA.
3424 (assign_file_positions_for_non_load_sections): Likewise.
3425 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
3426 (IS_CONTAINED_BY_VMA): Add parameter opb.
3427 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
3428 INCLUDE_SECTION_IN_SEGMENT): Likewise.
3429 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
3430 Fix calculations of p_addr_valid and p_vaddr_offset.
3431 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
3432 with octets per byte when comparing against p_vaddr.
3433
8248d21a
AM
34342020-03-11 Alan Modra <amodra@gmail.com>
3435
3436 * som.c (setup_sections): Sanity check subspace.name.
3437
435edf0b
AM
34382020-03-11 Alan Modra <amodra@gmail.com>
3439
3440 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
3441
6b5e16ff
AM
34422020-03-10 Alan Modra <amodra@gmail.com>
3443
3444 PR 25648
3445 * ihex.c (ihex_write_object_contents): Don't assume ordering of
3446 addresses here.
3447
2f57795b
AM
34482020-03-09 Alan Modra <amodra@gmail.com>
3449
3450 * wasm-module.c (wasm_scan): Sanity check file name length
3451 before allocating memory. Move common section setup code. Do
3452 without bfd_tell to calculate section size.
3453
a0dcf297
NC
34542020-03-06 Nick Clifton <nickc@redhat.com>
3455
3456 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
3457 with error messages and failure return values.
3458
e15a8da9
MF
34592020-03-05 Max Filippov <jcmvbkbc@gmail.com>
3460
3461 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
3462 relocation sections for any removed reference to a dynamic symbol.
3463
a8e14f4c
NC
34642020-03-05 Nick Clifton <nickc@redhat.com>
3465
3466 * elf-bfd.h (struct elf_backend_data): Add new fields:
3467 init_secondary_reloc_section, slurp_secondary_reloc_section,
3468 write_secondary_reloc_section.
3469 (_bfd_elf_init_secondary_reloc_section): Prototype.
3470 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
3471 (_bfd_elf_write_secondary_reloc_section): Prototype.
3472 * elf.c ( bfd_section_from_shdr): Invoke the new
3473 init_secondary_reloc_section backend function, if defined, when a
3474 second reloc section is encountered.
3475 (swap_out_syms): Invoke the new symbol_section_index function, if
3476 defined, when computing the section index of an OS/PROC specific
3477 symbol.
3478 (_bfd_elf_init_secondary_reloc_section): New function.
3479 (_bfd_elf_slurp_secondary_reloc_section): New function.
3480 (_bfd_elf_write_secondary_reloc_section): New function.
3481 (_bfd_elf_copy_special_section_fields): New function.
3482 * elfcode.h (elf_write_relocs): Invoke the new
3483 write_secondary_relocs function, if defined, in order to emit
3484 secondary relocs.
3485 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
3486 function, if defined, in order to read in secondary relocs.
3487 * elfxx-target.h (elf_backend_copy_special_section_fields):
3488 Provide a non-NULL default definition.
3489 (elf_backend_init_secondary_reloc_section): Likewise.
3490 (elf_backend_slurp_secondary_reloc_section): Likewise.
3491 (elf_backend_write_secondary_reloc_section): Likewise.
3492 (struct elf_backend_data elfNN_bed): Add initialisers for the new
3493 fields.
3494 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
3495 * configure: Regenerate.
3496
6f8f95b4
AM
34972020-03-05 Alan Modra <amodra@gmail.com>
3498
3499 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
3500 against file size before allocating memory. Use bfd_alloc rather
3501 than bfd_zalloc for carsym/strings memory.
3502
233bf4f8
AM
35032020-03-04 Alan Modra <amodra@gmail.com>
3504
3505 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
3506 sh_addr mod sh_addalign is zero.
3507
1039fd9a
AM
35082020-03-04 Alan Modra <amodra@gmail.com>
3509
3510 * format.c (bfd_check_format_matches): Call cleanup on error exit.
3511
f5714099
AM
35122020-03-03 Alan Modra <amodra@gmail.com>
3513
3514 * format.c (struct bfd_preserve): Add cleanup field.
3515 (bfd_preserve_save): Add cleanup param and save.
3516 (bfd_preserve_restore): Return cleanup.
3517 (bfd_preserve_finish): Call the cleanup for the discarded match.
3518 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
3519 and clear when preserving a match. Restore cleanup too when
3520 restoring that match.
3521
40b35c78
AM
35222020-03-02 Alan Modra <amodra@gmail.com>
3523
3524 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
3525 * hpux-core.c (hpux_core_core_file_p): Update prototype.
3526 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
3527 (core_sco5_vec): Correct initialisers.
3528
601b73d5
AM
35292020-03-02 Alan Modra <amodra@gmail.com>
3530
3531 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
3532 * aix5ppc-core.c (xcoff64_core_p): Likewise.
3533 * cisco-core.c (cisco_core_file_validate): Likewise.
3534 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
3535 * hpux-core.c (hpux_core_core_file_p): Likewise.
3536 * irix-core.c (irix_core_core_file_p): Likewise.
3537 * lynx-core.c (lynx_core_file_p): Likewise.
3538 * netbsd-core.c (netbsd_core_file_p): Likewise.
3539 * osf-core.c (osf_core_core_file_p): Likewise.
3540 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3541 * sco5-core.c (sco5_core_file_p): Likewise.
3542
728d32c4
L
35432020-03-02 H.J. Lu <hongjiu.lu@intel.com>
3544
3545 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
3546
cb001c0d
AM
35472020-03-02 Alan Modra <amodra@gmail.com>
3548
3549 * targets.c (bfd_cleanup): New typedef.
3550 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
3551 * libbfd-in.h (_bfd_no_cleanup): Define.
3552 * format.c (bfd_reinit): Add cleanup parameter, call it.
3553 (bfd_check_format_matches): Set cleanup from _bfd_check_format
3554 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
3555 * aout-target.h (callback, object_p): Return bfd_cleanup.
3556 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
3557 * archive.c (bfd_generic_archive_p): Likewise.
3558 * binary.c (binary_object_p): Likewise.
3559 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
3560 * coff-ia64.c (ia64coff_object_p): Likewise.
3561 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
3562 * coff-sh.c (coff_small_object_p): Likewise.
3563 * coff-stgo32.c (go32_check_format): Likewise.
3564 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
3565 (xcoff64_core_p): Likewise.
3566 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
3567 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
3568 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
3569 * elfcode.h (elf_object_p): Likewise.
3570 * elfcore.h (elf_core_file_p): Likewise.
3571 * i386msdos.c (msdos_object_p): Likewise.
3572 * ihex.c (ihex_object_p): Likewise.
3573 * libaout.h (some_aout_object_p): Likewise.
3574 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
3575 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
3576 * libbfd.c (_bfd_dummy_target): Likewise.
3577 * libcoff-in.h (coff_object_p): Likewise.
3578 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
3579 (bfd_mach_o_arm64_core_p): Likewise.
3580 * mach-o-arm.c (bfd_mach_o_arm_object_p),
3581 (bfd_mach_o_arm_core_p): Likewise.
3582 * mach-o-i386.c (bfd_mach_o_i386_object_p),
3583 (bfd_mach_o_i386_core_p): Likewise.
3584 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
3585 (bfd_mach_o_x86_64_core_p): Likewise.
3586 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
3587 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
3588 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
3589 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
3590 * mmo.c (mmo_object_p): Likewise.
3591 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
3592 * peicode.h (coff_real_object_p, pe_ILF_object_p),
3593 (pe_bfd_object_p): Likewise.
3594 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
3595 * ppcboot.c (ppcboot_object_p): Likewise.
3596 * rs6000-core.c (rs6000coff_core_p): Likewise.
3597 * som.c (som_object_setup, som_object_p): Likewise.
3598 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
3599 * tekhex.c (tekhex_object_p): Likewise.
3600 * vms-alpha.c (alpha_vms_object_p): Likewise.
3601 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
3602 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
3603 * wasm-module.c (wasm_object_p): Likewise.
3604 * xsym.c (bfd_sym_object_p): Likewise.
3605 * xsym.h (bfd_sym_object_p): Likewise.
3606 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
3607 return type.
3608 * pdp11.c (some_aout_object_p): Likewise.
3609 * plugin.c (register_ld_plugin_object_p): Update object_p
3610 parameter type.
3611 * plugin.h (register_ld_plugin_object_p): Likewise.
3612 * bfd-in2.h: Regenerate.
3613 * libbfd.h: Regenerate.
3614 * libcoff.h: Regenerate.
3615
a4dd6c97
AM
36162020-03-02 Alan Modra <amodra@gmail.com>
3617
3618 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
3619 applicable section flags.
3620 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
3621 (mips_ecoff_bele_vec): Likewise.
3622 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
3623 and .sbss sections.
3624 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
3625 (_bfd_ecoff_styp_to_sec_flags): Likewise.
3626
bf577467
AM
36272020-03-02 Alan Modra <amodra@gmail.com>
3628
3629 * elf32-m32r.c (m32r_elf_section_flags): New function.
3630 (elf_backend_section_flags): Define.
3631 * elf32-nds32.c (nds32_elf_section_flags): New function.
3632 (elf_backend_section_flags): Define.
3633 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
3634 .sbss and .sdata sections.
3635 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
3636 for SHF_V850_GPREL sections.
3637 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
3638 FIXME.
3639 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
3640 for SHF_PARISC_SHORT sections.
3641 * elf64-ppc.c (ppc64_elf_section_flags): New function.
3642 (elf_backend_section_flags): Define.
3643 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
3644 for SHF_MIPS_GPREL sections. Delete FIXME.
3645
8c803a2d
AM
36462020-03-02 Alan Modra <amodra@gmail.com>
3647
3648 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
3649 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
3650 calling elf_backend_section_flags with adjusted params. Use
3651 newsect->flags past that point.
3652 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
3653 special sections.
3654 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
3655 to have their type overridden, and all sh_flags but processor and
3656 os specific.
3657 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
3658 * elf32-mep.c (mep_elf_section_flags): Likewise.
3659 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
3660 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
3661 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
3662 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
3663 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
3664 stub BFD and non-aarch64 input files when scanning for stubs.
3665
7d4b2d2d
AM
36662020-03-02 Alan Modra <amodra@gmail.com>
3667
3668 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
3669 limit to decompressed element size.
3670
26f60d59
AM
36712020-03-02 Alan Modra <amodra@gmail.com>
3672
3673 * vms-lib.c (vms_traverse_index): Add recur_count param and
3674 update calls. Fail on excessive recursion.
3675
9cb56943
AM
36762020-03-02 Alan Modra <amodra@gmail.com>
3677
3678 * vms-alpha.c (vms_get_remaining_object_record): Use
3679 bfd_realloc_or_free rather than bfd_realloc.
3680 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
3681 (dst_define_location, parse_module): Likewise, and check realloc
3682 return status before using memory. Return status from function
3683 adjusting all callers.
3684
182ec670
AM
36852020-02-28 Alan Modra <amodra@gmail.com>
3686
3687 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
3688
1b088c82
AM
36892020-02-28 Alan Modra <amodra@gmail.com>
3690
3691 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
3692 Remove duplicate undersize check.
3693
5f602802
AM
36942020-02-27 Alan Modra <amodra@gmail.com>
3695
3696 PR 24511
3697 * mmo.c (mmo_scan): Set SEC_DATA for .data.
3698
49d9fd42
AM
36992020-02-27 Alan Modra <amodra@gmail.com>
3700
3701 PR 24511
3702 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
3703 (coff_section_type): Adjust comment.
3704 (decode_section_type): Likewise. Call coff_section_type before
3705 decode_section_type.
3706 (bfd_decode_symclass): Use 'c' for common sections other than
3707 the standard one.
3708
05f52dc2
AM
37092020-02-27 Alan Modra <amodra@gmail.com>
3710
3711 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
3712 malloc'd block.
3713
ff69a894
AM
37142020-02-27 Alan Modra <amodra@gmail.com>
3715
3716 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
3717 if file is an archive element.
3718 * bfd-in2.h: Regenerate.
3719
02f7e7ee
AM
37202020-02-26 Alan Modra <amodra@gmail.com>
3721
3722 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
3723 bfd_set_error on failing test. Don't bother changing bfd_error on
3724 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
3725 Check sym name is within string buffer. Use size_t for some vars.
3726 (do_slurp_coff_armap): Use size_t for some variables, fix size of
3727 int_buf. Don't change bfd_error on file read error. Use
3728 _bfd_mul_overflow when calculating carsym buffer size. Reorder
3729 calculations to catch overflows before they occur. malloc and
3730 free raw armap rather than using bfd_alloc. Read raw armap before
3731 allocating carsym+strings buffer.
3732 (_bfd_slurp_extended_name_table): Localize variables. Check
3733 name size against file size.
3734
cc4c4f40
AM
37352020-02-26 Alan Modra <amodra@gmail.com>
3736
3737 * vms-lib.c (vms_lib_read_index): Release correct buffer.
3738
e0b317de
AM
37392020-02-26 Alan Modra <amodra@gmail.com>
3740
3741 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
3742 malloc. Check for NULL return from bfd_malloc.
3743 (rx_table_find, rx_table_map): Likewise.
3744 (rx_set_section_contents): Check bfd_alloc return.
3745 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
3746
dc1e8a47
AM
37472020-02-26 Alan Modra <amodra@gmail.com>
3748
3749 * aoutx.h: Indent labels correctly. Format error strings.
3750 * archive.c: Likewise.
3751 * archive64.c: Likewise.
3752 * coff-arm.c: Likewise.
3753 * coff-rs6000.c: Likewise.
3754 * coff-stgo32.c: Likewise.
3755 * cpu-arm.c: Likewise.
3756 * dwarf2.c: Likewise.
3757 * elf-ifunc.c: Likewise.
3758 * elf-properties.c: Likewise.
3759 * elf-s390-common.c: Likewise.
3760 * elf-strtab.c: Likewise.
3761 * elf.c: Likewise.
3762 * elf32-arm.c: Likewise.
3763 * elf32-bfin.c: Likewise.
3764 * elf32-cr16.c: Likewise.
3765 * elf32-csky.c: Likewise.
3766 * elf32-i386.c: Likewise.
3767 * elf32-m68k.c: Likewise.
3768 * elf32-msp430.c: Likewise.
3769 * elf32-nds32.c: Likewise.
3770 * elf32-nios2.c: Likewise.
3771 * elf32-pru.c: Likewise.
3772 * elf32-xtensa.c: Likewise.
3773 * elf64-ia64-vms.c: Likewise.
3774 * elf64-x86-64.c: Likewise.
3775 * elfcode.h: Likewise.
3776 * elfcore.h: Likewise.
3777 * elflink.c: Likewise.
3778 * elfnn-aarch64.c: Likewise.
3779 * elfnn-ia64.c: Likewise.
3780 * elfnn-riscv.c: Likewise.
3781 * elfxx-mips.c: Likewise.
3782 * elfxx-sparc.c: Likewise.
3783 * elfxx-x86.c: Likewise.
3784 * i386lynx.c: Likewise.
3785 * merge.c: Likewise.
3786 * pdp11.c: Likewise.
3787 * plugin.c: Likewise.
3788 * reloc.c: Likewise.
3789
e310298c
AM
37902020-02-26 Alan Modra <amodra@gmail.com>
3791
3792 PR 25593
3793 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
3794 "dyn_loaded".
3795 (bfd_elf_add_dt_needed_tag): Declare.
3796 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
3797 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
3798 from elf_add_dt_needed_tag. Remove soname and doit param.
3799 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
3800 to see whether as-needed lib is already loaded, use dyn_loaded
3801 list instead. When saving and restoring around as-needed lib
3802 handle possibility that dynstr has not been initialised. Don't
3803 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
3804 Mark libs loaded via DT_NEEDED entries of other libs with
3805 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
3806 the output.
3807 (elf_link_check_versioned_symbol): Remove now unneccesary
3808 DYNAMIC check when traversing dyn_loaded list.
3809
b570b954
AM
38102020-02-26 Alan Modra <amodra@gmail.com>
3811
3812 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
3813
ecda9016
L
38142020-02-25 H.J. Lu <hongjiu.lu@intel.com>
3815
3816 PR binutils/25584
3817 * plugin.c (need_lto_wrapper_p): New.
3818 (bfd_plugin_set_program_name): Add an int argument to set
3819 need_lto_wrapper_p.
3820 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
3821 set.
3822 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
3823
a98c743f
AM
38242020-02-24 Alan Modra <amodra@gmail.com>
3825
3826 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
3827
c893ce36
AM
38282020-02-24 Alan Modra <amodra@gmail.com>
3829
3830 * vms-lib.c (struct carsym_mem): Add limit.
3831 (vms_add_index): Heed limit.
3832 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
3833 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
3834 Always return actual number read.
3835 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
3836 assertion with error exit.
3837
7b3c2715
AM
38382020-02-22 Alan Modra <amodra@gmail.com>
3839
3840 PR 25585
3841 * elf.c (assign_file_positions_for_load_sections): Continue linking
3842 on "PHDR segment not covered by LOAD segment" errors.
3843
a4425a57
AM
38442020-02-21 Alan Modra <amodra@gmail.com>
3845
3846 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
3847 overflow check.
3848 (bfd_mach_o_canonicalize_reloc): Likewise.
3849 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
3850 counts and offsets against file size.
3851 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
3852 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
3853 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
3854 against file size. Delete symbol table error message.
3855 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
3856 against file size.
3857 (bfd_mach_o_read_symtab): Likewise.
3858 (bfd_mach_o_read_command): Pass file size.
3859 (bfd_mach_o_scan): Sanity check command count against file size.
3860
dda2980f
AM
38612020-02-21 Alan Modra <amodra@gmail.com>
3862
3863 PR 25569
3864 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
3865 "text", "data" and "bss" section pointer vars. Don't update
3866 section size, just exec header sizes.
3867 (adjust_sizes_and_vmas): Don't update text section size. Set
3868 initial exec header a_text. Print exec headers sizes.
3869 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
3870 (adjust_sizes_and_vmas): Similarly. Formatting.
3871 (final_link): Correct final file extension.
3872
00e49dff
NC
38732020-02-20 Nick Clifton <nickc@redhat.com>
3874
3875 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
3876 callback.
3877 * elfxx-target.h (elf_backend_symbol_section_index): Provide
3878 default definition.
3879 (elfNN_bed): Initialise the symbol_section_index field.
3880 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
3881 OS and PROC specific section indicies. Warn if converting other
3882 reserved incidies to SHN_ABS.
3883
fcaaac0a
SB
38842020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
3885
3886 PR 25537
3887 * cpu-z80.c: Add machine type compatibility checking.
3888
dcf06b89
L
38892020-02-19 H.J. Lu <hongjiu.lu@intel.com>
3890
3891 PR binutils/25355
3892 * plugin.c (plugin_list_entry): Remove handle.
3893 (try_load_plugin): Call dlclose before return.
3894
2c7c5554
AM
38952020-02-19 Alan Modra <amodra@gmail.com>
3896
3897 * libbfd-in.h (_bfd_constant_p): Define.
3898 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
3899 file size before allocating memory.
3900 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
3901 * elf.c (bfd_elf_get_str_section): Likewise.
3902 (_bfd_elf_slurp_version_tables): Likewise.
3903 * libbfd.h: Regenerate.
3904
2bb3687b
AM
39052020-02-19 Alan Modra <amodra@gmail.com>
3906
3907 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
3908 * aoutx.h (aout_get_external_symbols): Replace calls to
3909 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
3910 (slurp_reloc_table): Likewise.
3911 * archive.c (do_slurp_bsd_armap): Likewise.
3912 (do_slurp_coff_armap): Likewise.
3913 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
3914 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
3915 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
3916 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3917 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3918 (_bfd_coff_get_external_symbols): Likewise.
3919 * ecoff.c (ecoff_slurp_symbolic_header),
3920 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3921 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3922 (ecoff_indirect_link_order): Likewise.
3923 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3924 (_bfd_elf_slurp_version_tables): Likewise.
3925 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3926 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3927 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3928 * elf64-alpha.c (READ): Likewise.
3929 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3930 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3931 * elfcode.h (elf_slurp_symbol_table),
3932 (elf_slurp_reloc_table_from_section): Likewise.
3933 * elflink.c (elf_link_add_object_symbols),
3934 (elf_link_check_versioned_symbol): Likewise.
3935 * elfxx-mips.c (READ): Likewise.
3936 * i386lynx.c (slurp_reloc_table): Likewise.
3937 * lynx-core.c (lynx_core_file_p): Likewise.
3938 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3939 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3940 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3941 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3942 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3943 (bfd_pef_parse_symbols): Likewise.
3944 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3945 * som.c (setup_sections, som_slurp_string_table),
3946 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3947 (som_bfd_fill_in_ar_symbols): Likewise.
3948 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3949 (evax_bfd_print_image): Likewise.
3950 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3951 * wasm-module.c (wasm_scan): Likewise.
3952 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3953 * xsym.c (bfd_sym_read_name_table),
3954 (bfd_sym_print_type_information_table_entry): Likewise.
3955 * libbfd.h: Regenerate.
3956
806470a2
AM
39572020-02-19 Alan Modra <amodra@gmail.com>
3958
3959 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3960 reading external relocs.
3961 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3962 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3963 after bfd_bread.
3964 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3965 bfd_release.
3966 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3967 (m32c_elf_relax_section): Likewise.
3968 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3969 (rl78_elf_relax_section): Likewise.
3970 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3971 (elf32_rx_relax_section): Likewise.
3972 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3973 parameter types and use..
3974 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
3975 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
3976 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
3977 being read from file, just the extra.
3978 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
3979 after reading external syms. Free on failure.
3980
1f4361a7
AM
39812020-02-19 Alan Modra <amodra@gmail.com>
3982
3983 * coffcode.h (buy_and_read, coff_slurp_line_table),
3984 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
3985 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
3986 corresponding bfd_alloc call. Adjust variables to suit.
3987 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3988 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
3989 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
3990 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
3991 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
3992 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3993 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3994 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3995 * elf64-alpha.c (READ): Likewise.
3996 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
3997 (elf_slurp_symbol_table, elf_slurp_reloc_table),
3998 (bfd_from_remote_memory): Likewise.
3999 * elfcore.h (core_find_build_id): Likewise.
4000 * elfxx-mips.c (READ): Likewise.
4001 * mach-o.c (bfd_mach_o_mangle_sections),
4002 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
4003 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
4004 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
4005 * som.c (setup_sections, som_prep_for_fixups)
4006 (som_build_and_write_symbol_table, som_slurp_symbol_table),
4007 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
4008 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
4009 (som_bfd_ar_write_symbol_stuff): Likewise.
4010 * vms-alpha.c (vector_grow1): Likewise.
4011 * vms-lib.c (vms_add_index): Likewise.
4012 * wasm-module.c (wasm_scan_name_function_section): Likewise.
4013 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
4014 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
4015 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
4016 (bfd_alloc2, bfd_zalloc2): Delete.
4017 (_bfd_mul_overflow): Define.
4018 * libbfd.h: Regenerate.
4019
446f7ed5
AM
40202020-02-19 Alan Modra <amodra@gmail.com>
4021
4022 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
4023 bfd_zalloc2.
4024 (assign_section_numbers): Likewise.
4025 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
4026 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
4027 bfd_malloc2, size_t amt, and unsigned tls_count.
4028 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
4029 * elflink.c (elf_create_symbuf): Use bfd_malloc.
4030 (elf_output_implib): Use bfd_alloc.
4031
b03202e3
AM
40322020-02-19 Alan Modra <amodra@gmail.com>
4033
4034 * bfd.c (struct bfd): Move format and direction to other
4035 bitfields. Add "size".
4036 * bfdio.c (bfd_get_size): Cache size when not writing file.
4037 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
4038 returning zero, ie. unknown.
4039 (bfd_get_alt_debug_link_info): Likewise.
4040 * bfd-in2.h: Regenerate.
4041
7c5fa58e
AM
40422020-02-19 Alan Modra <amodra@gmail.com>
4043
4044 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
4045 bfd_get_file_size twice.
4046 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
4047 zero, ie. unknown, return.
4048 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
4049 * elfcode.h (elf_swap_shdr_in): Likewise.
4050 (elf_object_p): Don't call bfd_get_file_size twice and correct
4051 file size check.
4052
96d3b80f
AM
40532020-02-19 Alan Modra <amodra@gmail.com>
4054
4055 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
4056 FALSE if memory alloc fails. Adjust calls.
4057 * som.c (som_prep_for_fixups): Likewise.
4058 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
4059 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
4060 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
4061 * som.c (som_build_and_write_symbol_table): Return via error_return
4062 on seek failure.
4063 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
4064 (VEC_APPEND_EL): Delete.
4065 (vector_grow1): Return pointer to element. Catch overflow.
4066 Return NULL on memory allocation failure.
4067 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
4068 (alpha_vms_add_fixup_ca): Likewise.
4069 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
4070 before using.
4071 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
4072
986f0783
AM
40732020-02-19 Alan Modra <amodra@gmail.com>
4074
4075 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
4076 * aout-target.h (object_p): Likewise.
4077 * aout-tic30.c (tic30_aout_object_p): Likewise.
4078 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
4079 (emit_stringtab, write_syms, link_hash_table_create),
4080 (aout_link_write_other_symbol): Likewise.
4081 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
4082 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
4083 (_bfd_compute_and_write_armap): Likewise.
4084 * archures.c (bfd_arch_list): Likewise.
4085 * bfd.c (bfd_record_phdr): Likewise.
4086 * binary.c (binary_canonicalize_symtab): Likewise.
4087 * cisco-core.c (cisco_core_file_validate): Likewise.
4088 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
4089 (find_arm_glue, record_arm_to_thumb_glue),
4090 (record_thumb_to_arm_glue): Likewise.
4091 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
4092 (ppc_allocate_toc_section): Likewise.
4093 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
4094 * coff-sh.c (sh_relax_section): Likewise.
4095 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
4096 * coffcode.h (handle_COMDAT, coff_new_section_hook),
4097 (coff_set_alignment_hook, coff_mkobject),
4098 (coff_compute_section_file_positions): Likewise.
4099 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
4100 (coff_find_nearest_line_with_names),
4101 ( bfd_coff_set_symbol_class): Likewise.
4102 * cofflink.c (_bfd_coff_link_hash_table_create),
4103 (_bfd_coff_link_input_bfd): Likewise.
4104 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
4105 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
4106 (build_line_info_table, sort_line_sequences),
4107 (line_info_add_include_dir, line_info_add_file_name),
4108 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
4109 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
4110 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
4111 (_bfd_ecoff_find_nearest_line),
4112 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
4113 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
4114 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
4115 * elf-m10300.c (mn10300_elf_relax_section),
4116 (elf32_mn10300_link_hash_table_create): Likewise.
4117 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
4118 * elf.c (make_mapping, copy_elf_program_header): Likewise.
4119 * elf32-arm.c (elf32_arm_link_hash_table_create),
4120 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
4121 (elf32_arm_new_section_hook): Likewise.
4122 * elf32-avr.c (elf_avr_new_section_hook),
4123 (elf32_avr_link_hash_table_create, get_local_syms),
4124 (elf32_avr_setup_section_lists): Likewise.
4125 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
4126 (bfin_link_hash_table_create): Likewise.
4127 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
4128 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
4129 * elf32-csky.c (csky_elf_link_hash_table_create),
4130 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
4131 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
4132 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
4133 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
4134 * elf32-i386.c (elf_i386_check_relocs): Likewise.
4135 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
4136 * elf32-m32r.c (m32r_elf_link_hash_table_create),
4137 (m32r_elf_check_relocs): Likewise.
4138 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
4139 (elf32_m68hc11_setup_section_lists),
4140 (elf32_m68hc11_size_stubs): Likewise.
4141 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
4142 * elf32-metag.c (elf_metag_link_hash_table_create),
4143 (elf_metag_setup_section_lists): Likewise.
4144 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
4145 (microblaze_elf_check_relocs): Likewise.
4146 * elf32-nds32.c (nds32_elf_link_hash_table_create),
4147 (nds32_elf_check_relocs): Likewise.
4148 * elf32-nios2.c (nios2_elf32_setup_section_lists),
4149 (get_local_syms, nios2_elf32_check_relocs),
4150 (nios2_elf32_link_hash_table_create): Likewise.
4151 * elf32-or1k.c (or1k_elf_link_hash_table_create),
4152 (or1k_elf_check_relocs): Likewise.
4153 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
4154 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
4155 * elf32-s390.c (elf_s390_link_hash_table_create),
4156 (elf_s390_check_relocs): Likewise.
4157 * elf32-score.c (score_elf_create_got_section),
4158 (s3_elf32_score_new_section_hook),
4159 (elf32_score_link_hash_table_create): Likewise.
4160 * elf32-score7.c (score_elf_create_got_section),
4161 (s7_elf32_score_new_section_hook): Likewise.
4162 * elf32-sh.c (sh_elf_link_hash_table_create),
4163 (sh_elf_check_relocs): Likewise.
4164 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
4165 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
4166 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
4167 (tilepro_elf_check_relocs): Likewise.
4168 * elf32-v850.c (remember_hi16s_reloc): Likewise.
4169 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
4170 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
4171 (elf_xtensa_new_section_hook): Likewise.
4172 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
4173 (get_got_entry, elf64_alpha_check_relocs): Likewise.
4174 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
4175 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
4176 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
4177 * elf64-ppc.c (ppc64_elf_new_section_hook),
4178 (ppc64_elf_link_hash_table_create, update_local_sym_info),
4179 (update_plt_info, ppc64_elf_check_relocs): Likewise.
4180 * elf64-s390.c (elf_s390_link_hash_table_create),
4181 (elf_s390_check_relocs): Likewise.
4182 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
4183 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
4184 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
4185 (elf_link_add_archive_symbols, compute_bucket_count),
4186 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
4187 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
4188 (bfd_elf_final_link): Likewise.
4189 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
4190 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
4191 (elfNN_aarch64_new_section_hook): Likewise.
4192 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
4193 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
4194 (riscv_elf_check_relocs): Likewise.
4195 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
4196 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
4197 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
4198 (_bfd_mips_elf_link_hash_table_create): Likewise.
4199 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
4200 (_bfd_sparc_elf_check_relocs),
4201 (_bfd_sparc_elf_new_section_hook): Likewise.
4202 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
4203 (tilegx_elf_check_relocs): Likewise.
4204 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
4205 * format.c (bfd_check_format_matches): Likewise.
4206 * hash.c (_bfd_stringtab_init): Likewise.
4207 * ihex.c (ihex_scan): Likewise.
4208 * irix-core.c (irix_core_core_file_p): Likewise.
4209 * linker.c (bfd_wrapped_link_hash_lookup),
4210 (_bfd_generic_link_hash_table_create),
4211 (_bfd_generic_reloc_link_order): Likewise.
4212 * lynx-core.c (lynx_core_file_p): Likewise.
4213 * netbsd-core.c (netbsd_core_file_p): Likewise.
4214 * osf-core.c (osf_core_core_file_p): Likewise.
4215 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
4216 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
4217 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
4218 * peicode.h (pe_mkobject): Likewise.
4219 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
4220 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
4221 * sco5-core.c (read_uarea): Likewise.
4222 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
4223 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
4224 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
4225 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
4226 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
4227 * srec.c (srec_scan): Likewise.
4228 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
4229 * targets.c (bfd_target_list): Likewise.
4230 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
4231 * trad-core.c (trad_unix_core_file_p): Likewise.
4232 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
4233 (vms_new_section_hook): Likewise.
4234 * wasm-module.c (wasm_make_empty_symbol): Likewise.
4235 * xcofflink.c (xcoff_get_section_contents),
4236 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
4237 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
4238 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
4239
2d0e1217
AM
42402020-02-19 Alan Modra <amodra@gmail.com>
4241
4242 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
4243
99845b3b
L
42442020-02-13 H.J. Lu <hongjiu.lu@intel.com>
4245
4246 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
4247 and use it if it isn't NULL. Remove has_plugin_p argument. Add
4248 a build_list_p argument. Don't search plugin_list. Short circuit
4249 when building the plugin list.
4250 (has_plugin): Renamed to has_plugin_list.
4251 (bfd_plugin_set_plugin): Don't set has_plugin.
4252 (bfd_plugin_specified_p): Check plugin_list instead.
4253 (build_plugin_list): New function.
4254 (load_plugin): Call build_plugin_list and use plugin_list.
4255
22fe7df8
L
42562020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4257
4258 PR binutils/25355
4259 * plugin.c (try_claim): Always clean up for LTO wrapper.
4260 (try_load_plugin): Treat each object as independent. Create a
4261 copy for plugin name.
4262
c675ec1e
NC
42632020-02-11 Nick Clifton <nickc@redhat.com>
4264
4265 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
4266 for addresses in print statements.
4267 (msp430_elf_relax_delete_bytes): Likewise.
4268 (msp430_elf_relax_add_words): Likewise.
4269 (msp430_elf_relax_section): Likewise.
4270
1d07a805
L
42712020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4272
4273 * plugin.c (add_symbols): Clear plugin_data memory.
4274
0aa99dcd
L
42752020-02-10 H.J. Lu <hongjiu.lu@intel.com>
4276
4277 PR binutils/25355
4278 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
4279 (EXECUTABLE_SUFFIX): Likewise.
4280 * config.in: Regenerated.
4281 * configure: Likewise.
4282 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
4283 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
4284 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
4285 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
4286 (get_lto_wrapper): New.
4287 (setup_lto_wrapper_env): Likewise.
4288 (current_plugin): Likewise.
4289 (register_all_symbols_read): Likewise.
4290 (register_cleanup): Likewise.
4291 (get_symbols): Likewise.
4292 (add_input_file): Likewise.
4293 (bfd_plugin_close_and_cleanup): Likewise.
4294 (claim_file): Removed.
4295 (register_claim_file): Set current_plugin->claim_file.
4296 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
4297 lto_syms in current_plugin.
4298 (try_claim): Use current_plugin->claim_file. Call LTO plugin
4299 all_symbols_read handler. Copy real symbols to plugin_data.
4300 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
4301 (try_load_plugin): Don't reuse the previous plugin for LTO
4302 wrapper. Set up GCC LTO wrapper if possible. Don't set
4303 plugin_list_iter->claim_file.
4304 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
4305 possible.
4306 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
4307 real_syms.
4308
ac4280da
JL
43092020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4310
4311 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
4312 check if previous instruction matches a conditional jump inserted
4313 earlier. Invert conditional jump and delete branch in this case.
4314
8d6cb116
JL
43152020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4316
4317 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
4318 msp430_elf_relax_add_words. Support insertion of either one or two
4319 words.
4320 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
4321 needs to be grown. Handle insertion of branch instruction to replace
4322 jump.
4323
d60f5448
JL
43242020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
4325
4326 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
4327 debugging relocations.
4328 (msp430_elf_relax_delete_bytes): Likewise.
4329 (msp430_elf_relax_add_two_words): Likewise.
4330 (msp430_elf_relax_section): Likewise.
4331
e1f85e11
AM
43322020-02-10 Alan Modra <amodra@gmail.com>
4333
4334 * archures.c: Wrap overlong z80 comments.
4335 * bfd-in2.h: Regenerate.
4336
9fc0b501
SB
43372020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
4338
4339 PR 25469
4340 * archures.c: Add GBZ80 and Z80N machine values.
4341 * reloc.c: Add BFD_RELOC_Z80_16_BE.
4342 * coff-z80.c: Add support for new reloc.
4343 * coffcode.h: Add support for new machine values.
4344 * cpu-z80.c: Add support for new machine names.
4345 * elf32-z80.c: Add support for new reloc.
4346 * bfd-in2.h: Regenerate.
4347 * libbfd.h: Regenerate.
4348
9984857c
NC
43492020-02-07 Nick Clifton <nickc@redhat.com>
4350
4351 PR 23932
4352 * elf.c (rewrite_elf_program_header): Do not complain if no
4353 sections are mapped to a segment.
4354
5242a0a0
L
43552020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4356
4357 PR ld/25490
4358 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
4359 for garbage collection on __patchable_function_entries section
4360 without linked-to section.
4361
b7d07216
L
43622020-02-06 H.J. Lu <hongjiu.lu@intel.com>
4363
4364 PR gas/25381
4365 * bfd-in2.h: Regenerated.
4366 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
4367 on section if gc_mark of any of its linked-to sections is set
4368 and don't set gc_mark again.
4369 * section.c (asection): Add linked_to_symbol_name to map_head
4370 union.
4371
b93a662b
MR
43722020-02-06 Maciej W. Rozycki <macro@wdc.com>
4373
4374 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
4375 reporting an unrecognized instruction with R_V850_LONGJUMP.
4376
6df4c9c2
AM
43772020-02-05 Alan Modra <amodra@gmail.com>
4378
4379 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
4380
24872cb3
AM
43812020-02-04 Alan Modra <amodra@gmail.com>
4382
4383 * elf32-ppc.c (ppc_elf_relocate_section): After applying
4384 R_PPC_VLE_ADDR20, goto copy_reloc.
4385
ef4627fa
L
43862020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4387
4388 * bfd-in2.h: Regenerated.
4389 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
4390
a8c4d40b
L
43912020-02-02 H.J. Lu <hongjiu.lu@intel.com>
4392
4393 PR gas/25380
4394 * bfd-in2.h: Regenerated.
4395 * ecoff.c (bfd_debug_section): Add section_id.
4396 * section.c (bfd_section): Add section_id.
4397 (SEC_ASSEMBLER_SECTION_ID): New.
4398 (BFD_FAKE_SECTION): Add section_id.
4399
5a9212a1
NC
44002020-02-01 Nick Clifton <nickc@redhat.com>
4401
4402 * config.bfd: Move the c30-aout and tic30-aout targets onto the
4403 obsolete list.
4404
e7cbe0c4
SL
44052020-01-31 Sandra Loosemore <sandra@codesourcery.com>
4406
4407 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
4408 encodings are relative to the GOT on nios2, too.
4409
72ebe8c5
AM
44102020-01-31 Alan Modra <amodra@gmail.com>
4411
4412 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
4413 file. Use $< and $@ in rules.
4414 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
4415 (elf32-ia64.c, elf64-ia64.c): Likewise.
4416 (elf32-riscv.c, elf64-riscv.c): Likewise.
4417 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4418 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
4419 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
4420 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
4421 (peigen.c, pepigen.c, pex64igen.c): Likewise.
4422 * Makefile.in: Regenerate.
4423
327301a4
AM
44242020-01-31 Alan Modra <amodra@gmail.com>
4425
4426 PR 4110
4427 * elf.c (setup_group): Don't clear entire section contents,
4428 just the padding after group flags. Release alloc'd memory
4429 after a seek or read failure.
4430
b5d36aaa
JT
44312020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4432
4433 * peXXigen.c (pe_is_repro): New function.
4434 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
4435 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
4436
1957ab10
JT
44372020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4438
4439 * peXXigen.c (debug_type_names): Add names for new debug data type
4440 values.
4441
87b2920f
JT
44422020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
4443
4444 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
4445 inner loop. Fix a memory leak.
4446
72913831
AM
44472020-01-30 Alan Modra <amodra@gmail.com>
4448
4449 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
4450 or obj_coff_keep_strings here.
4451 (coff_get_normalized_symtab): Free external syms directly.
4452 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
4453 on error exit path.
4454
c35d018b
JW
44552020-01-27 Jim Wilson <jimw@sifive.com>
4456
4457 * cpu-riscv.c (riscv_scan): New.
4458 (N): Change bfd_default_scan to riscv_scan.
4459
086b06f3
AS
44602020-01-27 Andreas Schwab <schwab@suse.de>
4461
4462 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
4463 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
4464 * Makefile.in: Regenerate.
4465 * cpu-plugin.c: Remove.
4466 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
4467 (bfd_plugin_arch): Remove declaration.
4468 * bfd-in2.h: Regenerate.
4469 * po/SRC-POTFILES.in: Regenerate.
4470
3024a17a
AM
44712020-01-27 H.J. Lu <hongjiu.lu@intel.com>
4472 Alan Modra <amodra@gmail.com>
4473
4474 PR ld/25458
4475 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
4476
b5f998b2
JW
44772020-01-24 Jim Wilson <jimw@sifive.com>
4478
4479 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
4480 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
4481 avoid over long line.
4482
caa31cfa
NC
44832020-01-24 Nick Clifton <nickc@redhat.com>
4484
4485 PR 25447
4486 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
4487 syms and keep strings flags as these may have been set in order to
4488 prevent a bogus call to free.
4489
24e648d4
NC
44902020-01-23 Nick Clifton <nickc@redhat.com>
4491
4492 * po/fr.po: Updated French translation.
4493
67641dd3
AM
44942020-01-23 Alan Modra <amodra@gmail.com>
4495
4496 PR 25444
4497 * elf.c (assign_file_positions_for_load_sections): Avoid divide
4498 by zero when p_align is zero.
4499
403d1bd9
JW
45002020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
4501
4502 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
4503 (riscv_prefix_cmp): Likewise.
4504 (riscv_non_std_ext_p): Deleted.
4505 (riscv_std_sv_ext_p): Likewise.
4506 (riscv_non_std_sv_ext_p): Likewise.
4507 (riscv_merge_non_std_and_sv_ext): Rename to...
4508 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
4509 (riscv_merge_arch_attr_info): Replace 3 calls to
4510 riscv_merge_non_std_and_sv_ext with single call to
4511 riscv_merge_multi_letter_ext.
4512 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
4513 encounter a 'z' prefix.
4514 (riscv_get_prefix_class): New function, return prefix class based
4515 on first few characters of input string.
4516 (riscv_parse_config): New structure to factor out minor differences
4517 in extension class parsing behaviour.
4518 (riscv_parse_sv_or_non_std_ext): Rename to...
4519 (riscv_parse_prefixed_ext): and parameterise with
4520 riscv_parse_config.
4521 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
4522 (riscv_multi_letter_ext_valid_p): New.
4523 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
4524 (riscv_parse_subset): Delegate all non-single-letter parsing work
4525 to riscv_parse_prefixed_ext.
4526 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
4527 (riscv_get_prefix_class): Declare.
4528
a804e476
AM
45292020-01-22 Alan Modra <amodra@gmail.com>
4530
4531 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
4532 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
4533 __tls_get_addr_desc.
4534 (ppc64_elf_size_stubs): Add section for linker generated
4535 __tls_get_addr_desc wrapper function. Loop at least once if
4536 generating this function.
4537 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
4538 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
4539
9e7028aa
AM
45402020-01-22 Alan Modra <amodra@gmail.com>
4541
4542 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
4543 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
4544 tga_desc_fd.
4545 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
4546 (STDU_R1_0R1, ADDI_R1_R1): Define.
4547 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
4548 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
4549 tga_desc_fd to opt_fd, and tga_desc to opt. Set
4550 no_tls_get_addr_regsave.
4551 (branch_reloc_hash_match): Add hash3 and hash4.
4552 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
4553 (ppc64_elf_size_dynamic_sections): Likewise.
4554 (ppc64_elf_relocate_section): Likewise.
4555 (plt_stub_size, build_plt_stub): Likewise. Size regsave
4556 __tls_get_addr stub.
4557 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
4558 eh_frame.
4559 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
4560 eh_frame for regsave __tls_get_addr.
4561
abc489c6
AM
45622020-01-22 Alan Modra <amodra@gmail.com>
4563
4564 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
4565 which __tls_get_addr calls will be eliminated.
4566
26916852
NC
45672020-01-20 Nick Clifton <nickc@redhat.com>
4568
4569 * po/pt.po: Updates Portuguese translation.
4570 * po/ru.po: Updated Russian translation.
4571 * po/uk.po: Updated Ukranian translation.
4572
14470f07
L
45732020-01-20 H.J. Lu <hongjiu.lu@intel.com>
4574
4575 PR ld/25416
4576 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
4577 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
4578 X32 mode.
4579 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
4580 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
4581 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
4582 "rex leal x@tlsdesc(%rip), %reg" to
4583 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
4584 "call *(%eax)" to "nopl (%rax)".
4585
b9ca1af6
AM
45862020-01-20 Alan Modra <amodra@gmail.com>
4587
4588 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
4589 (MTLR_R11): Don't define.
4590 (LD_R0_0R3, CMPDI_R0_0): Define.
4591 (build_tls_get_addr_stub): Don't use r11 in stub.
4592
ed7007c1
AM
45932020-01-20 Alan Modra <amodra@gmail.com>
4594
4595 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
4596 (defined_sym_val, is_tls_get_addr): Likewise.
4597
1b1bb2c6
NC
45982020-01-18 Nick Clifton <nickc@redhat.com>
4599
4600 * version.m4 (BFD_VERSION): Set to 2.34.50.
4601 * configure: Regenerate.
4602 * po/bfd.pot: Regenerate.
4603
ae774686
NC
46042020-01-18 Nick Clifton <nickc@redhat.com>
4605
4606 Binutils 2.34 branch created.
4607
07f1f3aa
CB
46082020-01-17 Christian Biesinger <cbiesinger@google.com>
4609
4610 * coff-arm.c: Fix spelling error (seperate).
4611 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
4612 error (seperate).
4613 * sysdep.h (strnlen): Fix spelling error (seperate).
4614
0d1cc75d
LB
46152020-01-15 Lars Brinkhoff <lars@nocrew.org>
4616
4617 PR 20694
4618 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
4619
e1c6cf61
AM
46202020-01-15 Alan Modra <amodra@gmail.com>
4621
4622 PR 25384
4623 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
4624 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
4625 of function symbols unless dot symbols are present. Do warn
4626 whenever one is created, regardles of whether a PLT entry is
4627 also emitted for the function symbol.
4628
ef4e5ba5
AM
46292020-01-14 Alan Modra <amodra@gmail.com>
4630
4631 * som.c (som_bfd_count_ar_symbols): Error when file position
4632 of symbols on chains is not strictly increasing.
4633
8ab484c2
AM
46342020-01-14 Alan Modra <amodra@gmail.com>
4635
4636 * vms.h (VMS_DEBUG): Define as 0.
4637 * vms-alpha.c (image_write): Move debug output after bounds check.
4638 Tidy bounds check.
4639 (_bfd_vms_slurp_eihd): Warning fix.
4640 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
4641
b50ef514
AM
46422020-01-13 Alan Modra <amodra@gmail.com>
4643
4644 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
4645 for "ignored" records.
4646
0c0adcc5
AM
46472020-01-13 Alan Modra <amodra@gmail.com>
4648
4649 * wasm-module.c (wasm_scan_name_function_section): Formatting.
4650 Delete asect name check. Move asect NULL check to wasm_object_p.
4651 Correct bounds check of sizes against end. Replace uses of
4652 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
4653 just one bfd_release.
4654 (wasm_scan): Don't use malloc/strdup for section names,
4655 bfd_alloc instead. Simplify code prefixing section name.
4656 Formatting. Don't attempt to free memory here..
4657 (wasm_object_p): ..do so here.
4658
7f026732
SN
46592020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
4660
4661 PR ld/22269
4662 * elf32-arm.c (elf32_arm_final_link_relocate): Use
4663 UNDEFWEAK_NO_DYNAMIC_RELOC.
4664 (allocate_dynrelocs_for_symbol): Likewise.
4665
8cd0e5e9
TC
46662020-01-10 Tamar Christina <tamar.christina@arm.com>
4667
4668 PR 25210
4669 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
4670
71780f45
AM
46712020-01-10 Alan Modra <amodra@gmail.com>
4672
4673 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
4674
b899eb3b
NC
46752020-01-09 Nick Clifton <nickc@redhat.com>
4676
4677 PR 25221
4678 * bfd.c (bfd_convert_section_contents): Check for a compress
4679 header size that is larger than the actual section size.
4680
4c6ee646
AM
46812020-01-08 Alan Modra <amodra@gmail.com>
4682
4683 PR 25351
4684 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
4685 after removing sections.
4686
85f78364
JW
46872020-01-06 Jim Wilson <jimw@sifive.com>
4688
4689 PR 25205
4690 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
4691 check for !bfd_link_pic (info).
4692 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
4693 <R_RISCV_JAL>: Add comment.
4694 (_bfd_riscv_relax_section): For plt.offset check, add check for
4695 bfd_link_pic (info). Add comment.
4696
49078ece
AM
46972020-01-06 Alan Modra <amodra@gmail.com>
4698
4699 * format.c (bfd_check_format_matches): Ignore bfd_error on target
4700 match failures. Don't init to bfd_error_wrong_format before
4701 calling _bfd_check_format.
4702
ab356be7
AM
47032020-01-06 Alan Modra <amodra@gmail.com>
4704
4705 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
4706 status rather than exiting on stack overflow or underflow.
4707 (_bfd_vms_slurp_etir): Adjust to suit.
4708
85d86817
AM
47092020-01-06 Alan Modra <amodra@gmail.com>
4710
4711 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
4712
3e6aa775
AM
47132020-01-06 Alan Modra <amodra@gmail.com>
4714
4715 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
4716 command. Check name offset is within command.
4717 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
4718 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
4719 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
4720 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
4721 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
4722 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
4723 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
4724 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
4725 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
4726 (bfd_mach_o_read_segment): Similarly.
4727 (bfd_mach_o_read_thread): Properly bound check thread struct.
4728 Don't repeat checks on second loop.
4729 (bfd_mach_o_read_command): Fail on invalid command length.
4730
ea933f17
AM
47312020-01-04 Alan Modra <amodra@gmail.com>
4732
4733 * format.c (bfd_check_format_matches): Add preserve_match.
4734 Save initial bfd state in "preserve", matched bfd state in
4735 "preserve_match". Save just the first match. Release
4736 bfd_alloc memory. Restore and finish preserved state as
4737 appropriate on all function exit paths.
4738
f24bdec4
AM
47392020-01-04 Alan Modra <amodra@gmail.com>
4740
4741 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
4742
991fb595
AM
47432020-01-04 Alan Modra <amodra@gmail.com>
4744
4745 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
4746 match too.
4747
f2a3559d
NC
47482020-01-03 Nick Clifton <nickc@redhat.com>
4749
4750 PR 25307
4751 (bfd_pef_parse_function_stubs): Correct the test that ensures that
4752 there is enough data remaining in the code buffer before
4753 attempting to read a function stub.
4754
7a0fb7be
NC
47552020-01-03 Nick Clifton <nickc@redhat.com>
4756
4757 PR 25308
4758 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
4759 return value from bfd_malloc.
4760 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
4761 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
4762 (elf32_arm_filter_cmse_symbols): Likewise.
4763 (elf32_arm_write_section): Likewise.
4764 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
4765 (bfd_mach_o_follow_dsym): Likewise.
4766 * pef.c (bfd_pef_print_loader_section): Likewise.
4767 (bfd_pef_scan_start_address): Likewise.
4768 (bfd_pef_parse_function_stubs): Likewise.
4769 (bfd_pef_parse_symbols): Likewise.
4770
b26a3d58
ST
47712020-01-03 Sergei Trofimovich <siarheit@google.com>
4772
4773 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
4774 on binary inputs ld/PR25316.
4775 (is_ia64_elf): new helper to filter on ia64 objects.
4776
4bb7a87e
JB
47772020-01-03 Jan Beulich <jbeulich@suse.com>
4778
4779 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
4780 in parameter names.
4781 (bfd_mach_o_scan): Insert underscore in two variable names.
4782
6655dba2
SB
47832020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
4784
4785 * Makefile.am: Add z80-elf target support.
4786 * configure.ac: Likewise.
4787 * targets.c: Likewise.
4788 * Makefile.in: Regenerate.
4789 * configure: Regenerate.
4790 * config.bfd: Add z80-elf target support and new arches: ez80 and
4791 z180.
4792 * elf32-z80.c: New file.
4793 * archures.c: Add new z80 architectures: eZ80 and Z180.
4794 * coffcode.h: Likewise.
4795 * cpu-z80.c: Likewise.
4796 * coff-z80.c: Add new relocations for Z80 target and local label
4797 check.
4798 * reloc.c: Add new relocs.
4799 * bfd-in2.h: Regenerate.
4800 * libbfd.h: Regenerate.
4801
0db131fb
TC
48022020-01-02 Tamar Christina <tamar.christina@arm.com>
4803
4804 PR 25210
4805 PR 24753
4806 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
4807
b14ce8bf
AM
48082020-01-01 Alan Modra <amodra@gmail.com>
4809
4810 Update year range in copyright notice of all files.
4811
0b114740 4812For older changes see ChangeLog-2019
3499769a 4813\f
0b114740 4814Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
4815
4816Copying and distribution of this file, with or without modification,
4817are permitted in any medium without royalty provided the copyright
4818notice and this notice are preserved.
4819
4820Local Variables:
4821mode: change-log
4822left-margin: 8
4823fill-column: 74
4824version-control: never
4825End: