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