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