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