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