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