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