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