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