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