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