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