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