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