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