1 2020-06-15 Roland McGrath <mcgrathr@google.com>
3 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
4 field of bfd_link_info.
6 2020-06-15 Alan Modra <amodra@gmail.com>
8 * config.bfd: Obsolete powerpcle-*-pe targets.
10 2020-06-15 Alan Modra <amodra@gmail.com>
13 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
14 symbols that were defined in discarded sections.
15 * cofflink.c (coff_link_check_archive_element): Likewise.
16 (coff_link_add_symbols): Set indx to -3 for symbols defined in
18 (_bfd_coff_write_global_sym): Don't emit such symbols.
19 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
20 libcoff.h: Regenerate.
22 2020-06-11 Alan Modra <amodra@gmail.com>
25 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
27 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
29 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
30 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
31 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
34 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
37 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
40 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
43 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
44 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
45 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
47 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
48 Set ifunc_resolvers if there are FUNC resolvers.
49 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
50 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
51 with elf.ifunc_resolvers.
52 (write_plt_relocs_for_local_syms): Likewise.
53 (ppc64_elf_relocate_section): Likewise.
54 (ppc64_elf_finish_dynamic_sections): Likewise.
55 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
57 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
58 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
59 instead of readonly_dynrelocs_against_ifunc.
60 * elfxx-x86.h (elf_x86_link_hash_table): Remove
61 readonly_dynrelocs_against_ifunc.
63 2020-06-09 Alan Modra <amodra@gmail.com>
65 * elf64-ppc.c (struct ppc_link_hash_table): Delete
66 maybe_local_ifunc_resolver field.
67 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
68 cases where maybe_local_ifunc_resolver was set.
69 (ppc64_elf_relocate_section): Likewise.
70 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
73 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
75 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
77 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
79 (elf32_arm_size_dynamic_sections): Updated. Clear
80 root.tlsdesc_plt for DF_BIND_NOW.
81 (elf32_arm_finish_dynamic_sections): Updated.
82 (elf32_arm_output_arch_local_syms): Likewise.
83 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
84 Clear root.tlsdesc_plt for DF_BIND_NOW.
85 (nds32_elf_finish_dynamic_sections): Updated.
86 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
87 dt_tlsdesc_plt and dt_tlsdesc_got.
88 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
89 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
90 tlsdesc_plt and dt_tlsdesc_got.
91 (elfNN_aarch64_allocate_dynrelocs): Updated.
92 (elfNN_aarch64_finish_dynamic_sections): Likewise.
93 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
94 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
96 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
97 (_bfd_x86_elf_size_dynamic_sections): Likewise.
98 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
99 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
102 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
104 * elf32-tic6x.c (elf32_bed): Defined the default to
107 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
109 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
111 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
112 root.splt/root.srelplt.
113 (elf64_hppa_create_dynamic_sections): Likewise.
114 (elf64_hppa_size_dynamic_sections): Likewise.
115 (elf64_hppa_finish_dynamic_symbol): Likewise.
116 (elf_hppa_final_link): Likewise.
117 (elf_hppa_final_link_relocate): Likewise.
119 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
121 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
122 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
125 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
127 * elf-bfd.h (elf_target_os): New.
128 (elf_link_hash_table): Add target_os.
129 (elf_backend_data): Add target_os.
130 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
131 symbian_p and nacl_p.
132 (create_got_section): Updated.
133 (elf32_arm_create_dynamic_sections): Likewise.
134 (arm_type_of_stub): Likewise.
135 (elf32_arm_create_or_find_stub_sec): Likewise.
136 (elf32_arm_allocate_plt_entry): Likewise.
137 (elf32_arm_populate_plt_entry): Likewise.
138 (elf32_arm_final_link_relocate): Likewise.
139 (elf32_arm_check_relocs): Likewise.
140 (allocate_dynrelocs_for_symbol): Likewise.
141 (elf32_arm_finish_dynamic_symbol): Likewise.
142 (elf32_arm_finish_dynamic_sections): Likewise.
143 (elf32_arm_output_plt_map_1): Likewise.
144 (elf32_arm_output_arch_local_syms): Likewise.
145 (elf32_arm_add_symbol_hook): Likewise.
146 (elf32_arm_nacl_link_hash_table_create): Likewise.
147 (elf32_arm_vxworks_link_hash_table_create): Likewise.
148 (elf32_arm_symbian_link_hash_table_create): Likewise.
149 (ELF_TARGET_OS): New.
150 * elf32-i386.c (elf_i386_arch_bed): Removed.
151 (elf_backend_arch_data): Likewise.
152 (elf_i386_solaris_arch_bed): Likewise.
153 (elf_i386_nacl_arch_bed): Likewise.
154 (elf_i386_vxworks_arch_bed): Likewise.
155 (elf_i386_relocate_section): Updated.
156 (elf_i386_finish_dynamic_sections): Likewise.
157 (elf_i386_get_synthetic_symtab): Likewise.
158 (elf_i386_link_setup_gnu_properties): Likewise.
159 (ELF_TARGET_OS): New.
160 * elf32-mips.c (ELF_TARGET_OS): New.
161 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
162 (ppc_elf_create_got): Updated.
163 (ppc_elf_create_dynamic_sections): Likewise.
164 (ppc_elf_check_relocs): Likewise.
165 (ppc_elf_adjust_dynamic_symbol): Likewise.
166 (ppc_elf_size_dynamic_sections): Likewise.
167 (ppc_elf_relocate_section): Likewise.
168 (ppc_elf_finish_dynamic_sections): Likewise.
169 (ppc_elf_vxworks_link_hash_table_create): Likewise.
170 (ELF_TARGET_OS): New.
171 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
172 (sh_elf_link_hash_table_create): Updated.
173 (sh_elf_create_dynamic_sections): Likewise.
174 (allocate_dynrelocs): Likewise.
175 (sh_elf_size_dynamic_sections): Likewise.
176 (sh_elf_relocate_section): Likewise.
177 (sh_elf_finish_dynamic_symbol): Likewise.
178 (sh_elf_finish_dynamic_sections): Likewise.
179 (ELF_TARGET_OS): New.
180 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
182 (bfd_elf32_bfd_link_hash_table_create): Likewise.
183 (ELF_TARGET_OS): New.
184 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
185 (elf_x86_64_solaris_arch_bed): Likewise.
186 (elf_x86_64_nacl_arch_bed): Likewise.
187 (elf_x86_64_finish_dynamic_sections): Updated.
188 (elf_x86_64_get_synthetic_symtab): Likewise.
189 (elf_x86_64_link_setup_gnu_properties): Likewise.
190 (ELF_TARGET_OS): New.
191 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
193 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
194 (MIPS_ELF_REL_DYN_NAME): Updated.
195 (ELF_MIPS_GP_OFFSET): Likewise.
196 (mips_elf_create_local_got_entry): Likewise.
197 (mips_elf_allocate_dynamic_relocations): Likewise.
198 (mips_elf_count_got_symbols): Likewise.
199 (is_gott_symbol): Likewise.
200 (mips_elf_calculate_relocation): Likewise.
201 (mips_elf_create_dynamic_relocation): Likewise.
202 (_bfd_mips_elf_check_relocs): Likewise.
203 (allocate_dynrelocs): Likewise.
204 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
205 (mips_elf_lay_out_got): Likewise.
206 (mips_elf_set_plt_sym_value): Likewise.
207 (_bfd_mips_elf_size_dynamic_sections): Likewise.
208 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
209 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
210 (_bfd_mips_elf_final_link): Likewise.
211 (_bfd_mips_init_file_header): Likewise.
212 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
214 (allocate_dynrelocs): Likewise.
215 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
216 (_bfd_sparc_elf_relocate_section): Likewise.
217 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
218 (sparc_finish_dyn): Likewise.
219 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
220 * elfxx-target.h (ELF_TARGET_OS): New.
221 (elfNN_bed): Add ELF_TARGET_OS.
222 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
223 (_bfd_x86_elf_link_hash_table_create): Likewise.
224 (_bfd_x86_elf_size_dynamic_sections): Likewise.
225 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
226 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
227 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
228 * elfxx-x86.h (elf_x86_target_os): Removed.
229 (elf_x86_backend_data): Likewise.
230 (get_elf_x86_backend_data): Likewise.
231 (elf_x86_link_hash_table): Remove target_os.
233 2020-06-06 Alan Modra <amodra@gmail.com>
236 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
237 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
238 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
239 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
240 * elf64-ppc.c: Update throughout for reloc renaming.
241 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
242 * libbfd.h: Regenerate.
243 * bfd-in2.h: Regenerate.
245 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
248 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
251 2020-06-05 Nick Clifton <nickc@redhat.com>
253 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
256 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
258 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
259 priv_may_conflict, in_priv_zero and out_priv_zero to decide
260 whether the object can be linked according to it's priv
261 attributes. The object without any priv spec attributes can
262 be linked with others. If the first input object doesn't contain
263 any priv attributes, then we need to copy the setting from the
264 next input one. Also report more detailed error messages to user.
266 2020-06-04 Stephen Casner <casner@acm.org>
268 Extend pdp11-aout symbol table format to accommodate .stab
269 symbols and implement correct handling of them.
271 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
272 (N_STAB, is_stab): Needed new function is_stab to disambiguate
273 normal vs. .stab symbol table type values, replacing N_STAB mask.
274 (translate_from_native_sym_flags): Determine correct section for
275 different .stab types.
276 (translate_to_native_sym_flags): Leave .stab types intact.
277 (translate_symbol_table): Error if symbol indicates overlay;
278 store desc field from .stab symbols.
279 (write_syms): Output desc field with symbol.
280 (aout_link_check_ar_symbols): Skip .stab symbols.
281 (aout_link_add_symbols): Correctly distinguish .stab symbols.
282 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
283 (aout_link_write_symbols): Write 0 for desk and ovly fields;
284 correctly distinguish .stab symbols and select calculate their
285 section and value; and copy desc and ovly fields from input symbol
288 2020-06-04 Stephen Casner <casner@acm.org>
290 * aoutx.h (translate_symbol_table): Comment had external and
292 * pdp11.c (translate_symbol_table): Likewise.
294 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
296 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
297 (is_x86_elf): Check elf.hash_table_id instead of target_id.
298 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
300 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
303 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
304 in debug section against symbol defined in shared library to 0.
305 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
306 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
307 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
308 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
309 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
310 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
311 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
312 * elf32-sh.c (sh_elf_check_relocs): Likewise.
313 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
314 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
315 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
316 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
317 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
318 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
320 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
321 there is non-GOT reference.
322 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
323 non-alloced sections.
325 2020-06-03 Stephen Casner <casner@acm.org>
327 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
329 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
331 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
332 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
333 other size that doesn't qcover the header word.
334 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
335 string table, and zero it.
336 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
337 message and set bfd_error on finding an invalid name string offset.
338 (add_to_stringtab): INLINE -> inline
339 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
341 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
342 any relocs that could not be recognised.
343 92744f05809 PR 20929 - Check for relocs without an associated symbol.
344 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
345 name exists and is long enough, before attempting to see if it is
347 c3864421222 - Correct case for N_SO being the last symbol.
348 50455f1ab29 PR 20891 - Handle the case where the main file name
349 and the directory name are both empty.
350 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
351 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
352 range string table offsets.
353 531336e3a0b PR 20909 - Fix off-by-one error in check for an
354 illegal string offset.
355 (aout_link_includes_newfunc): Add comment.
356 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
357 on unexpected relocation type rather than ASSERT.
359 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
362 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
363 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
365 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
368 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
369 non-alloced sections.
371 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
373 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
374 dynamic relocations for non SEC_ALLOC sections.
376 2020-06-03 Gunther Nikl <gnikl@justmail.de>
378 * aout64.c (BMAGIC, QMAGIC): Do not define.
379 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
380 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
381 to check the file format.
382 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
383 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
384 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
386 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
388 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
389 relocations for non SEC_ALLOC sections.
391 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
393 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
394 * elf32-arm.c (maybe_set_textrel): Removed.
395 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
396 with _bfd_elf_maybe_set_textrel.
397 * elf32-csky.c (maybe_set_textrel): Removed.
398 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
399 with _bfd_elf_maybe_set_textrel.
400 * elf32-hppa.c (maybe_set_textrel): Removed.
401 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
402 with _bfd_elf_maybe_set_textrel.
403 * elf32-lm32.c (maybe_set_textrel): Removed.
404 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
405 with _bfd_elf_maybe_set_textrel.
406 * elf32-m32r.c (maybe_set_textrel): Removed.
407 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
408 with _bfd_elf_maybe_set_textrel.
409 * elf32-metag.c (maybe_set_textrel): Removed.
410 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
411 with _bfd_elf_maybe_set_textrel.
412 * elf32-nds32.c (maybe_set_textrel): Removed.
413 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
414 with _bfd_elf_maybe_set_textrel.
415 * elf32-or1k.c (maybe_set_textrel): Removed.
416 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
417 with _bfd_elf_maybe_set_textrel.
418 * elf32-ppc.c (maybe_set_textrel): Removed.
419 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
420 with _bfd_elf_maybe_set_textrel.
421 * elf32-s390.c (maybe_set_textrel): Removed.
422 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
423 with _bfd_elf_maybe_set_textrel.
424 * elf32-sh.c (maybe_set_textrel): Removed.
425 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
426 with _bfd_elf_maybe_set_textrel.
427 * elf32-tic6x.c (maybe_set_textrel): Removed.
428 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
429 with _bfd_elf_maybe_set_textrel.
430 * elf32-tilepro.c (maybe_set_textrel): Removed.
431 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
432 with _bfd_elf_maybe_set_textrel.
433 * elf64-ppc.c (maybe_set_textrel): Removed.
434 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
435 with _bfd_elf_maybe_set_textrel.
436 * elf64-s390.c (maybe_set_textrel): Removed.
437 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
438 with _bfd_elf_maybe_set_textrel.
439 * elfnn-aarch64.c (maybe_set_textrel): Removed.
440 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
441 with _bfd_elf_maybe_set_textrel.
442 * elfnn-riscv.c (maybe_set_textrel): Removed.
443 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
444 with _bfd_elf_maybe_set_textrel.
445 * elfxx-sparc.c (maybe_set_textrel): Removed.
446 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
447 with _bfd_elf_maybe_set_textrel.
448 * elfxx-tilegx.c (maybe_set_textrel): Removed.
449 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
450 with _bfd_elf_maybe_set_textrel.
451 * elfxx-x86.c (maybe_set_textrel): Removed.
452 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
453 with _bfd_elf_maybe_set_textrel.
454 * elflink.c (_bfd_elf_maybe_set_textrel): New.
456 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
459 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
461 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
462 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
463 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
464 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
466 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
467 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
468 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
469 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
470 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
471 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
472 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
473 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
474 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
475 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
476 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
477 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
478 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
479 (elf_backend_copy_indirect_symbol): Likewise.
480 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
481 (elf_backend_copy_indirect_symbol): Likewise.
482 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
484 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
487 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
488 * elf32-arm.c (readonly_dynrelocs): Removed.
489 (maybe_set_textrel): Replace readonly_dynrelocs with
490 _bfd_elf_readonly_dynrelocs.
491 * elf32-csky.c (readonly_dynrelocs): Removed.
492 (maybe_set_textrel): Replace readonly_dynrelocs with
493 _bfd_elf_readonly_dynrelocs.
494 * elf32-hppa.c(readonly_dynrelocs): Removed.
495 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
496 _bfd_elf_readonly_dynrelocs.
497 (maybe_set_textrel): Likewise.
498 * elf32-lm32.c (readonly_dynrelocs): Removed.
499 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
500 with _bfd_elf_readonly_dynrelocs.
501 (maybe_set_textrel): Likewise.
502 * elf32-m32r.c (readonly_dynrelocs): Removed.
503 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
504 with _bfd_elf_readonly_dynrelocs.
505 (maybe_set_textrel): Likewise.
506 * elf32-metag.c (readonly_dynrelocs): Removed.
507 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
508 with _bfd_elf_readonly_dynrelocs.
509 (maybe_set_textrel): Likewise.
510 * elf32-microblaze.c (readonly_dynrelocs): Removed.
511 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
512 with _bfd_elf_readonly_dynrelocs.
513 * elf32-nds32.c (readonly_dynrelocs): Removed.
514 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
515 with _bfd_elf_readonly_dynrelocs.
516 (maybe_set_textrel): Likewise.
517 * elf32-or1k.c (readonly_dynrelocs): Removed.
518 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
519 with _bfd_elf_readonly_dynrelocs.
520 * elf32-ppc.c (readonly_dynrelocs): Removed.
521 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
522 _bfd_elf_readonly_dynrelocs.
523 (ppc_elf_adjust_dynamic_symbol): Likewise.
524 (maybe_set_textrel): Likewise.
525 * elf32-s390.c (readonly_dynrelocs): Removed.
526 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
527 with _bfd_elf_readonly_dynrelocs.
528 (maybe_set_textrel): Likewise.
529 * elf32-sh.c (readonly_dynrelocs): Removed.
530 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
531 _bfd_elf_readonly_dynrelocs.
532 (maybe_set_textrel): Likewise.
533 * elf32-tic6x.c (readonly_dynrelocs): Removed.
534 (maybe_set_textrel): Replace readonly_dynrelocs with
535 _bfd_elf_readonly_dynrelocs.
536 * elf32-tilepro.c (readonly_dynrelocs): Removed.
537 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
538 with _bfd_elf_readonly_dynrelocs.
539 (maybe_set_textrel): Likewise.
540 * elf64-ppc.c (readonly_dynrelocs): Removed.
541 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
542 _bfd_elf_readonly_dynrelocs.
543 (ppc64_elf_adjust_dynamic_symbol): Likewise.
544 (maybe_set_textrel): Likewise.
545 * elf64-s390.c (readonly_dynrelocs): Removed.
546 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
547 with _bfd_elf_readonly_dynrelocs.
548 (maybe_set_textrel): Likewise.
549 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
550 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
551 (maybe_set_textrel): Replace readonly_dynrelocs with
552 _bfd_elf_readonly_dynrelocs.
553 * elfnn-riscv.c (readonly_dynrelocs): Removed.
554 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
555 with _bfd_elf_readonly_dynrelocs.
556 (maybe_set_textrel): Likewise.
557 * elfxx-sparc.c (readonly_dynrelocs): Removed.
558 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
559 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
560 (maybe_set_textrel): Likewise.
561 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
562 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
563 with _bfd_elf_readonly_dynrelocs.
564 (maybe_set_textrel): Likewise.
565 * elfxx-x86.c (readonly_dynrelocs): Removed.
566 (maybe_set_textrel): Replace readonly_dynrelocs with
567 _bfd_elf_readonly_dynrelocs.
568 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
570 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
572 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
573 -fsanitize=undefined.
575 2020-06-03 Alan Modra <amodra@gmail.com>
579 * peicode.h (pe_ILF_make_a_section): Align data for compilers
581 (pe_ILF_build_a_bfd): Likewise.
583 2020-06-03 Alan Modra <amodra@gmail.com>
586 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
587 core files as well as objects.
589 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
592 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
593 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
595 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
596 (elf_arc_link_hash_newfunc): Updated.
597 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
598 (elf32_arm_link_hash_newfunc): Updated.
599 (elf32_arm_copy_indirect_symbol): Likewise.
600 (elf32_arm_check_relocs): Likewise.
601 (readonly_dynrelocs): Likewise.
602 (allocate_dynrelocs_for_symbol): Likewise.
603 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
604 (csky_elf_link_hash_newfunc): Updated.
605 (csky_allocate_dynrelocs): Likewise.
606 (readonly_dynrelocs): Likewise.
607 (csky_elf_copy_indirect_symbol): Likewise.
608 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
609 (hppa_link_hash_newfunc): Updated.
610 (elf32_hppa_copy_indirect_symbol): Likewise.
611 (elf32_hppa_hide_symbol): Likewise.
612 (elf32_hppa_adjust_dynamic_symbol): Likewise.
613 (allocate_dynrelocs): Likewise.
614 (elf32_hppa_relocate_section): Likewise.
615 * elf32-i386.c (elf_i386_check_relocs): Likewise.
616 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
617 (lm32_elf_link_hash_newfunc): Likewise.
618 (lm32_elf_link_hash_table_create): Updated.
619 (readonly_dynrelocs): Likewise.
620 (allocate_dynrelocs): Likewise.
621 (lm32_elf_copy_indirect_symbol): Likewise.
622 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
623 (m32r_elf_link_hash_newfunc): Likewise.
624 (m32r_elf_link_hash_table_create): Updated.
625 (m32r_elf_copy_indirect_symbol): Likewise.
626 (allocate_dynrelocs): Likewise.
627 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
628 (metag_link_hash_newfunc): Updated.
629 (elf_metag_copy_indirect_symbol): Likewise.
630 (readonly_dynrelocs): Likewise.
631 (allocate_dynrelocs): Likewise.
632 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
634 (link_hash_newfunc): Updated.
635 (microblaze_elf_check_relocs): Likewise.
636 (microblaze_elf_copy_indirect_symbol): Likewise.
637 (readonly_dynrelocs): Likewise.
638 (allocate_dynrelocs): Likewise.
639 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
640 (nds32_elf_link_hash_newfunc): Updated.
641 (nds32_elf_copy_indirect_symbol): Likewise.
642 (readonly_dynrelocs): Likewise.
643 (allocate_dynrelocs): Likewise.
644 (nds32_elf_check_relocs): Likewise.
645 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
646 (link_hash_newfunc): Updated.
647 (nios2_elf32_copy_indirect_symbol): Likewise.
648 (nios2_elf32_check_relocs): Likewise.
649 (allocate_dynrelocs): Likewise.
650 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
651 (or1k_elf_link_hash_newfunc): Updated.
652 (readonly_dynrelocs): Likewise.
653 (allocate_dynrelocs): Likewise.
654 (or1k_elf_copy_indirect_symbol): Likewise.
655 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
656 (ppc_elf_link_hash_newfunc): Updated.
657 (ppc_elf_copy_indirect_symbol): Likewise.
658 (ppc_elf_check_relocs): Likewise.
659 (readonly_dynrelocs): Likewise.
660 (ppc_elf_adjust_dynamic_symbol): Likewise.
661 (allocate_dynrelocs): Likewise.
662 (ppc_elf_relocate_section): Likewise.
663 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
664 (link_hash_newfunc): Updated.
665 (elf_s390_copy_indirect_symbol): Likewise.
666 (readonly_dynrelocs): Likewise.
667 (elf_s390_adjust_dynamic_symbol): Likewise.
668 (allocate_dynrelocs): Likewise.
669 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
670 (sh_elf_link_hash_newfunc): Updated.
671 (readonly_dynrelocs): Likewise.
672 (allocate_dynrelocs): Likewise.
673 (sh_elf_copy_indirect_symbol): Likewise.
674 (sh_elf_check_relocs): Likewise.
675 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
676 (elf32_tic6x_link_hash_newfunc): Likewise.
677 (elf32_tic6x_link_hash_table_create): Updated.
678 (readonly_dynrelocs): Likewise.
679 (elf32_tic6x_check_relocs): Likewise.
680 (elf32_tic6x_allocate_dynrelocs): Likewise.
681 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
683 (link_hash_newfunc): Updated.
684 (tilepro_elf_copy_indirect_symbol): Likewise.
685 (tilepro_elf_check_relocs): Likewise.
686 (allocate_dynrelocs): Likewise.
687 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
688 (ppc64_elf_copy_indirect_symbol): Updated.
689 (ppc64_elf_check_relocs): Likewise.
690 (readonly_dynrelocs): Likewise.
691 (ppc64_elf_adjust_dynamic_symbol): Likewise.
692 (dec_dynrel_count): Likewise.
693 (allocate_dynrelocs): Likewise.
694 (ppc64_elf_relocate_section): Likewise.
695 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
696 (link_hash_newfunc): Updated.
697 (elf_s390_copy_indirect_symbol): Likewise.
698 (readonly_dynrelocs): Likewise.
699 (allocate_dynrelocs): Likewise.
700 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
701 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
703 (elfNN_aarch64_link_hash_newfunc): Updated.
704 (elfNN_aarch64_copy_indirect_symbol): Likewise.
705 (readonly_dynrelocs): Likewise.
706 (need_copy_relocation_p): Likewise.
707 (elfNN_aarch64_allocate_dynrelocs): Likewise.
708 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
709 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
710 (link_hash_newfunc): Updated.
711 (riscv_elf_copy_indirect_symbol): Likewise.
712 (riscv_elf_check_relocs): Likewise.
713 (readonly_dynrelocs): Likewise.
714 (allocate_dynrelocs): Likewise.
715 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
717 (link_hash_newfunc): Updated.
718 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
719 (_bfd_sparc_elf_check_relocs): Likewise.
720 (readonly_dynrelocs): Likewise.
721 (allocate_dynrelocs): Likewise.
722 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
723 (link_hash_newfunc): Updated.
724 (tilegx_elf_copy_indirect_symbol): Likewise.
725 (tilegx_elf_check_relocs): Likewise.
726 (readonly_dynrelocs): Likewise.
727 (allocate_dynrelocs): Likewise.
728 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
729 (readonly_dynrelocs): Likewise.
730 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
731 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
733 2020-06-01 Alan Modra <amodra@gmail.com>
735 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
736 command against cmd_length, not the end of record. For
737 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
738 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
741 2020-05-28 David Faust <david.faust@oracle.com>
743 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
744 R_BPF_INSN_{32,64} relocations.
746 2020-05-28 Stephen Casner <casner@acm.org>
748 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
749 addreses in .long (used in testsuites) and .stab values.
751 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
754 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
755 Check bfd_link_dll when issue a DT_TEXTREL warning.
756 * elfxx-x86.c (maybe_set_textrel): Likewise.
757 (_bfd_x86_elf_size_dynamic_sections): Likewise.
759 2020-05-26 Nick Clifton <nickc@redhat.com>
761 * plugin.c (try_load_plugin): Extend error message when a plugin
764 2020-05-23 Alan Modra <amodra@gmail.com>
766 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
768 2020-05-22 Alan Modra <amodra@gmail.com>
771 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
772 attributes from shared libraries, and do not return an error if
775 2020-05-21 Alan Modra <amodra@gmail.com>
778 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
780 (_bfd_delete_bfd): Free the copy.
781 (_bfd_new_bfd): Free nbfd->memory on error.
783 2020-05-21 Alan Modra <amodra@gmail.com>
785 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
786 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
787 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
788 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
789 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
790 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
791 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
792 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
793 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
794 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
795 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
796 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
797 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
798 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
799 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
800 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
801 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
802 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
803 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
804 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
806 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
808 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
809 get_default_version. It is used to find the default version for
810 the specific extension.
811 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
812 default_major_version and default_minor_version. Add new bfd_boolean
813 parameter *use_default_version. Set it to TRUE if we need to call
814 the callback rps->get_default_version to find the default version.
815 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
816 the default version in riscv_parsing_subset_version, and then call
817 riscv_add_subset to add the subset into subset list.
818 (riscv_parse_prefixed_ext): Likewise.
819 (riscv_std_z_ext_strtab): Support Zicsr extensions.
820 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
821 strings rather than characters.
822 riscv_merge_arch_attr_info): The callback function get_default_version
823 is only needed for assembler, so set it to NULL int the linker.
824 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
825 * elfxx-riscv.h: Updated.
827 2020-05-20 Alan Modra <amodra@gmail.com>
830 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
831 use bfd_set_filename.
832 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
833 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
834 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
835 (bfd_create): Likewise.
836 (_bfd_delete_bfd): Don't free filename.
837 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
838 return pointer to the copy or NULL on alloc fail.
839 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
840 result of bfd_set_filename.
841 * bfd-in2.h: Regenerate.
843 2020-05-20 Alan Modra <amodra@gmail.com>
846 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
847 section size against file size.
848 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
850 2020-05-19 Gunther Nikl <gnikl@justmail.de>
853 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
854 and memset when allocating memory for the sections_being_created
857 2020-05-19 Stafford Horne <shorne@gmail.com>
859 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
861 (or1k_elf_relocate_section): Access srelgot via
862 htab->root.srelgot. Add assertions for srelgot->contents.
863 Introduce local variable for srelgot to not reuse global
865 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
866 (or1k_set_got_and_rela_sizes): New function.
867 (or1k_initial_exec_offset): New function.
868 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
869 (or1k_elf_relocate_section): Allow for TLS to handle multiple
871 (or1k_elf_check_relocs): Use OR to set TLS access.
872 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
874 (or1k_elf_size_dynamic_sections): Use
875 or1k_set_got_and_rela_sizes to set sizes.
876 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
877 (TCB_SIZE): New macro.
878 (tpoff): Use TCB_SIZE and alignment to calculate offset.
879 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
880 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
881 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
882 (tpoff): Add dynamic boolean argument.
883 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
885 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
887 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
888 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
889 cases with BFD_RELOC_AARCH64_JUMP26.
890 (elfNN_aarch64_check_relocs): Likewise.
892 2020-05-19 Alan Modra <amodra@gmail.com>
894 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
895 bfd_get_filename rather than accessing bfd->filename directly.
896 * aout-target.h (MY (object_p)): Likewise.
897 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
898 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
899 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
900 (_bfd_archive_bsd44_construct_extended_name_table),
901 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
902 (_bfd_bsd_write_armap): Likewise.
903 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
904 * cache.c (bfd_open_file): Likewise.
905 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
906 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
907 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
908 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
909 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
910 * elf32-nds32.c (nds32_elf_output_symbol_hook),
911 (patch_tls_desc_to_ie): Likewise.
912 * elf32-spu.c (sort_bfds, print_one_overlay_section),
913 (spu_elf_auto_overlay): Likewise.
914 * elf64-hppa.c (elf_hppa_final_link): Likewise.
915 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
916 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
917 * elflink.c (bfd_elf_size_dynamic_sections),
918 (elf_link_input_bfd): Likewise.
919 * linker.c (_bfd_generic_link_output_symbols): Likewise.
920 * mach-o.c (bfd_mach_o_follow_dsym),
921 (bfd_mach_o_close_and_cleanup): Likewise.
922 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
923 (find_separate_debug_file, get_build_id_name): Likewise.
924 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
925 * plugin.c (bfd_plugin_open_input): Likewise.
926 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
927 * som.c (som_write_armap): Likewise.
928 * srec.c (srec_write_record, srec_write_symbols): Likewise.
929 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
930 (_bfd_vms_lib_write_archive_contents): Likewise.
931 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
933 2020-05-19 Alan Modra <amodra@gmail.com>
936 * bfdio.c (_bfd_real_fopen): Typo fix.
938 2020-05-18 Nick Clifton <nickc@redhat.com>
941 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
942 for the sections_being_created array.
944 2020-05-18 Alan Modra <amodra@gmail.com>
946 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
947 they can be freed without also freeing internal_relocs.
949 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
952 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
953 separators into DOS style when creating a WIN32 fullpath.
955 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
957 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
958 to initialize RISC-V tdata.
960 2020-05-12 Gunther Nikl <gnikl@justmail.de>
962 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
965 2020-05-11 Alan Modra <amodra@gmail.com>
967 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
969 2020-05-11 Alan Modra <amodra@gmail.com>
971 * elf64-ppc.c: Rename powerxx to power10 throughout.
973 2020-05-11 Alan Modra <amodra@gmail.com>
976 * coffgen.c (coff_get_normalized_symtab): Check that buffer
977 contains required number of auxents before processing any auxent.
978 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
979 file name from auxents for PE.
981 2020-05-04 Gunther Nikl <gnikl@justmail.de>
983 * aout-cris.c (DEFAULT_ARCH): Delete define.
984 (MY_set_arch_mach): Likewise.
985 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
987 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
988 of r_type before the shift.
990 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
993 * elfnn-aarch64.c (group_sections): Copy implementation from
996 2020-05-01 Alan Modra <amodra@gmail.com>
999 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1000 accessing root.u.def of symbols. Also check root.u.def.section
1001 is non-NULL. Reverse tests so as to make the logic positive.
1003 2020-05-01 Alan Modra <amodra@gmail.com>
1006 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1007 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1009 2020-05-01 Alan Modra <amodra@gmail.com>
1012 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1013 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1014 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1015 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1016 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1017 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1018 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1019 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1020 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1021 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1023 2020-05-01 Alan Modra <amodra@gmail.com>
1026 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1027 from shared libraries.
1029 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1031 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1032 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1033 equals 0. Report overflow when the result has negative sign but
1034 all significant bits are zero.
1036 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1038 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1039 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1041 2020-04-28 Alan Modra <amodra@gmail.com>
1043 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1044 Emit warning message.
1046 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1048 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1049 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1050 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1051 to x86_64_pe_big_vec as it not a big-endian format.
1052 (vec i386_pe_big_vec): New.
1053 * configure.ac: Likewise.
1054 * targets.c: Likewise.
1055 * configure: Regenerate.
1056 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1057 COFF_WITH_PE_BIGOBJ): New.
1058 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1060 (x86_64_pe_be_vec): Moved.
1062 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1064 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1065 * elf.c (elfcore_grok_arc_v2): New function.
1066 (elfcore_grok_note): Call the new function to handle the corresponding
1068 (elfcore_write_arc_v2): New function.
1069 (elfcore_write_register_note): Call the new function to handle the
1070 corresponding pseudo-sections.
1072 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1075 * bfd-in2.h: Regenerated.
1076 * elf32-xtensa.c (elf_howto_table): New entries for
1077 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1078 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1079 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1080 R_XTENSA_NDIFF{8,16,32}.
1081 * libbfd.h (bfd_reloc_code_real_names): Add names for
1082 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1083 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1084 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1085 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1087 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1090 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1093 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1096 * elf-bfd.h (elf_backend_data): Add
1097 elf_backend_strip_zero_sized_dynamic_sections.
1098 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1099 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1101 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1103 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1105 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1107 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1109 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1111 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1113 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1115 2020-04-21 Nick Clifton <nickc@redhat.com>
1117 * po/sr.po: Updated Serbian translation.
1119 2020-04-21 Alan Modra <amodra@gmail.com>
1121 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1124 2020-04-20 Stephen Casner <casner@acm.org>
1126 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1127 causing globals from linker script to be treated as debug symbols.
1128 (translate_symbol_table): Don't sign-extend symbol values from 16
1129 to 64 bits in nm output.
1131 2020-04-20 Alan Modra <amodra@gmail.com>
1133 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1135 2020-04-18 Alan Modra <amodra@gmail.com>
1137 * section.c (bfd_is_const_section): Correct test for special
1139 * bfd-in2.h: Regenerate.
1141 2020-04-17 Alan Modra <amodra@gmail.com>
1144 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1147 2020-04-16 Nick Clifton <nickc@redhat.com>
1150 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1151 abort with a more helpful error message.
1153 2020-04-16 Alan Modra <amodra@gmail.com>
1156 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1159 2020-04-15 Fangrui Song <maskray@google.com>
1162 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1163 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1164 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1165 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1166 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1167 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1168 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1169 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1170 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1171 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1172 * elflink.c (elf_link_output_extsym): Likewise.
1173 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1175 2020-04-15 Alan Modra <amodra@gmail.com>
1178 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
1179 pointer into strings that may be freed for section name, always
1180 allocate a new string.
1182 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1183 Jan W. Jagersma <jwjagersma@gmail.com>
1185 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
1186 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1187 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
1188 (_bfd_go32_mkobject): New functions.
1189 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
1190 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
1191 (go32exe_mkobject): Call _bfd_go32_mkobject.
1192 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
1193 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
1195 (coff_write_relocs): Enable extended reloc counter code if
1196 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
1197 (coff_write_object_contents): Likewise. Pad section headers
1198 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
1199 instead of coff_swap_scnhdr_out.
1200 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
1201 enable extended reloc counter.
1202 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
1203 Declare with ATTRIBUTE_UNUSED.
1204 * libcoff-in.h: (struct coff_tdata): New field go32.
1206 * libcoff.h: Regenerate.
1208 2020-04-14 Fangrui Song <maskray@google.com>
1211 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
1214 2020-04-14 Stephen Casner <casner@acm.org>
1217 * pdp11.c: Add implementation of --imagic option.
1218 (adjust_o_magic): Fix objcopy --extract-symbol test.
1219 * libaout.h (enum aout_magic): Add i_magic.
1221 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1222 Nick Clifton <nickc@redhat.com>
1224 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
1226 <default>: Error rather than abort.
1228 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
1231 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
1232 relocation section from section group.
1234 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
1236 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
1237 bfd->origin to file offset.
1238 * bfdwin.c (bfd_get_file_window): Likewise.
1239 * bfd.c: Clarify the use of the bfd->origin field.
1240 * bfd-in2.h: Regenerate.
1241 * coff-i386.c: Don't include go32exe.h. Allow overriding
1242 coff_write_object_contents via COFF_WRITE_CONTENTS.
1243 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
1244 (go32exe_write_object_contents): New functions.
1245 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
1246 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
1247 (create_go32_stub): Remove check for 2k size limit. Read stub
1248 from go32exe_temp_stub if present.
1249 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
1250 copy variable-length stub.
1251 (go32_check_format): Read stub to go32exe_temp_stub, set
1252 origin, return go32exe_cleanup.
1253 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
1254 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
1255 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
1256 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
1257 Remove functions and their associated #defines.
1258 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
1259 * libcoff-in.h: (struct coff_tdata): New field stub_size.
1260 Rename field go32stub to stub.
1261 * libcoff.h: Regenerate.
1262 * coff-stgo32.c (go32_check_format): Rename to...
1263 (go32exe_check_format): ...this.
1264 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
1265 (go32exe_copy_private_bfd_data): ...this.
1266 (stub_bytes): Rename to...
1267 (go32exe_default_stub): ...this.
1268 (create_go32_stub): Rename to...
1269 (go32exe_create_stub): ...this.
1270 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
1273 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
1277 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
1278 relocation to R_386_32 for relocation against non-preemptible
1280 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
1281 allocate dynamic relocation for non-preemptible absolute symbol.
1282 (elf_i386_relocate_section): Pass sec to
1283 GENERATE_DYNAMIC_RELOCATION_P.
1284 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
1285 (elf_x86_64_convert_load_reloc): Covert load relocation to
1286 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
1287 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
1288 for non-preemptible absolute symbol if they overflow.
1289 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
1290 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
1291 symbol. Don't allocate dynamic relocation for non-preemptible
1293 (elf_x86_64_relocate_section): Don't generate relative relocation
1294 for GOTPCREL relocations aganst local absolute symbol. Pass sec
1295 to GENERATE_DYNAMIC_RELOCATION_P.
1296 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
1297 against non-preemptible absolute symbol.
1298 (_bfd_elf_x86_valid_reloc_p): New function.
1299 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
1301 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
1302 argument. Don't generate dynamic relocation against
1303 non-preemptible absolute symbol.
1304 (ABS_SYMBOL_P): New.
1305 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
1306 against non-preemptible absolute symbol.
1308 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
1309 (_bfd_elf_x86_valid_reloc_p): New.
1311 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1314 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
1315 address in the GOT if in thumb only mode.
1317 2020-04-01 Tamar Christina <tamar.christina@arm.com>
1319 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
1321 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
1323 * mmo.c (mmo_scan): Create .text section only when needed, not
1326 2020-03-31 Alan Modra <amodra@gmail.com>
1328 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
1331 2020-03-31 Alan Modra <amodra@gmail.com>
1333 * vms-alpha.c (image_write): Check bounds for sections without
1334 contents too. Error on non-zero write to section without
1336 (_bfd_vms_slurp_etir): Check return of image_write* functions.
1338 2020-03-31 Alan Modra <amodra@gmail.com>
1340 * tekhex.c (pass_over): Check is_eof before reading buffer.
1342 2020-03-30 Nick Clifton <nickc@redhat.com>
1345 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
1346 field to timestamp and make it an integer.
1347 * libcoff.h: Regenerate.
1348 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
1349 field in the pe_data structure rather than the insert_timestamp
1352 2020-03-30 Alan Modra <amodra@gmail.com>
1355 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
1358 2020-03-26 Nick Clifton <nickc@redhat.com>
1360 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
1361 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
1363 * libbfd.h: Regenerate.
1365 2020-03-26 Alan Modra <amodra@gmail.com>
1367 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1369 2020-03-26 Alan Modra <amodra@gmail.com>
1371 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1373 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1375 2020-03-25 Nick Clifton <nickc@redhat.com>
1377 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1379 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1380 * libbfd.h: Regenerate.
1382 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1384 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1385 correct field name in the output string.
1387 2020-03-25 Alan Modra <amodra@gmail.com>
1390 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1391 for SHT_NOBITS section if first in segment.
1393 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1396 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1397 (_bfd_elf_get_symbol_version_string): This.
1398 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1399 (_bfd_elf_get_symbol_version_string): This.
1400 (bfd_elf_print_symbol): Pass TRUE to
1401 _bfd_elf_get_symbol_version_string.
1402 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1403 bfd_boolean argument.
1404 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1405 * targets.c (_bfd_get_symbol_version_string): Likewise.
1406 (bfd_get_symbol_version_string): Likewise.
1407 * bfd-in2.h: Regenerated.
1409 2020-03-24 Nick Clifton <nickc@redhat.com>
1410 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1413 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1416 2020-03-24 Nick Clifton <nickc@redhat.com>
1419 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1420 segment to use for PT_GNU_RELRO, ignore empty sections in a
1421 segment's current list.
1423 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1426 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1428 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1431 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1432 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1433 on the previous _bfd_elf_get_symbol_version_string.
1434 (_bfd_elf_get_symbol_version_string): Use it.
1436 2020-03-24 Alan Modra <amodra@gmail.com>
1438 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1439 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1442 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1444 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1446 2020-03-23 Alan Modra <amodra@gmail.com>
1448 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1449 symbol count. Allocate an extra byte to ensure name strings
1450 are terminated. Sanity check name offsets. Release memory on
1453 2020-03-23 Alan Modra <amodra@gmail.com>
1455 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1456 field hasn't been read. Remove unnecessary casts.
1458 2020-03-22 Alan Modra <amodra@gmail.com>
1460 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1461 enough to read number of symbols.
1463 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1465 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1466 (EXECUTABLE_SUFFIX): Likewise.
1467 * config.in: Regenerated.
1468 * configure: Likewise.
1469 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1470 _bfd_generic_close_and_cleanup.
1471 (plugin_list_entry): Remove resolution_file, resolution_option,
1472 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1473 lto_wrapper, gcc_env and initialized,
1474 (need_lto_wrapper_p): Removed.
1475 (get_lto_wrapper): Likewise.
1476 (setup_lto_wrapper_env): Likewise.
1477 (register_all_symbols_read): Likewise.
1478 (egister_cleanup): Likewise.
1479 (get_symbols): Likewise.
1480 (add_input_file): Likewise.
1481 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1482 (add_symbols): Updated.
1483 (try_claim): Likewise.
1484 (try_load_plugin): Likewise.
1485 (bfd_plugin_canonicalize_symtab): Likewise.
1486 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1487 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1489 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1492 * plugin.c (plugin_list_entry): Add has_symbol_type.
1493 (add_symbols_v2): New function.
1494 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1495 provides symbol type.
1496 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1497 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1500 2020-03-20 Alan Modra <amodra@gmail.com>
1502 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1503 enough to read number of symbols.
1505 2020-03-20 Alan Modra <amodra@gmail.com>
1507 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1508 backend functions for NULL before calling.
1509 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1510 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1511 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1512 * elfnn-ia64.c (ignore_errors): New function.
1513 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1515 2020-03-19 Nick Clifton <nickc@redhat.com>
1518 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1519 location of the varinfo in the unit's debug info data. Change the
1520 type of the stack field to a boolean.
1521 (lookup_var_by_offset): New function. Returns the varinfo
1522 structure for the variable described at the given offset in the
1524 (scan_unit_for_symbols): Add support for variables which have the
1525 DW_AT_specification attribute.
1527 2020-03-19 Nick Clifton <nickc@redhat.com>
1530 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1533 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1535 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1537 2020-03-18 Nick Clifton <nickc@redhat.com>
1540 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1541 memory access when processing a corrupt secondary reloc section.
1543 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1545 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1546 instead of calling abort.
1547 * elf32-csky.c (csky_build_one_stub): Likewise.
1548 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1549 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1550 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1551 * elf32-metag.c (metag_build_one_stub): Likewise.
1552 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1553 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1554 (ppc_size_one_stub): Likewise.
1555 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1557 2020-03-17 Nick Clifton <nickc@redhat.com>
1560 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1561 with error messages.
1563 2020-03-17 Nick Clifton <nickc@redhat.com>
1566 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1567 free. Add free on another failure path.
1569 2020-03-16 Alan Modra <amodra@gmail.com>
1572 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1573 we have a non-zero section count. Do lma comparison in octets.
1575 2020-03-16 Alan Modra <amodra@gmail.com>
1577 * vms-alpha.c (dst_restore_location): Validate index into
1578 dst_ptr_offsets array before accessing. Return status.
1579 (dst_retrieve_location): Similarly, making "loc" parameter a
1580 pointer to return value.
1581 (_bfd_vms_slurp_etir): Update calls to above functions.
1583 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1585 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1587 * configure: Regenerated.
1589 2020-03-14 Alan Modra <amodra@gmail.com>
1591 * section.c (BFD_FAKE_SECTIONS): Formatting.
1592 * bfd-in2.h: Regenerate.
1594 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1596 * elf.c (elfcore_grok_netbsd_note): Add support for
1597 NT_NETBSDCORE_LWPSTATUS notes.
1599 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1601 * bfd-in2.h: Regenerate.
1602 * section.c (asection): Add already_assigned field.
1603 (BFD_FAKE_SECTION): Add default initializer for it.
1604 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1605 * elf32-arm.c (arm_build_one_stub): Add support for
1606 non_contiguous_regions.
1607 * elf32-csky.c (csky_build_one_stub): Likewise.
1608 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1609 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1610 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1611 * elf32-metag.c (metag_build_one_stub): Likewise.
1612 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1613 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1614 (ppc_size_one_stub): Likewise.
1615 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1616 * elflink.c (elf_link_input_bfd): Likewise.
1618 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1621 * elf-linker-x86.h (elf_linker_x86_params): Add
1622 static_before_all_inputs and has_dynamic_linker.
1623 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1624 dynamic input objects if -static is passed at command-line
1625 before all input files without --dynamic-linker unless
1626 --no-dynamic-linker is used.
1628 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1630 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1632 2020-03-13 Christian Eggers <ceggers@gmx.de>
1634 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1635 "p_paddr" from "at".
1636 * elfcode.h (bfd_from_remote_memory): Add units to several
1637 parameters. New local "opb". Fix usage of p_align. Fix
1638 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1639 call of target_read_memory.
1640 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1641 calculation of "offset" and "output_offset".
1642 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1643 from "offset" and fix calculation of "end" from "vma+size". Fix
1644 comparison between "sh_addr" and "vma"/"output_offset".
1645 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1646 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1648 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1649 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1650 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1651 assignment of p_paddr from phdr_lma. Fix comparison between
1652 "lma+size" and "next->lma".
1653 (elf_sort_segments): Fix assignment from p_paddr to lma.
1654 (assign_file_positions_for_load_sections): Add unit (bytes) to
1655 local "align". Fix calculation of local "off_adjust". Fix
1656 calculation of local "filehdr_vaddr".
1657 (assign_file_positions_for_non_load_sections): New local "opb".
1658 Fix calculation of "end" from "p_size". Fix comparison between
1659 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1660 from "end" and "p_vaddr".
1661 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1662 vma. Fix assignment to p_paddr from lma. Fix comparison between
1663 p_paddr and lma. Fix assignment to p_paddr from lma.
1664 * merge.c (sec_merge_emit): New local "opb". Convert
1665 "alignment_power" to octets.
1666 (_bfd_add_merge_section): New locals "alignment_power" and
1667 "opb". Fix comparison between "alignment_power" and
1669 (_bfd_merge_sections): New local "opb". Divide size by opb
1670 before checking align mask.
1672 2020-03-13 Christian Eggers <ceggers@gmx.de>
1674 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1675 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1677 (_bfd_elf_make_section_from_phdr): Similarly.
1678 (elf_fake_sections): Fix calculation of
1679 Elf_Internal_shdr::sh_addr from section VMA.
1680 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1682 (assign_file_positions_for_load_sections): Fix calculations of
1683 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1684 comparison between program header address and section LMA.
1685 (assign_file_positions_for_non_load_sections): Likewise.
1686 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1687 (IS_CONTAINED_BY_VMA): Add parameter opb.
1688 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1689 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1690 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1691 Fix calculations of p_addr_valid and p_vaddr_offset.
1692 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1693 with octets per byte when comparing against p_vaddr.
1695 2020-03-11 Alan Modra <amodra@gmail.com>
1697 * som.c (setup_sections): Sanity check subspace.name.
1699 2020-03-11 Alan Modra <amodra@gmail.com>
1701 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1703 2020-03-10 Alan Modra <amodra@gmail.com>
1706 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1709 2020-03-09 Alan Modra <amodra@gmail.com>
1711 * wasm-module.c (wasm_scan): Sanity check file name length
1712 before allocating memory. Move common section setup code. Do
1713 without bfd_tell to calculate section size.
1715 2020-03-06 Nick Clifton <nickc@redhat.com>
1717 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1718 with error messages and failure return values.
1720 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1722 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1723 relocation sections for any removed reference to a dynamic symbol.
1725 2020-03-05 Nick Clifton <nickc@redhat.com>
1727 * elf-bfd.h (struct elf_backend_data): Add new fields:
1728 init_secondary_reloc_section, slurp_secondary_reloc_section,
1729 write_secondary_reloc_section.
1730 (_bfd_elf_init_secondary_reloc_section): Prototype.
1731 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1732 (_bfd_elf_write_secondary_reloc_section): Prototype.
1733 * elf.c ( bfd_section_from_shdr): Invoke the new
1734 init_secondary_reloc_section backend function, if defined, when a
1735 second reloc section is encountered.
1736 (swap_out_syms): Invoke the new symbol_section_index function, if
1737 defined, when computing the section index of an OS/PROC specific
1739 (_bfd_elf_init_secondary_reloc_section): New function.
1740 (_bfd_elf_slurp_secondary_reloc_section): New function.
1741 (_bfd_elf_write_secondary_reloc_section): New function.
1742 (_bfd_elf_copy_special_section_fields): New function.
1743 * elfcode.h (elf_write_relocs): Invoke the new
1744 write_secondary_relocs function, if defined, in order to emit
1746 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1747 function, if defined, in order to read in secondary relocs.
1748 * elfxx-target.h (elf_backend_copy_special_section_fields):
1749 Provide a non-NULL default definition.
1750 (elf_backend_init_secondary_reloc_section): Likewise.
1751 (elf_backend_slurp_secondary_reloc_section): Likewise.
1752 (elf_backend_write_secondary_reloc_section): Likewise.
1753 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1755 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1756 * configure: Regenerate.
1758 2020-03-05 Alan Modra <amodra@gmail.com>
1760 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1761 against file size before allocating memory. Use bfd_alloc rather
1762 than bfd_zalloc for carsym/strings memory.
1764 2020-03-04 Alan Modra <amodra@gmail.com>
1766 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1767 sh_addr mod sh_addalign is zero.
1769 2020-03-04 Alan Modra <amodra@gmail.com>
1771 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1773 2020-03-03 Alan Modra <amodra@gmail.com>
1775 * format.c (struct bfd_preserve): Add cleanup field.
1776 (bfd_preserve_save): Add cleanup param and save.
1777 (bfd_preserve_restore): Return cleanup.
1778 (bfd_preserve_finish): Call the cleanup for the discarded match.
1779 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1780 and clear when preserving a match. Restore cleanup too when
1781 restoring that match.
1783 2020-03-02 Alan Modra <amodra@gmail.com>
1785 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1786 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1787 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1788 (core_sco5_vec): Correct initialisers.
1790 2020-03-02 Alan Modra <amodra@gmail.com>
1792 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1793 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1794 * cisco-core.c (cisco_core_file_validate): Likewise.
1795 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1796 * hpux-core.c (hpux_core_core_file_p): Likewise.
1797 * irix-core.c (irix_core_core_file_p): Likewise.
1798 * lynx-core.c (lynx_core_file_p): Likewise.
1799 * netbsd-core.c (netbsd_core_file_p): Likewise.
1800 * osf-core.c (osf_core_core_file_p): Likewise.
1801 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1802 * sco5-core.c (sco5_core_file_p): Likewise.
1804 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1806 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1808 2020-03-02 Alan Modra <amodra@gmail.com>
1810 * targets.c (bfd_cleanup): New typedef.
1811 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1812 * libbfd-in.h (_bfd_no_cleanup): Define.
1813 * format.c (bfd_reinit): Add cleanup parameter, call it.
1814 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1815 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1816 * aout-target.h (callback, object_p): Return bfd_cleanup.
1817 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1818 * archive.c (bfd_generic_archive_p): Likewise.
1819 * binary.c (binary_object_p): Likewise.
1820 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1821 * coff-ia64.c (ia64coff_object_p): Likewise.
1822 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1823 * coff-sh.c (coff_small_object_p): Likewise.
1824 * coff-stgo32.c (go32_check_format): Likewise.
1825 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1826 (xcoff64_core_p): Likewise.
1827 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1828 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1829 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1830 * elfcode.h (elf_object_p): Likewise.
1831 * elfcore.h (elf_core_file_p): Likewise.
1832 * i386msdos.c (msdos_object_p): Likewise.
1833 * ihex.c (ihex_object_p): Likewise.
1834 * libaout.h (some_aout_object_p): Likewise.
1835 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1836 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1837 * libbfd.c (_bfd_dummy_target): Likewise.
1838 * libcoff-in.h (coff_object_p): Likewise.
1839 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1840 (bfd_mach_o_arm64_core_p): Likewise.
1841 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1842 (bfd_mach_o_arm_core_p): Likewise.
1843 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1844 (bfd_mach_o_i386_core_p): Likewise.
1845 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1846 (bfd_mach_o_x86_64_core_p): Likewise.
1847 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1848 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1849 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1850 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1851 * mmo.c (mmo_object_p): Likewise.
1852 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1853 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1854 (pe_bfd_object_p): Likewise.
1855 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1856 * ppcboot.c (ppcboot_object_p): Likewise.
1857 * rs6000-core.c (rs6000coff_core_p): Likewise.
1858 * som.c (som_object_setup, som_object_p): Likewise.
1859 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1860 * tekhex.c (tekhex_object_p): Likewise.
1861 * vms-alpha.c (alpha_vms_object_p): Likewise.
1862 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1863 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1864 * wasm-module.c (wasm_object_p): Likewise.
1865 * xsym.c (bfd_sym_object_p): Likewise.
1866 * xsym.h (bfd_sym_object_p): Likewise.
1867 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1869 * pdp11.c (some_aout_object_p): Likewise.
1870 * plugin.c (register_ld_plugin_object_p): Update object_p
1872 * plugin.h (register_ld_plugin_object_p): Likewise.
1873 * bfd-in2.h: Regenerate.
1874 * libbfd.h: Regenerate.
1875 * libcoff.h: Regenerate.
1877 2020-03-02 Alan Modra <amodra@gmail.com>
1879 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1880 applicable section flags.
1881 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1882 (mips_ecoff_bele_vec): Likewise.
1883 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1885 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1886 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1888 2020-03-02 Alan Modra <amodra@gmail.com>
1890 * elf32-m32r.c (m32r_elf_section_flags): New function.
1891 (elf_backend_section_flags): Define.
1892 * elf32-nds32.c (nds32_elf_section_flags): New function.
1893 (elf_backend_section_flags): Define.
1894 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1895 .sbss and .sdata sections.
1896 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1897 for SHF_V850_GPREL sections.
1898 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1900 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1901 for SHF_PARISC_SHORT sections.
1902 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1903 (elf_backend_section_flags): Define.
1904 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1905 for SHF_MIPS_GPREL sections. Delete FIXME.
1907 2020-03-02 Alan Modra <amodra@gmail.com>
1909 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1910 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1911 calling elf_backend_section_flags with adjusted params. Use
1912 newsect->flags past that point.
1913 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1915 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1916 to have their type overridden, and all sh_flags but processor and
1918 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1919 * elf32-mep.c (mep_elf_section_flags): Likewise.
1920 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1921 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1922 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1923 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1924 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1925 stub BFD and non-aarch64 input files when scanning for stubs.
1927 2020-03-02 Alan Modra <amodra@gmail.com>
1929 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1930 limit to decompressed element size.
1932 2020-03-02 Alan Modra <amodra@gmail.com>
1934 * vms-lib.c (vms_traverse_index): Add recur_count param and
1935 update calls. Fail on excessive recursion.
1937 2020-03-02 Alan Modra <amodra@gmail.com>
1939 * vms-alpha.c (vms_get_remaining_object_record): Use
1940 bfd_realloc_or_free rather than bfd_realloc.
1941 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1942 (dst_define_location, parse_module): Likewise, and check realloc
1943 return status before using memory. Return status from function
1944 adjusting all callers.
1946 2020-02-28 Alan Modra <amodra@gmail.com>
1948 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1950 2020-02-28 Alan Modra <amodra@gmail.com>
1952 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1953 Remove duplicate undersize check.
1955 2020-02-27 Alan Modra <amodra@gmail.com>
1958 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1960 2020-02-27 Alan Modra <amodra@gmail.com>
1963 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1964 (coff_section_type): Adjust comment.
1965 (decode_section_type): Likewise. Call coff_section_type before
1966 decode_section_type.
1967 (bfd_decode_symclass): Use 'c' for common sections other than
1970 2020-02-27 Alan Modra <amodra@gmail.com>
1972 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1975 2020-02-27 Alan Modra <amodra@gmail.com>
1977 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1978 if file is an archive element.
1979 * bfd-in2.h: Regenerate.
1981 2020-02-26 Alan Modra <amodra@gmail.com>
1983 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1984 bfd_set_error on failing test. Don't bother changing bfd_error on
1985 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1986 Check sym name is within string buffer. Use size_t for some vars.
1987 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1988 int_buf. Don't change bfd_error on file read error. Use
1989 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1990 calculations to catch overflows before they occur. malloc and
1991 free raw armap rather than using bfd_alloc. Read raw armap before
1992 allocating carsym+strings buffer.
1993 (_bfd_slurp_extended_name_table): Localize variables. Check
1994 name size against file size.
1996 2020-02-26 Alan Modra <amodra@gmail.com>
1998 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2000 2020-02-26 Alan Modra <amodra@gmail.com>
2002 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2003 malloc. Check for NULL return from bfd_malloc.
2004 (rx_table_find, rx_table_map): Likewise.
2005 (rx_set_section_contents): Check bfd_alloc return.
2006 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2008 2020-02-26 Alan Modra <amodra@gmail.com>
2010 * aoutx.h: Indent labels correctly. Format error strings.
2011 * archive.c: Likewise.
2012 * archive64.c: Likewise.
2013 * coff-arm.c: Likewise.
2014 * coff-rs6000.c: Likewise.
2015 * coff-stgo32.c: Likewise.
2016 * cpu-arm.c: Likewise.
2017 * dwarf2.c: Likewise.
2018 * elf-ifunc.c: Likewise.
2019 * elf-properties.c: Likewise.
2020 * elf-s390-common.c: Likewise.
2021 * elf-strtab.c: Likewise.
2023 * elf32-arm.c: Likewise.
2024 * elf32-bfin.c: Likewise.
2025 * elf32-cr16.c: Likewise.
2026 * elf32-csky.c: Likewise.
2027 * elf32-i386.c: Likewise.
2028 * elf32-m68k.c: Likewise.
2029 * elf32-msp430.c: Likewise.
2030 * elf32-nds32.c: Likewise.
2031 * elf32-nios2.c: Likewise.
2032 * elf32-pru.c: Likewise.
2033 * elf32-xtensa.c: Likewise.
2034 * elf64-ia64-vms.c: Likewise.
2035 * elf64-x86-64.c: Likewise.
2036 * elfcode.h: Likewise.
2037 * elfcore.h: Likewise.
2038 * elflink.c: Likewise.
2039 * elfnn-aarch64.c: Likewise.
2040 * elfnn-ia64.c: Likewise.
2041 * elfnn-riscv.c: Likewise.
2042 * elfxx-mips.c: Likewise.
2043 * elfxx-sparc.c: Likewise.
2044 * elfxx-x86.c: Likewise.
2045 * i386lynx.c: Likewise.
2046 * merge.c: Likewise.
2047 * pdp11.c: Likewise.
2048 * plugin.c: Likewise.
2049 * reloc.c: Likewise.
2051 2020-02-26 Alan Modra <amodra@gmail.com>
2054 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2056 (bfd_elf_add_dt_needed_tag): Declare.
2057 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2058 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2059 from elf_add_dt_needed_tag. Remove soname and doit param.
2060 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2061 to see whether as-needed lib is already loaded, use dyn_loaded
2062 list instead. When saving and restoring around as-needed lib
2063 handle possibility that dynstr has not been initialised. Don't
2064 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2065 Mark libs loaded via DT_NEEDED entries of other libs with
2066 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2068 (elf_link_check_versioned_symbol): Remove now unneccesary
2069 DYNAMIC check when traversing dyn_loaded list.
2071 2020-02-26 Alan Modra <amodra@gmail.com>
2073 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2075 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2078 * plugin.c (need_lto_wrapper_p): New.
2079 (bfd_plugin_set_program_name): Add an int argument to set
2081 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2083 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2085 2020-02-24 Alan Modra <amodra@gmail.com>
2087 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2089 2020-02-24 Alan Modra <amodra@gmail.com>
2091 * vms-lib.c (struct carsym_mem): Add limit.
2092 (vms_add_index): Heed limit.
2093 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2094 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2095 Always return actual number read.
2096 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2097 assertion with error exit.
2099 2020-02-22 Alan Modra <amodra@gmail.com>
2102 * elf.c (assign_file_positions_for_load_sections): Continue linking
2103 on "PHDR segment not covered by LOAD segment" errors.
2105 2020-02-21 Alan Modra <amodra@gmail.com>
2107 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2109 (bfd_mach_o_canonicalize_reloc): Likewise.
2110 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2111 counts and offsets against file size.
2112 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2113 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2114 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2115 against file size. Delete symbol table error message.
2116 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2118 (bfd_mach_o_read_symtab): Likewise.
2119 (bfd_mach_o_read_command): Pass file size.
2120 (bfd_mach_o_scan): Sanity check command count against file size.
2122 2020-02-21 Alan Modra <amodra@gmail.com>
2125 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2126 "text", "data" and "bss" section pointer vars. Don't update
2127 section size, just exec header sizes.
2128 (adjust_sizes_and_vmas): Don't update text section size. Set
2129 initial exec header a_text. Print exec headers sizes.
2130 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2131 (adjust_sizes_and_vmas): Similarly. Formatting.
2132 (final_link): Correct final file extension.
2134 2020-02-20 Nick Clifton <nickc@redhat.com>
2136 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2138 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2140 (elfNN_bed): Initialise the symbol_section_index field.
2141 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2142 OS and PROC specific section indicies. Warn if converting other
2143 reserved incidies to SHN_ABS.
2145 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2148 * cpu-z80.c: Add machine type compatibility checking.
2150 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2153 * plugin.c (plugin_list_entry): Remove handle.
2154 (try_load_plugin): Call dlclose before return.
2156 2020-02-19 Alan Modra <amodra@gmail.com>
2158 * libbfd-in.h (_bfd_constant_p): Define.
2159 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2160 file size before allocating memory.
2161 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2162 * elf.c (bfd_elf_get_str_section): Likewise.
2163 (_bfd_elf_slurp_version_tables): Likewise.
2164 * libbfd.h: Regenerate.
2166 2020-02-19 Alan Modra <amodra@gmail.com>
2168 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2169 * aoutx.h (aout_get_external_symbols): Replace calls to
2170 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2171 (slurp_reloc_table): Likewise.
2172 * archive.c (do_slurp_bsd_armap): Likewise.
2173 (do_slurp_coff_armap): Likewise.
2174 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2175 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2176 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2177 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
2178 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
2179 (_bfd_coff_get_external_symbols): Likewise.
2180 * ecoff.c (ecoff_slurp_symbolic_header),
2181 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
2182 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
2183 (ecoff_indirect_link_order): Likewise.
2184 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
2185 (_bfd_elf_slurp_version_tables): Likewise.
2186 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2187 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2188 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2189 * elf64-alpha.c (READ): Likewise.
2190 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
2191 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2192 * elfcode.h (elf_slurp_symbol_table),
2193 (elf_slurp_reloc_table_from_section): Likewise.
2194 * elflink.c (elf_link_add_object_symbols),
2195 (elf_link_check_versioned_symbol): Likewise.
2196 * elfxx-mips.c (READ): Likewise.
2197 * i386lynx.c (slurp_reloc_table): Likewise.
2198 * lynx-core.c (lynx_core_file_p): Likewise.
2199 * mach-o.c (bfd_mach_o_canonicalize_relocs),
2200 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
2201 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
2202 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
2203 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
2204 (bfd_pef_parse_symbols): Likewise.
2205 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
2206 * som.c (setup_sections, som_slurp_string_table),
2207 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2208 (som_bfd_fill_in_ar_symbols): Likewise.
2209 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
2210 (evax_bfd_print_image): Likewise.
2211 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
2212 * wasm-module.c (wasm_scan): Likewise.
2213 * xcofflink.c (xcoff_link_add_symbols): Likewise.
2214 * xsym.c (bfd_sym_read_name_table),
2215 (bfd_sym_print_type_information_table_entry): Likewise.
2216 * libbfd.h: Regenerate.
2218 2020-02-19 Alan Modra <amodra@gmail.com>
2220 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
2221 reading external relocs.
2222 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
2223 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
2225 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
2227 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
2228 (m32c_elf_relax_section): Likewise.
2229 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
2230 (rl78_elf_relax_section): Likewise.
2231 * elf32-rx.c (rx_offset_for_reloc): Likewise.
2232 (elf32_rx_relax_section): Likewise.
2233 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
2234 parameter types and use..
2235 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
2236 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
2237 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
2238 being read from file, just the extra.
2239 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
2240 after reading external syms. Free on failure.
2242 2020-02-19 Alan Modra <amodra@gmail.com>
2244 * coffcode.h (buy_and_read, coff_slurp_line_table),
2245 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
2246 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
2247 corresponding bfd_alloc call. Adjust variables to suit.
2248 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2249 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
2250 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
2251 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
2252 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
2253 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
2254 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
2255 * elf32-rx.c (elf32_rx_relax_section): Likewise.
2256 * elf64-alpha.c (READ): Likewise.
2257 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
2258 (elf_slurp_symbol_table, elf_slurp_reloc_table),
2259 (bfd_from_remote_memory): Likewise.
2260 * elfcore.h (core_find_build_id): Likewise.
2261 * elfxx-mips.c (READ): Likewise.
2262 * mach-o.c (bfd_mach_o_mangle_sections),
2263 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
2264 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
2265 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
2266 * som.c (setup_sections, som_prep_for_fixups)
2267 (som_build_and_write_symbol_table, som_slurp_symbol_table),
2268 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
2269 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
2270 (som_bfd_ar_write_symbol_stuff): Likewise.
2271 * vms-alpha.c (vector_grow1): Likewise.
2272 * vms-lib.c (vms_add_index): Likewise.
2273 * wasm-module.c (wasm_scan_name_function_section): Likewise.
2274 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
2275 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
2276 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
2277 (bfd_alloc2, bfd_zalloc2): Delete.
2278 (_bfd_mul_overflow): Define.
2279 * libbfd.h: Regenerate.
2281 2020-02-19 Alan Modra <amodra@gmail.com>
2283 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
2285 (assign_section_numbers): Likewise.
2286 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
2287 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
2288 bfd_malloc2, size_t amt, and unsigned tls_count.
2289 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
2290 * elflink.c (elf_create_symbuf): Use bfd_malloc.
2291 (elf_output_implib): Use bfd_alloc.
2293 2020-02-19 Alan Modra <amodra@gmail.com>
2295 * bfd.c (struct bfd): Move format and direction to other
2296 bitfields. Add "size".
2297 * bfdio.c (bfd_get_size): Cache size when not writing file.
2298 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
2299 returning zero, ie. unknown.
2300 (bfd_get_alt_debug_link_info): Likewise.
2301 * bfd-in2.h: Regenerate.
2303 2020-02-19 Alan Modra <amodra@gmail.com>
2305 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
2306 bfd_get_file_size twice.
2307 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
2308 zero, ie. unknown, return.
2309 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
2310 * elfcode.h (elf_swap_shdr_in): Likewise.
2311 (elf_object_p): Don't call bfd_get_file_size twice and correct
2314 2020-02-19 Alan Modra <amodra@gmail.com>
2316 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
2317 FALSE if memory alloc fails. Adjust calls.
2318 * som.c (som_prep_for_fixups): Likewise.
2319 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
2320 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
2321 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
2322 * som.c (som_build_and_write_symbol_table): Return via error_return
2324 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
2325 (VEC_APPEND_EL): Delete.
2326 (vector_grow1): Return pointer to element. Catch overflow.
2327 Return NULL on memory allocation failure.
2328 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
2329 (alpha_vms_add_fixup_ca): Likewise.
2330 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
2332 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
2334 2020-02-19 Alan Modra <amodra@gmail.com>
2336 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
2337 * aout-target.h (object_p): Likewise.
2338 * aout-tic30.c (tic30_aout_object_p): Likewise.
2339 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
2340 (emit_stringtab, write_syms, link_hash_table_create),
2341 (aout_link_write_other_symbol): Likewise.
2342 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
2343 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
2344 (_bfd_compute_and_write_armap): Likewise.
2345 * archures.c (bfd_arch_list): Likewise.
2346 * bfd.c (bfd_record_phdr): Likewise.
2347 * binary.c (binary_canonicalize_symtab): Likewise.
2348 * cisco-core.c (cisco_core_file_validate): Likewise.
2349 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
2350 (find_arm_glue, record_arm_to_thumb_glue),
2351 (record_thumb_to_arm_glue): Likewise.
2352 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
2353 (ppc_allocate_toc_section): Likewise.
2354 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
2355 * coff-sh.c (sh_relax_section): Likewise.
2356 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
2357 * coffcode.h (handle_COMDAT, coff_new_section_hook),
2358 (coff_set_alignment_hook, coff_mkobject),
2359 (coff_compute_section_file_positions): Likewise.
2360 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
2361 (coff_find_nearest_line_with_names),
2362 ( bfd_coff_set_symbol_class): Likewise.
2363 * cofflink.c (_bfd_coff_link_hash_table_create),
2364 (_bfd_coff_link_input_bfd): Likewise.
2365 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2366 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2367 (build_line_info_table, sort_line_sequences),
2368 (line_info_add_include_dir, line_info_add_file_name),
2369 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2370 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2371 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2372 (_bfd_ecoff_find_nearest_line),
2373 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2374 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2375 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2376 * elf-m10300.c (mn10300_elf_relax_section),
2377 (elf32_mn10300_link_hash_table_create): Likewise.
2378 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2379 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2380 * elf32-arm.c (elf32_arm_link_hash_table_create),
2381 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2382 (elf32_arm_new_section_hook): Likewise.
2383 * elf32-avr.c (elf_avr_new_section_hook),
2384 (elf32_avr_link_hash_table_create, get_local_syms),
2385 (elf32_avr_setup_section_lists): Likewise.
2386 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2387 (bfin_link_hash_table_create): Likewise.
2388 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2389 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2390 * elf32-csky.c (csky_elf_link_hash_table_create),
2391 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2392 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2393 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2394 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2395 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2396 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2397 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2398 (m32r_elf_check_relocs): Likewise.
2399 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2400 (elf32_m68hc11_setup_section_lists),
2401 (elf32_m68hc11_size_stubs): Likewise.
2402 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2403 * elf32-metag.c (elf_metag_link_hash_table_create),
2404 (elf_metag_setup_section_lists): Likewise.
2405 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2406 (microblaze_elf_check_relocs): Likewise.
2407 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2408 (nds32_elf_check_relocs): Likewise.
2409 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2410 (get_local_syms, nios2_elf32_check_relocs),
2411 (nios2_elf32_link_hash_table_create): Likewise.
2412 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2413 (or1k_elf_check_relocs): Likewise.
2414 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2415 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2416 * elf32-s390.c (elf_s390_link_hash_table_create),
2417 (elf_s390_check_relocs): Likewise.
2418 * elf32-score.c (score_elf_create_got_section),
2419 (s3_elf32_score_new_section_hook),
2420 (elf32_score_link_hash_table_create): Likewise.
2421 * elf32-score7.c (score_elf_create_got_section),
2422 (s7_elf32_score_new_section_hook): Likewise.
2423 * elf32-sh.c (sh_elf_link_hash_table_create),
2424 (sh_elf_check_relocs): Likewise.
2425 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2426 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2427 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2428 (tilepro_elf_check_relocs): Likewise.
2429 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2430 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2431 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2432 (elf_xtensa_new_section_hook): Likewise.
2433 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2434 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2435 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2436 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2437 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2438 * elf64-ppc.c (ppc64_elf_new_section_hook),
2439 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2440 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2441 * elf64-s390.c (elf_s390_link_hash_table_create),
2442 (elf_s390_check_relocs): Likewise.
2443 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2444 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2445 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2446 (elf_link_add_archive_symbols, compute_bucket_count),
2447 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2448 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2449 (bfd_elf_final_link): Likewise.
2450 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2451 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2452 (elfNN_aarch64_new_section_hook): Likewise.
2453 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2454 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2455 (riscv_elf_check_relocs): Likewise.
2456 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2457 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2458 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2459 (_bfd_mips_elf_link_hash_table_create): Likewise.
2460 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2461 (_bfd_sparc_elf_check_relocs),
2462 (_bfd_sparc_elf_new_section_hook): Likewise.
2463 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2464 (tilegx_elf_check_relocs): Likewise.
2465 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2466 * format.c (bfd_check_format_matches): Likewise.
2467 * hash.c (_bfd_stringtab_init): Likewise.
2468 * ihex.c (ihex_scan): Likewise.
2469 * irix-core.c (irix_core_core_file_p): Likewise.
2470 * linker.c (bfd_wrapped_link_hash_lookup),
2471 (_bfd_generic_link_hash_table_create),
2472 (_bfd_generic_reloc_link_order): Likewise.
2473 * lynx-core.c (lynx_core_file_p): Likewise.
2474 * netbsd-core.c (netbsd_core_file_p): Likewise.
2475 * osf-core.c (osf_core_core_file_p): Likewise.
2476 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2477 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2478 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2479 * peicode.h (pe_mkobject): Likewise.
2480 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2481 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2482 * sco5-core.c (read_uarea): Likewise.
2483 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2484 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2485 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2486 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2487 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2488 * srec.c (srec_scan): Likewise.
2489 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2490 * targets.c (bfd_target_list): Likewise.
2491 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2492 * trad-core.c (trad_unix_core_file_p): Likewise.
2493 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2494 (vms_new_section_hook): Likewise.
2495 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2496 * xcofflink.c (xcoff_get_section_contents),
2497 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2498 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2499 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2501 2020-02-19 Alan Modra <amodra@gmail.com>
2503 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2505 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2507 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2508 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2509 a build_list_p argument. Don't search plugin_list. Short circuit
2510 when building the plugin list.
2511 (has_plugin): Renamed to has_plugin_list.
2512 (bfd_plugin_set_plugin): Don't set has_plugin.
2513 (bfd_plugin_specified_p): Check plugin_list instead.
2514 (build_plugin_list): New function.
2515 (load_plugin): Call build_plugin_list and use plugin_list.
2517 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2520 * plugin.c (try_claim): Always clean up for LTO wrapper.
2521 (try_load_plugin): Treat each object as independent. Create a
2522 copy for plugin name.
2524 2020-02-11 Nick Clifton <nickc@redhat.com>
2526 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2527 for addresses in print statements.
2528 (msp430_elf_relax_delete_bytes): Likewise.
2529 (msp430_elf_relax_add_words): Likewise.
2530 (msp430_elf_relax_section): Likewise.
2532 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2534 * plugin.c (add_symbols): Clear plugin_data memory.
2536 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2539 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2540 (EXECUTABLE_SUFFIX): Likewise.
2541 * config.in: Regenerated.
2542 * configure: Likewise.
2543 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2544 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2545 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2546 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2547 (get_lto_wrapper): New.
2548 (setup_lto_wrapper_env): Likewise.
2549 (current_plugin): Likewise.
2550 (register_all_symbols_read): Likewise.
2551 (register_cleanup): Likewise.
2552 (get_symbols): Likewise.
2553 (add_input_file): Likewise.
2554 (bfd_plugin_close_and_cleanup): Likewise.
2555 (claim_file): Removed.
2556 (register_claim_file): Set current_plugin->claim_file.
2557 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2558 lto_syms in current_plugin.
2559 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2560 all_symbols_read handler. Copy real symbols to plugin_data.
2561 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2562 (try_load_plugin): Don't reuse the previous plugin for LTO
2563 wrapper. Set up GCC LTO wrapper if possible. Don't set
2564 plugin_list_iter->claim_file.
2565 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2567 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2570 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2572 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2573 check if previous instruction matches a conditional jump inserted
2574 earlier. Invert conditional jump and delete branch in this case.
2576 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2578 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2579 msp430_elf_relax_add_words. Support insertion of either one or two
2581 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2582 needs to be grown. Handle insertion of branch instruction to replace
2585 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2587 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2588 debugging relocations.
2589 (msp430_elf_relax_delete_bytes): Likewise.
2590 (msp430_elf_relax_add_two_words): Likewise.
2591 (msp430_elf_relax_section): Likewise.
2593 2020-02-10 Alan Modra <amodra@gmail.com>
2595 * archures.c: Wrap overlong z80 comments.
2596 * bfd-in2.h: Regenerate.
2598 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2601 * archures.c: Add GBZ80 and Z80N machine values.
2602 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2603 * coff-z80.c: Add support for new reloc.
2604 * coffcode.h: Add support for new machine values.
2605 * cpu-z80.c: Add support for new machine names.
2606 * elf32-z80.c: Add support for new reloc.
2607 * bfd-in2.h: Regenerate.
2608 * libbfd.h: Regenerate.
2610 2020-02-07 Nick Clifton <nickc@redhat.com>
2613 * elf.c (rewrite_elf_program_header): Do not complain if no
2614 sections are mapped to a segment.
2616 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2619 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2620 for garbage collection on __patchable_function_entries section
2621 without linked-to section.
2623 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2626 * bfd-in2.h: Regenerated.
2627 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2628 on section if gc_mark of any of its linked-to sections is set
2629 and don't set gc_mark again.
2630 * section.c (asection): Add linked_to_symbol_name to map_head
2633 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2635 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2636 reporting an unrecognized instruction with R_V850_LONGJUMP.
2638 2020-02-05 Alan Modra <amodra@gmail.com>
2640 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2642 2020-02-04 Alan Modra <amodra@gmail.com>
2644 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2645 R_PPC_VLE_ADDR20, goto copy_reloc.
2647 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2649 * bfd-in2.h: Regenerated.
2650 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2652 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2655 * bfd-in2.h: Regenerated.
2656 * ecoff.c (bfd_debug_section): Add section_id.
2657 * section.c (bfd_section): Add section_id.
2658 (SEC_ASSEMBLER_SECTION_ID): New.
2659 (BFD_FAKE_SECTION): Add section_id.
2661 2020-02-01 Nick Clifton <nickc@redhat.com>
2663 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2666 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2668 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2669 encodings are relative to the GOT on nios2, too.
2671 2020-01-31 Alan Modra <amodra@gmail.com>
2673 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2674 file. Use $< and $@ in rules.
2675 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2676 (elf32-ia64.c, elf64-ia64.c): Likewise.
2677 (elf32-riscv.c, elf64-riscv.c): Likewise.
2678 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2679 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2680 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2681 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2682 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2683 * Makefile.in: Regenerate.
2685 2020-01-31 Alan Modra <amodra@gmail.com>
2688 * elf.c (setup_group): Don't clear entire section contents,
2689 just the padding after group flags. Release alloc'd memory
2690 after a seek or read failure.
2692 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2694 * peXXigen.c (pe_is_repro): New function.
2695 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2696 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2698 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2700 * peXXigen.c (debug_type_names): Add names for new debug data type
2703 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2705 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2706 inner loop. Fix a memory leak.
2708 2020-01-30 Alan Modra <amodra@gmail.com>
2710 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2711 or obj_coff_keep_strings here.
2712 (coff_get_normalized_symtab): Free external syms directly.
2713 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2716 2020-01-27 Jim Wilson <jimw@sifive.com>
2718 * cpu-riscv.c (riscv_scan): New.
2719 (N): Change bfd_default_scan to riscv_scan.
2721 2020-01-27 Andreas Schwab <schwab@suse.de>
2723 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2724 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2725 * Makefile.in: Regenerate.
2726 * cpu-plugin.c: Remove.
2727 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2728 (bfd_plugin_arch): Remove declaration.
2729 * bfd-in2.h: Regenerate.
2730 * po/SRC-POTFILES.in: Regenerate.
2732 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2733 Alan Modra <amodra@gmail.com>
2736 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2738 2020-01-24 Jim Wilson <jimw@sifive.com>
2740 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2741 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2742 avoid over long line.
2744 2020-01-24 Nick Clifton <nickc@redhat.com>
2747 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2748 syms and keep strings flags as these may have been set in order to
2749 prevent a bogus call to free.
2751 2020-01-23 Nick Clifton <nickc@redhat.com>
2753 * po/fr.po: Updated French translation.
2755 2020-01-23 Alan Modra <amodra@gmail.com>
2758 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2759 by zero when p_align is zero.
2761 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2763 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2764 (riscv_prefix_cmp): Likewise.
2765 (riscv_non_std_ext_p): Deleted.
2766 (riscv_std_sv_ext_p): Likewise.
2767 (riscv_non_std_sv_ext_p): Likewise.
2768 (riscv_merge_non_std_and_sv_ext): Rename to...
2769 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2770 (riscv_merge_arch_attr_info): Replace 3 calls to
2771 riscv_merge_non_std_and_sv_ext with single call to
2772 riscv_merge_multi_letter_ext.
2773 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2774 encounter a 'z' prefix.
2775 (riscv_get_prefix_class): New function, return prefix class based
2776 on first few characters of input string.
2777 (riscv_parse_config): New structure to factor out minor differences
2778 in extension class parsing behaviour.
2779 (riscv_parse_sv_or_non_std_ext): Rename to...
2780 (riscv_parse_prefixed_ext): and parameterise with
2782 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2783 (riscv_multi_letter_ext_valid_p): New.
2784 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2785 (riscv_parse_subset): Delegate all non-single-letter parsing work
2786 to riscv_parse_prefixed_ext.
2787 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2788 (riscv_get_prefix_class): Declare.
2790 2020-01-22 Alan Modra <amodra@gmail.com>
2792 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2793 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2794 __tls_get_addr_desc.
2795 (ppc64_elf_size_stubs): Add section for linker generated
2796 __tls_get_addr_desc wrapper function. Loop at least once if
2797 generating this function.
2798 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2799 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2801 2020-01-22 Alan Modra <amodra@gmail.com>
2803 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2804 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2806 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2807 (STDU_R1_0R1, ADDI_R1_R1): Define.
2808 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2809 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2810 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2811 no_tls_get_addr_regsave.
2812 (branch_reloc_hash_match): Add hash3 and hash4.
2813 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2814 (ppc64_elf_size_dynamic_sections): Likewise.
2815 (ppc64_elf_relocate_section): Likewise.
2816 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2817 __tls_get_addr stub.
2818 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2820 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2821 eh_frame for regsave __tls_get_addr.
2823 2020-01-22 Alan Modra <amodra@gmail.com>
2825 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2826 which __tls_get_addr calls will be eliminated.
2828 2020-01-20 Nick Clifton <nickc@redhat.com>
2830 * po/pt.po: Updates Portuguese translation.
2831 * po/ru.po: Updated Russian translation.
2832 * po/uk.po: Updated Ukranian translation.
2834 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2837 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2838 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2840 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2841 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2842 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2843 "rex leal x@tlsdesc(%rip), %reg" to
2844 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2845 "call *(%eax)" to "nopl (%rax)".
2847 2020-01-20 Alan Modra <amodra@gmail.com>
2849 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2850 (MTLR_R11): Don't define.
2851 (LD_R0_0R3, CMPDI_R0_0): Define.
2852 (build_tls_get_addr_stub): Don't use r11 in stub.
2854 2020-01-20 Alan Modra <amodra@gmail.com>
2856 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2857 (defined_sym_val, is_tls_get_addr): Likewise.
2859 2020-01-18 Nick Clifton <nickc@redhat.com>
2861 * version.m4 (BFD_VERSION): Set to 2.34.50.
2862 * configure: Regenerate.
2863 * po/bfd.pot: Regenerate.
2865 2020-01-18 Nick Clifton <nickc@redhat.com>
2867 Binutils 2.34 branch created.
2869 2020-01-17 Christian Biesinger <cbiesinger@google.com>
2871 * coff-arm.c: Fix spelling error (seperate).
2872 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2874 * sysdep.h (strnlen): Fix spelling error (seperate).
2876 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
2879 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2881 2020-01-15 Alan Modra <amodra@gmail.com>
2884 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2885 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2886 of function symbols unless dot symbols are present. Do warn
2887 whenever one is created, regardles of whether a PLT entry is
2888 also emitted for the function symbol.
2890 2020-01-14 Alan Modra <amodra@gmail.com>
2892 * som.c (som_bfd_count_ar_symbols): Error when file position
2893 of symbols on chains is not strictly increasing.
2895 2020-01-14 Alan Modra <amodra@gmail.com>
2897 * vms.h (VMS_DEBUG): Define as 0.
2898 * vms-alpha.c (image_write): Move debug output after bounds check.
2900 (_bfd_vms_slurp_eihd): Warning fix.
2901 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2903 2020-01-13 Alan Modra <amodra@gmail.com>
2905 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2906 for "ignored" records.
2908 2020-01-13 Alan Modra <amodra@gmail.com>
2910 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2911 Delete asect name check. Move asect NULL check to wasm_object_p.
2912 Correct bounds check of sizes against end. Replace uses of
2913 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2914 just one bfd_release.
2915 (wasm_scan): Don't use malloc/strdup for section names,
2916 bfd_alloc instead. Simplify code prefixing section name.
2917 Formatting. Don't attempt to free memory here..
2918 (wasm_object_p): ..do so here.
2920 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2923 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2924 UNDEFWEAK_NO_DYNAMIC_RELOC.
2925 (allocate_dynrelocs_for_symbol): Likewise.
2927 2020-01-10 Tamar Christina <tamar.christina@arm.com>
2930 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2932 2020-01-10 Alan Modra <amodra@gmail.com>
2934 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2936 2020-01-09 Nick Clifton <nickc@redhat.com>
2939 * bfd.c (bfd_convert_section_contents): Check for a compress
2940 header size that is larger than the actual section size.
2942 2020-01-08 Alan Modra <amodra@gmail.com>
2945 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2946 after removing sections.
2948 2020-01-06 Jim Wilson <jimw@sifive.com>
2951 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2952 check for !bfd_link_pic (info).
2953 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2954 <R_RISCV_JAL>: Add comment.
2955 (_bfd_riscv_relax_section): For plt.offset check, add check for
2956 bfd_link_pic (info). Add comment.
2958 2020-01-06 Alan Modra <amodra@gmail.com>
2960 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2961 match failures. Don't init to bfd_error_wrong_format before
2962 calling _bfd_check_format.
2964 2020-01-06 Alan Modra <amodra@gmail.com>
2966 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2967 status rather than exiting on stack overflow or underflow.
2968 (_bfd_vms_slurp_etir): Adjust to suit.
2970 2020-01-06 Alan Modra <amodra@gmail.com>
2972 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2974 2020-01-06 Alan Modra <amodra@gmail.com>
2976 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2977 command. Check name offset is within command.
2978 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2979 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2980 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2981 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2982 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2983 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2984 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2985 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2986 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2987 (bfd_mach_o_read_segment): Similarly.
2988 (bfd_mach_o_read_thread): Properly bound check thread struct.
2989 Don't repeat checks on second loop.
2990 (bfd_mach_o_read_command): Fail on invalid command length.
2992 2020-01-04 Alan Modra <amodra@gmail.com>
2994 * format.c (bfd_check_format_matches): Add preserve_match.
2995 Save initial bfd state in "preserve", matched bfd state in
2996 "preserve_match". Save just the first match. Release
2997 bfd_alloc memory. Restore and finish preserved state as
2998 appropriate on all function exit paths.
3000 2020-01-04 Alan Modra <amodra@gmail.com>
3002 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3004 2020-01-04 Alan Modra <amodra@gmail.com>
3006 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3009 2020-01-03 Nick Clifton <nickc@redhat.com>
3012 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3013 there is enough data remaining in the code buffer before
3014 attempting to read a function stub.
3016 2020-01-03 Nick Clifton <nickc@redhat.com>
3019 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3020 return value from bfd_malloc.
3021 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3022 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3023 (elf32_arm_filter_cmse_symbols): Likewise.
3024 (elf32_arm_write_section): Likewise.
3025 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3026 (bfd_mach_o_follow_dsym): Likewise.
3027 * pef.c (bfd_pef_print_loader_section): Likewise.
3028 (bfd_pef_scan_start_address): Likewise.
3029 (bfd_pef_parse_function_stubs): Likewise.
3030 (bfd_pef_parse_symbols): Likewise.
3032 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3034 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3035 on binary inputs ld/PR25316.
3036 (is_ia64_elf): new helper to filter on ia64 objects.
3038 2020-01-03 Jan Beulich <jbeulich@suse.com>
3040 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3042 (bfd_mach_o_scan): Insert underscore in two variable names.
3044 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3046 * Makefile.am: Add z80-elf target support.
3047 * configure.ac: Likewise.
3048 * targets.c: Likewise.
3049 * Makefile.in: Regenerate.
3050 * configure: Regenerate.
3051 * config.bfd: Add z80-elf target support and new arches: ez80 and
3053 * elf32-z80.c: New file.
3054 * archures.c: Add new z80 architectures: eZ80 and Z180.
3055 * coffcode.h: Likewise.
3056 * cpu-z80.c: Likewise.
3057 * coff-z80.c: Add new relocations for Z80 target and local label
3059 * reloc.c: Add new relocs.
3060 * bfd-in2.h: Regenerate.
3061 * libbfd.h: Regenerate.
3063 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3067 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3069 2020-01-01 Alan Modra <amodra@gmail.com>
3071 Update year range in copyright notice of all files.
3073 For older changes see ChangeLog-2019
3075 Copyright (C) 2020 Free Software Foundation, Inc.
3077 Copying and distribution of this file, with or without modification,
3078 are permitted in any medium without royalty provided the copyright
3079 notice and this notice are preserved.
3085 version-control: never