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