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