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