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