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