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