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