1 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
4 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
7 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
9 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
10 dynamic relocations for non SEC_ALLOC sections.
12 2020-06-03 Gunther Nikl <gnikl@justmail.de>
14 * aout64.c (BMAGIC, QMAGIC): Do not define.
15 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
16 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
17 to check the file format.
18 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
19 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
20 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
22 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
24 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
25 relocations for non SEC_ALLOC sections.
27 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
29 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
30 * elf32-arm.c (maybe_set_textrel): Removed.
31 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
32 with _bfd_elf_maybe_set_textrel.
33 * elf32-csky.c (maybe_set_textrel): Removed.
34 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
35 with _bfd_elf_maybe_set_textrel.
36 * elf32-hppa.c (maybe_set_textrel): Removed.
37 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
38 with _bfd_elf_maybe_set_textrel.
39 * elf32-lm32.c (maybe_set_textrel): Removed.
40 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
41 with _bfd_elf_maybe_set_textrel.
42 * elf32-m32r.c (maybe_set_textrel): Removed.
43 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
44 with _bfd_elf_maybe_set_textrel.
45 * elf32-metag.c (maybe_set_textrel): Removed.
46 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
47 with _bfd_elf_maybe_set_textrel.
48 * elf32-nds32.c (maybe_set_textrel): Removed.
49 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
50 with _bfd_elf_maybe_set_textrel.
51 * elf32-or1k.c (maybe_set_textrel): Removed.
52 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
53 with _bfd_elf_maybe_set_textrel.
54 * elf32-ppc.c (maybe_set_textrel): Removed.
55 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
56 with _bfd_elf_maybe_set_textrel.
57 * elf32-s390.c (maybe_set_textrel): Removed.
58 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
59 with _bfd_elf_maybe_set_textrel.
60 * elf32-sh.c (maybe_set_textrel): Removed.
61 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
62 with _bfd_elf_maybe_set_textrel.
63 * elf32-tic6x.c (maybe_set_textrel): Removed.
64 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
65 with _bfd_elf_maybe_set_textrel.
66 * elf32-tilepro.c (maybe_set_textrel): Removed.
67 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
68 with _bfd_elf_maybe_set_textrel.
69 * elf64-ppc.c (maybe_set_textrel): Removed.
70 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
71 with _bfd_elf_maybe_set_textrel.
72 * elf64-s390.c (maybe_set_textrel): Removed.
73 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
74 with _bfd_elf_maybe_set_textrel.
75 * elfnn-aarch64.c (maybe_set_textrel): Removed.
76 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
77 with _bfd_elf_maybe_set_textrel.
78 * elfnn-riscv.c (maybe_set_textrel): Removed.
79 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
80 with _bfd_elf_maybe_set_textrel.
81 * elfxx-sparc.c (maybe_set_textrel): Removed.
82 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
83 with _bfd_elf_maybe_set_textrel.
84 * elfxx-tilegx.c (maybe_set_textrel): Removed.
85 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
86 with _bfd_elf_maybe_set_textrel.
87 * elfxx-x86.c (maybe_set_textrel): Removed.
88 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
89 with _bfd_elf_maybe_set_textrel.
90 * elflink.c (_bfd_elf_maybe_set_textrel): New.
92 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
95 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
97 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
98 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
99 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
100 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
102 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
103 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
104 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
105 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
106 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
107 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
108 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
109 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
110 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
111 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
112 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
113 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
114 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
115 (elf_backend_copy_indirect_symbol): Likewise.
116 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
117 (elf_backend_copy_indirect_symbol): Likewise.
118 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
120 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
123 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
124 * elf32-arm.c (readonly_dynrelocs): Removed.
125 (maybe_set_textrel): Replace readonly_dynrelocs with
126 _bfd_elf_readonly_dynrelocs.
127 * elf32-csky.c (readonly_dynrelocs): Removed.
128 (maybe_set_textrel): Replace readonly_dynrelocs with
129 _bfd_elf_readonly_dynrelocs.
130 * elf32-hppa.c(readonly_dynrelocs): Removed.
131 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
132 _bfd_elf_readonly_dynrelocs.
133 (maybe_set_textrel): Likewise.
134 * elf32-lm32.c (readonly_dynrelocs): Removed.
135 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
136 with _bfd_elf_readonly_dynrelocs.
137 (maybe_set_textrel): Likewise.
138 * elf32-m32r.c (readonly_dynrelocs): Removed.
139 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
140 with _bfd_elf_readonly_dynrelocs.
141 (maybe_set_textrel): Likewise.
142 * elf32-metag.c (readonly_dynrelocs): Removed.
143 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
144 with _bfd_elf_readonly_dynrelocs.
145 (maybe_set_textrel): Likewise.
146 * elf32-microblaze.c (readonly_dynrelocs): Removed.
147 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
148 with _bfd_elf_readonly_dynrelocs.
149 * elf32-nds32.c (readonly_dynrelocs): Removed.
150 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
151 with _bfd_elf_readonly_dynrelocs.
152 (maybe_set_textrel): Likewise.
153 * elf32-or1k.c (readonly_dynrelocs): Removed.
154 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
155 with _bfd_elf_readonly_dynrelocs.
156 * elf32-ppc.c (readonly_dynrelocs): Removed.
157 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
158 _bfd_elf_readonly_dynrelocs.
159 (ppc_elf_adjust_dynamic_symbol): Likewise.
160 (maybe_set_textrel): Likewise.
161 * elf32-s390.c (readonly_dynrelocs): Removed.
162 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
163 with _bfd_elf_readonly_dynrelocs.
164 (maybe_set_textrel): Likewise.
165 * elf32-sh.c (readonly_dynrelocs): Removed.
166 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
167 _bfd_elf_readonly_dynrelocs.
168 (maybe_set_textrel): Likewise.
169 * elf32-tic6x.c (readonly_dynrelocs): Removed.
170 (maybe_set_textrel): Replace readonly_dynrelocs with
171 _bfd_elf_readonly_dynrelocs.
172 * elf32-tilepro.c (readonly_dynrelocs): Removed.
173 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
174 with _bfd_elf_readonly_dynrelocs.
175 (maybe_set_textrel): Likewise.
176 * elf64-ppc.c (readonly_dynrelocs): Removed.
177 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
178 _bfd_elf_readonly_dynrelocs.
179 (ppc64_elf_adjust_dynamic_symbol): Likewise.
180 (maybe_set_textrel): Likewise.
181 * elf64-s390.c (readonly_dynrelocs): Removed.
182 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
183 with _bfd_elf_readonly_dynrelocs.
184 (maybe_set_textrel): Likewise.
185 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
186 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
187 (maybe_set_textrel): Replace readonly_dynrelocs with
188 _bfd_elf_readonly_dynrelocs.
189 * elfnn-riscv.c (readonly_dynrelocs): Removed.
190 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
191 with _bfd_elf_readonly_dynrelocs.
192 (maybe_set_textrel): Likewise.
193 * elfxx-sparc.c (readonly_dynrelocs): Removed.
194 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
195 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
196 (maybe_set_textrel): Likewise.
197 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
198 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
199 with _bfd_elf_readonly_dynrelocs.
200 (maybe_set_textrel): Likewise.
201 * elfxx-x86.c (readonly_dynrelocs): Removed.
202 (maybe_set_textrel): Replace readonly_dynrelocs with
203 _bfd_elf_readonly_dynrelocs.
204 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
206 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
208 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
209 -fsanitize=undefined.
211 2020-06-03 Alan Modra <amodra@gmail.com>
215 * peicode.h (pe_ILF_make_a_section): Align data for compilers
217 (pe_ILF_build_a_bfd): Likewise.
219 2020-06-03 Alan Modra <amodra@gmail.com>
222 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
223 core files as well as objects.
225 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
228 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
229 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
231 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
232 (elf_arc_link_hash_newfunc): Updated.
233 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
234 (elf32_arm_link_hash_newfunc): Updated.
235 (elf32_arm_copy_indirect_symbol): Likewise.
236 (elf32_arm_check_relocs): Likewise.
237 (readonly_dynrelocs): Likewise.
238 (allocate_dynrelocs_for_symbol): Likewise.
239 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
240 (csky_elf_link_hash_newfunc): Updated.
241 (csky_allocate_dynrelocs): Likewise.
242 (readonly_dynrelocs): Likewise.
243 (csky_elf_copy_indirect_symbol): Likewise.
244 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
245 (hppa_link_hash_newfunc): Updated.
246 (elf32_hppa_copy_indirect_symbol): Likewise.
247 (elf32_hppa_hide_symbol): Likewise.
248 (elf32_hppa_adjust_dynamic_symbol): Likewise.
249 (allocate_dynrelocs): Likewise.
250 (elf32_hppa_relocate_section): Likewise.
251 * elf32-i386.c (elf_i386_check_relocs): Likewise.
252 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
253 (lm32_elf_link_hash_newfunc): Likewise.
254 (lm32_elf_link_hash_table_create): Updated.
255 (readonly_dynrelocs): Likewise.
256 (allocate_dynrelocs): Likewise.
257 (lm32_elf_copy_indirect_symbol): Likewise.
258 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
259 (m32r_elf_link_hash_newfunc): Likewise.
260 (m32r_elf_link_hash_table_create): Updated.
261 (m32r_elf_copy_indirect_symbol): Likewise.
262 (allocate_dynrelocs): Likewise.
263 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
264 (metag_link_hash_newfunc): Updated.
265 (elf_metag_copy_indirect_symbol): Likewise.
266 (readonly_dynrelocs): Likewise.
267 (allocate_dynrelocs): Likewise.
268 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
270 (link_hash_newfunc): Updated.
271 (microblaze_elf_check_relocs): Likewise.
272 (microblaze_elf_copy_indirect_symbol): Likewise.
273 (readonly_dynrelocs): Likewise.
274 (allocate_dynrelocs): Likewise.
275 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
276 (nds32_elf_link_hash_newfunc): Updated.
277 (nds32_elf_copy_indirect_symbol): Likewise.
278 (readonly_dynrelocs): Likewise.
279 (allocate_dynrelocs): Likewise.
280 (nds32_elf_check_relocs): Likewise.
281 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
282 (link_hash_newfunc): Updated.
283 (nios2_elf32_copy_indirect_symbol): Likewise.
284 (nios2_elf32_check_relocs): Likewise.
285 (allocate_dynrelocs): Likewise.
286 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
287 (or1k_elf_link_hash_newfunc): Updated.
288 (readonly_dynrelocs): Likewise.
289 (allocate_dynrelocs): Likewise.
290 (or1k_elf_copy_indirect_symbol): Likewise.
291 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
292 (ppc_elf_link_hash_newfunc): Updated.
293 (ppc_elf_copy_indirect_symbol): Likewise.
294 (ppc_elf_check_relocs): Likewise.
295 (readonly_dynrelocs): Likewise.
296 (ppc_elf_adjust_dynamic_symbol): Likewise.
297 (allocate_dynrelocs): Likewise.
298 (ppc_elf_relocate_section): Likewise.
299 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
300 (link_hash_newfunc): Updated.
301 (elf_s390_copy_indirect_symbol): Likewise.
302 (readonly_dynrelocs): Likewise.
303 (elf_s390_adjust_dynamic_symbol): Likewise.
304 (allocate_dynrelocs): Likewise.
305 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
306 (sh_elf_link_hash_newfunc): Updated.
307 (readonly_dynrelocs): Likewise.
308 (allocate_dynrelocs): Likewise.
309 (sh_elf_copy_indirect_symbol): Likewise.
310 (sh_elf_check_relocs): Likewise.
311 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
312 (elf32_tic6x_link_hash_newfunc): Likewise.
313 (elf32_tic6x_link_hash_table_create): Updated.
314 (readonly_dynrelocs): Likewise.
315 (elf32_tic6x_check_relocs): Likewise.
316 (elf32_tic6x_allocate_dynrelocs): Likewise.
317 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
319 (link_hash_newfunc): Updated.
320 (tilepro_elf_copy_indirect_symbol): Likewise.
321 (tilepro_elf_check_relocs): Likewise.
322 (allocate_dynrelocs): Likewise.
323 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
324 (ppc64_elf_copy_indirect_symbol): Updated.
325 (ppc64_elf_check_relocs): Likewise.
326 (readonly_dynrelocs): Likewise.
327 (ppc64_elf_adjust_dynamic_symbol): Likewise.
328 (dec_dynrel_count): Likewise.
329 (allocate_dynrelocs): Likewise.
330 (ppc64_elf_relocate_section): Likewise.
331 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
332 (link_hash_newfunc): Updated.
333 (elf_s390_copy_indirect_symbol): Likewise.
334 (readonly_dynrelocs): Likewise.
335 (allocate_dynrelocs): Likewise.
336 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
337 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
339 (elfNN_aarch64_link_hash_newfunc): Updated.
340 (elfNN_aarch64_copy_indirect_symbol): Likewise.
341 (readonly_dynrelocs): Likewise.
342 (need_copy_relocation_p): Likewise.
343 (elfNN_aarch64_allocate_dynrelocs): Likewise.
344 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
345 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
346 (link_hash_newfunc): Updated.
347 (riscv_elf_copy_indirect_symbol): Likewise.
348 (riscv_elf_check_relocs): Likewise.
349 (readonly_dynrelocs): Likewise.
350 (allocate_dynrelocs): Likewise.
351 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
353 (link_hash_newfunc): Updated.
354 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
355 (_bfd_sparc_elf_check_relocs): Likewise.
356 (readonly_dynrelocs): Likewise.
357 (allocate_dynrelocs): Likewise.
358 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
359 (link_hash_newfunc): Updated.
360 (tilegx_elf_copy_indirect_symbol): Likewise.
361 (tilegx_elf_check_relocs): Likewise.
362 (readonly_dynrelocs): Likewise.
363 (allocate_dynrelocs): Likewise.
364 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
365 (readonly_dynrelocs): Likewise.
366 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
367 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
369 2020-06-01 Alan Modra <amodra@gmail.com>
371 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
372 command against cmd_length, not the end of record. For
373 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
374 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
377 2020-05-28 David Faust <david.faust@oracle.com>
379 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
380 R_BPF_INSN_{32,64} relocations.
382 2020-05-28 Stephen Casner <casner@acm.org>
384 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
385 addreses in .long (used in testsuites) and .stab values.
387 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
390 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
391 Check bfd_link_dll when issue a DT_TEXTREL warning.
392 * elfxx-x86.c (maybe_set_textrel): Likewise.
393 (_bfd_x86_elf_size_dynamic_sections): Likewise.
395 2020-05-26 Nick Clifton <nickc@redhat.com>
397 * plugin.c (try_load_plugin): Extend error message when a plugin
400 2020-05-23 Alan Modra <amodra@gmail.com>
402 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
404 2020-05-22 Alan Modra <amodra@gmail.com>
407 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
408 attributes from shared libraries, and do not return an error if
411 2020-05-21 Alan Modra <amodra@gmail.com>
414 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
416 (_bfd_delete_bfd): Free the copy.
417 (_bfd_new_bfd): Free nbfd->memory on error.
419 2020-05-21 Alan Modra <amodra@gmail.com>
421 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
422 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
423 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
424 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
425 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
426 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
427 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
428 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
429 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
430 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
431 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
432 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
433 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
434 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
435 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
436 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
437 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
438 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
439 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
440 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
442 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
444 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
445 get_default_version. It is used to find the default version for
446 the specific extension.
447 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
448 default_major_version and default_minor_version. Add new bfd_boolean
449 parameter *use_default_version. Set it to TRUE if we need to call
450 the callback rps->get_default_version to find the default version.
451 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
452 the default version in riscv_parsing_subset_version, and then call
453 riscv_add_subset to add the subset into subset list.
454 (riscv_parse_prefixed_ext): Likewise.
455 (riscv_std_z_ext_strtab): Support Zicsr extensions.
456 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
457 strings rather than characters.
458 riscv_merge_arch_attr_info): The callback function get_default_version
459 is only needed for assembler, so set it to NULL int the linker.
460 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
461 * elfxx-riscv.h: Updated.
463 2020-05-20 Alan Modra <amodra@gmail.com>
466 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
467 use bfd_set_filename.
468 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
469 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
470 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
471 (bfd_create): Likewise.
472 (_bfd_delete_bfd): Don't free filename.
473 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
474 return pointer to the copy or NULL on alloc fail.
475 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
476 result of bfd_set_filename.
477 * bfd-in2.h: Regenerate.
479 2020-05-20 Alan Modra <amodra@gmail.com>
482 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
483 section size against file size.
484 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
486 2020-05-19 Gunther Nikl <gnikl@justmail.de>
489 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
490 and memset when allocating memory for the sections_being_created
493 2020-05-19 Stafford Horne <shorne@gmail.com>
495 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
497 (or1k_elf_relocate_section): Access srelgot via
498 htab->root.srelgot. Add assertions for srelgot->contents.
499 Introduce local variable for srelgot to not reuse global
501 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
502 (or1k_set_got_and_rela_sizes): New function.
503 (or1k_initial_exec_offset): New function.
504 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
505 (or1k_elf_relocate_section): Allow for TLS to handle multiple
507 (or1k_elf_check_relocs): Use OR to set TLS access.
508 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
510 (or1k_elf_size_dynamic_sections): Use
511 or1k_set_got_and_rela_sizes to set sizes.
512 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
513 (TCB_SIZE): New macro.
514 (tpoff): Use TCB_SIZE and alignment to calculate offset.
515 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
516 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
517 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
518 (tpoff): Add dynamic boolean argument.
519 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
521 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
523 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
524 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
525 cases with BFD_RELOC_AARCH64_JUMP26.
526 (elfNN_aarch64_check_relocs): Likewise.
528 2020-05-19 Alan Modra <amodra@gmail.com>
530 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
531 bfd_get_filename rather than accessing bfd->filename directly.
532 * aout-target.h (MY (object_p)): Likewise.
533 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
534 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
535 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
536 (_bfd_archive_bsd44_construct_extended_name_table),
537 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
538 (_bfd_bsd_write_armap): Likewise.
539 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
540 * cache.c (bfd_open_file): Likewise.
541 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
542 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
543 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
544 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
545 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
546 * elf32-nds32.c (nds32_elf_output_symbol_hook),
547 (patch_tls_desc_to_ie): Likewise.
548 * elf32-spu.c (sort_bfds, print_one_overlay_section),
549 (spu_elf_auto_overlay): Likewise.
550 * elf64-hppa.c (elf_hppa_final_link): Likewise.
551 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
552 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
553 * elflink.c (bfd_elf_size_dynamic_sections),
554 (elf_link_input_bfd): Likewise.
555 * linker.c (_bfd_generic_link_output_symbols): Likewise.
556 * mach-o.c (bfd_mach_o_follow_dsym),
557 (bfd_mach_o_close_and_cleanup): Likewise.
558 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
559 (find_separate_debug_file, get_build_id_name): Likewise.
560 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
561 * plugin.c (bfd_plugin_open_input): Likewise.
562 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
563 * som.c (som_write_armap): Likewise.
564 * srec.c (srec_write_record, srec_write_symbols): Likewise.
565 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
566 (_bfd_vms_lib_write_archive_contents): Likewise.
567 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
569 2020-05-19 Alan Modra <amodra@gmail.com>
572 * bfdio.c (_bfd_real_fopen): Typo fix.
574 2020-05-18 Nick Clifton <nickc@redhat.com>
577 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
578 for the sections_being_created array.
580 2020-05-18 Alan Modra <amodra@gmail.com>
582 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
583 they can be freed without also freeing internal_relocs.
585 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
588 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
589 separators into DOS style when creating a WIN32 fullpath.
591 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
593 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
594 to initialize RISC-V tdata.
596 2020-05-12 Gunther Nikl <gnikl@justmail.de>
598 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
601 2020-05-11 Alan Modra <amodra@gmail.com>
603 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
605 2020-05-11 Alan Modra <amodra@gmail.com>
607 * elf64-ppc.c: Rename powerxx to power10 throughout.
609 2020-05-11 Alan Modra <amodra@gmail.com>
612 * coffgen.c (coff_get_normalized_symtab): Check that buffer
613 contains required number of auxents before processing any auxent.
614 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
615 file name from auxents for PE.
617 2020-05-04 Gunther Nikl <gnikl@justmail.de>
619 * aout-cris.c (DEFAULT_ARCH): Delete define.
620 (MY_set_arch_mach): Likewise.
621 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
623 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
624 of r_type before the shift.
626 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
629 * elfnn-aarch64.c (group_sections): Copy implementation from
632 2020-05-01 Alan Modra <amodra@gmail.com>
635 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
636 accessing root.u.def of symbols. Also check root.u.def.section
637 is non-NULL. Reverse tests so as to make the logic positive.
639 2020-05-01 Alan Modra <amodra@gmail.com>
642 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
643 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
645 2020-05-01 Alan Modra <amodra@gmail.com>
648 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
649 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
650 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
651 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
652 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
653 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
654 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
655 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
656 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
657 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
659 2020-05-01 Alan Modra <amodra@gmail.com>
662 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
663 from shared libraries.
665 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
667 * elf32-xtensa.c (relax_section): Don't negate diff_value for
668 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
669 equals 0. Report overflow when the result has negative sign but
670 all significant bits are zero.
672 2020-04-29 Gunther Nikl <gnikl@justmail.de>
674 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
675 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
677 2020-04-28 Alan Modra <amodra@gmail.com>
679 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
680 Emit warning message.
682 2020-04-27 Tamar Christina <tamar.christina@arm.com>
684 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
685 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
686 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
687 to x86_64_pe_big_vec as it not a big-endian format.
688 (vec i386_pe_big_vec): New.
689 * configure.ac: Likewise.
690 * targets.c: Likewise.
691 * configure: Regenerate.
692 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
693 COFF_WITH_PE_BIGOBJ): New.
694 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
696 (x86_64_pe_be_vec): Moved.
698 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
700 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
701 * elf.c (elfcore_grok_arc_v2): New function.
702 (elfcore_grok_note): Call the new function to handle the corresponding
704 (elfcore_write_arc_v2): New function.
705 (elfcore_write_register_note): Call the new function to handle the
706 corresponding pseudo-sections.
708 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
711 * bfd-in2.h: Regenerated.
712 * elf32-xtensa.c (elf_howto_table): New entries for
713 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
714 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
715 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
716 R_XTENSA_NDIFF{8,16,32}.
717 * libbfd.h (bfd_reloc_code_real_names): Add names for
718 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
719 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
720 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
721 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
723 2020-04-21 Tamar Christina <tamar.christina@arm.com>
726 * compress.c (bfd_get_full_section_contents): Exclude sections with no
729 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
732 * elf-bfd.h (elf_backend_data): Add
733 elf_backend_strip_zero_sized_dynamic_sections.
734 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
735 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
737 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
739 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
741 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
743 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
745 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
747 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
749 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
751 2020-04-21 Nick Clifton <nickc@redhat.com>
753 * po/sr.po: Updated Serbian translation.
755 2020-04-21 Alan Modra <amodra@gmail.com>
757 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
760 2020-04-20 Stephen Casner <casner@acm.org>
762 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
763 causing globals from linker script to be treated as debug symbols.
764 (translate_symbol_table): Don't sign-extend symbol values from 16
765 to 64 bits in nm output.
767 2020-04-20 Alan Modra <amodra@gmail.com>
769 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
771 2020-04-18 Alan Modra <amodra@gmail.com>
773 * section.c (bfd_is_const_section): Correct test for special
775 * bfd-in2.h: Regenerate.
777 2020-04-17 Alan Modra <amodra@gmail.com>
780 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
783 2020-04-16 Nick Clifton <nickc@redhat.com>
786 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
787 abort with a more helpful error message.
789 2020-04-16 Alan Modra <amodra@gmail.com>
792 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
795 2020-04-15 Fangrui Song <maskray@google.com>
798 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
799 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
800 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
801 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
802 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
803 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
804 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
805 * elf32-sh.c (sh_elf_relocate_section): Likewise.
806 * elf32-spu.c (spu_elf_relocate_section): Likewise.
807 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
808 * elflink.c (elf_link_output_extsym): Likewise.
809 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
811 2020-04-15 Alan Modra <amodra@gmail.com>
814 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
815 pointer into strings that may be freed for section name, always
816 allocate a new string.
818 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
819 Jan W. Jagersma <jwjagersma@gmail.com>
821 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
822 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
823 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
824 (_bfd_go32_mkobject): New functions.
825 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
826 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
827 (go32exe_mkobject): Call _bfd_go32_mkobject.
828 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
829 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
831 (coff_write_relocs): Enable extended reloc counter code if
832 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
833 (coff_write_object_contents): Likewise. Pad section headers
834 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
835 instead of coff_swap_scnhdr_out.
836 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
837 enable extended reloc counter.
838 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
839 Declare with ATTRIBUTE_UNUSED.
840 * libcoff-in.h: (struct coff_tdata): New field go32.
842 * libcoff.h: Regenerate.
844 2020-04-14 Fangrui Song <maskray@google.com>
847 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
850 2020-04-14 Stephen Casner <casner@acm.org>
853 * pdp11.c: Add implementation of --imagic option.
854 (adjust_o_magic): Fix objcopy --extract-symbol test.
855 * libaout.h (enum aout_magic): Add i_magic.
857 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
858 Nick Clifton <nickc@redhat.com>
860 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
862 <default>: Error rather than abort.
864 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
867 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
868 relocation section from section group.
870 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
872 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
873 bfd->origin to file offset.
874 * bfdwin.c (bfd_get_file_window): Likewise.
875 * bfd.c: Clarify the use of the bfd->origin field.
876 * bfd-in2.h: Regenerate.
877 * coff-i386.c: Don't include go32exe.h. Allow overriding
878 coff_write_object_contents via COFF_WRITE_CONTENTS.
879 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
880 (go32exe_write_object_contents): New functions.
881 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
882 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
883 (create_go32_stub): Remove check for 2k size limit. Read stub
884 from go32exe_temp_stub if present.
885 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
886 copy variable-length stub.
887 (go32_check_format): Read stub to go32exe_temp_stub, set
888 origin, return go32exe_cleanup.
889 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
890 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
891 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
892 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
893 Remove functions and their associated #defines.
894 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
895 * libcoff-in.h: (struct coff_tdata): New field stub_size.
896 Rename field go32stub to stub.
897 * libcoff.h: Regenerate.
898 * coff-stgo32.c (go32_check_format): Rename to...
899 (go32exe_check_format): ...this.
900 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
901 (go32exe_copy_private_bfd_data): ...this.
902 (stub_bytes): Rename to...
903 (go32exe_default_stub): ...this.
904 (create_go32_stub): Rename to...
905 (go32exe_create_stub): ...this.
906 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
909 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
913 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
914 relocation to R_386_32 for relocation against non-preemptible
916 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
917 allocate dynamic relocation for non-preemptible absolute symbol.
918 (elf_i386_relocate_section): Pass sec to
919 GENERATE_DYNAMIC_RELOCATION_P.
920 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
921 (elf_x86_64_convert_load_reloc): Covert load relocation to
922 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
923 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
924 for non-preemptible absolute symbol if they overflow.
925 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
926 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
927 symbol. Don't allocate dynamic relocation for non-preemptible
929 (elf_x86_64_relocate_section): Don't generate relative relocation
930 for GOTPCREL relocations aganst local absolute symbol. Pass sec
931 to GENERATE_DYNAMIC_RELOCATION_P.
932 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
933 against non-preemptible absolute symbol.
934 (_bfd_elf_x86_valid_reloc_p): New function.
935 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
937 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
938 argument. Don't generate dynamic relocation against
939 non-preemptible absolute symbol.
941 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
942 against non-preemptible absolute symbol.
944 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
945 (_bfd_elf_x86_valid_reloc_p): New.
947 2020-04-01 Tamar Christina <tamar.christina@arm.com>
950 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
951 address in the GOT if in thumb only mode.
953 2020-04-01 Tamar Christina <tamar.christina@arm.com>
955 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
957 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
959 * mmo.c (mmo_scan): Create .text section only when needed, not
962 2020-03-31 Alan Modra <amodra@gmail.com>
964 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
967 2020-03-31 Alan Modra <amodra@gmail.com>
969 * vms-alpha.c (image_write): Check bounds for sections without
970 contents too. Error on non-zero write to section without
972 (_bfd_vms_slurp_etir): Check return of image_write* functions.
974 2020-03-31 Alan Modra <amodra@gmail.com>
976 * tekhex.c (pass_over): Check is_eof before reading buffer.
978 2020-03-30 Nick Clifton <nickc@redhat.com>
981 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
982 field to timestamp and make it an integer.
983 * libcoff.h: Regenerate.
984 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
985 field in the pe_data structure rather than the insert_timestamp
988 2020-03-30 Alan Modra <amodra@gmail.com>
991 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
994 2020-03-26 Nick Clifton <nickc@redhat.com>
996 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
997 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
999 * libbfd.h: Regenerate.
1001 2020-03-26 Alan Modra <amodra@gmail.com>
1003 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
1005 2020-03-26 Alan Modra <amodra@gmail.com>
1007 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
1009 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
1011 2020-03-25 Nick Clifton <nickc@redhat.com>
1013 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
1015 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
1016 * libbfd.h: Regenerate.
1018 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
1020 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
1021 correct field name in the output string.
1023 2020-03-25 Alan Modra <amodra@gmail.com>
1026 * elf.c (assign_file_positions_for_load_sections): Adjust offset
1027 for SHT_NOBITS section if first in segment.
1029 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1032 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
1033 (_bfd_elf_get_symbol_version_string): This.
1034 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
1035 (_bfd_elf_get_symbol_version_string): This.
1036 (bfd_elf_print_symbol): Pass TRUE to
1037 _bfd_elf_get_symbol_version_string.
1038 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
1039 bfd_boolean argument.
1040 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
1041 * targets.c (_bfd_get_symbol_version_string): Likewise.
1042 (bfd_get_symbol_version_string): Likewise.
1043 * bfd-in2.h: Regenerated.
1045 2020-03-24 Nick Clifton <nickc@redhat.com>
1046 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1049 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
1052 2020-03-24 Nick Clifton <nickc@redhat.com>
1055 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
1056 segment to use for PT_GNU_RELRO, ignore empty sections in a
1057 segment's current list.
1059 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1062 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
1064 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
1067 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
1068 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
1069 on the previous _bfd_elf_get_symbol_version_string.
1070 (_bfd_elf_get_symbol_version_string): Use it.
1072 2020-03-24 Alan Modra <amodra@gmail.com>
1074 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
1075 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
1078 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
1080 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
1082 2020-03-23 Alan Modra <amodra@gmail.com>
1084 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
1085 symbol count. Allocate an extra byte to ensure name strings
1086 are terminated. Sanity check name offsets. Release memory on
1089 2020-03-23 Alan Modra <amodra@gmail.com>
1091 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
1092 field hasn't been read. Remove unnecessary casts.
1094 2020-03-22 Alan Modra <amodra@gmail.com>
1096 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
1097 enough to read number of symbols.
1099 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
1101 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
1102 (EXECUTABLE_SUFFIX): Likewise.
1103 * config.in: Regenerated.
1104 * configure: Likewise.
1105 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
1106 _bfd_generic_close_and_cleanup.
1107 (plugin_list_entry): Remove resolution_file, resolution_option,
1108 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
1109 lto_wrapper, gcc_env and initialized,
1110 (need_lto_wrapper_p): Removed.
1111 (get_lto_wrapper): Likewise.
1112 (setup_lto_wrapper_env): Likewise.
1113 (register_all_symbols_read): Likewise.
1114 (egister_cleanup): Likewise.
1115 (get_symbols): Likewise.
1116 (add_input_file): Likewise.
1117 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
1118 (add_symbols): Updated.
1119 (try_claim): Likewise.
1120 (try_load_plugin): Likewise.
1121 (bfd_plugin_canonicalize_symtab): Likewise.
1122 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
1123 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
1125 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
1128 * plugin.c (plugin_list_entry): Add has_symbol_type.
1129 (add_symbols_v2): New function.
1130 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
1131 provides symbol type.
1132 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
1133 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
1136 2020-03-20 Alan Modra <amodra@gmail.com>
1138 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
1139 enough to read number of symbols.
1141 2020-03-20 Alan Modra <amodra@gmail.com>
1143 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
1144 backend functions for NULL before calling.
1145 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
1146 (bfd_section_from_shdr, assign_section_numbers): Likewise.
1147 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
1148 * elfnn-ia64.c (ignore_errors): New function.
1149 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
1151 2020-03-19 Nick Clifton <nickc@redhat.com>
1154 * dwarf2.c (struct varinfo): Add unit_offset field to record the
1155 location of the varinfo in the unit's debug info data. Change the
1156 type of the stack field to a boolean.
1157 (lookup_var_by_offset): New function. Returns the varinfo
1158 structure for the variable described at the given offset in the
1160 (scan_unit_for_symbols): Add support for variables which have the
1161 DW_AT_specification attribute.
1163 2020-03-19 Nick Clifton <nickc@redhat.com>
1166 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
1169 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
1171 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
1173 2020-03-18 Nick Clifton <nickc@redhat.com>
1176 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
1177 memory access when processing a corrupt secondary reloc section.
1179 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
1181 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
1182 instead of calling abort.
1183 * elf32-csky.c (csky_build_one_stub): Likewise.
1184 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1185 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1186 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1187 * elf32-metag.c (metag_build_one_stub): Likewise.
1188 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1189 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1190 (ppc_size_one_stub): Likewise.
1191 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1193 2020-03-17 Nick Clifton <nickc@redhat.com>
1196 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
1197 with error messages.
1199 2020-03-17 Nick Clifton <nickc@redhat.com>
1202 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
1203 free. Add free on another failure path.
1205 2020-03-16 Alan Modra <amodra@gmail.com>
1208 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
1209 we have a non-zero section count. Do lma comparison in octets.
1211 2020-03-16 Alan Modra <amodra@gmail.com>
1213 * vms-alpha.c (dst_restore_location): Validate index into
1214 dst_ptr_offsets array before accessing. Return status.
1215 (dst_retrieve_location): Similarly, making "loc" parameter a
1216 pointer to return value.
1217 (_bfd_vms_slurp_etir): Update calls to above functions.
1219 2020-03-14 Kamil Rytarowski <n54@gmx.com>
1221 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
1223 * configure: Regenerated.
1225 2020-03-14 Alan Modra <amodra@gmail.com>
1227 * section.c (BFD_FAKE_SECTIONS): Formatting.
1228 * bfd-in2.h: Regenerate.
1230 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1232 * elf.c (elfcore_grok_netbsd_note): Add support for
1233 NT_NETBSDCORE_LWPSTATUS notes.
1235 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1237 * bfd-in2.h: Regenerate.
1238 * section.c (asection): Add already_assigned field.
1239 (BFD_FAKE_SECTION): Add default initializer for it.
1240 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1241 * elf32-arm.c (arm_build_one_stub): Add support for
1242 non_contiguous_regions.
1243 * elf32-csky.c (csky_build_one_stub): Likewise.
1244 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1245 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1246 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1247 * elf32-metag.c (metag_build_one_stub): Likewise.
1248 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1249 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1250 (ppc_size_one_stub): Likewise.
1251 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1252 * elflink.c (elf_link_input_bfd): Likewise.
1254 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1257 * elf-linker-x86.h (elf_linker_x86_params): Add
1258 static_before_all_inputs and has_dynamic_linker.
1259 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1260 dynamic input objects if -static is passed at command-line
1261 before all input files without --dynamic-linker unless
1262 --no-dynamic-linker is used.
1264 2020-03-13 Kamil Rytarowski <n54@gmx.com>
1266 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1268 2020-03-13 Christian Eggers <ceggers@gmx.de>
1270 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1271 "p_paddr" from "at".
1272 * elfcode.h (bfd_from_remote_memory): Add units to several
1273 parameters. New local "opb". Fix usage of p_align. Fix
1274 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1275 call of target_read_memory.
1276 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1277 calculation of "offset" and "output_offset".
1278 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1279 from "offset" and fix calculation of "end" from "vma+size". Fix
1280 comparison between "sh_addr" and "vma"/"output_offset".
1281 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1282 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1284 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1285 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1286 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1287 assignment of p_paddr from phdr_lma. Fix comparison between
1288 "lma+size" and "next->lma".
1289 (elf_sort_segments): Fix assignment from p_paddr to lma.
1290 (assign_file_positions_for_load_sections): Add unit (bytes) to
1291 local "align". Fix calculation of local "off_adjust". Fix
1292 calculation of local "filehdr_vaddr".
1293 (assign_file_positions_for_non_load_sections): New local "opb".
1294 Fix calculation of "end" from "p_size". Fix comparison between
1295 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1296 from "end" and "p_vaddr".
1297 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1298 vma. Fix assignment to p_paddr from lma. Fix comparison between
1299 p_paddr and lma. Fix assignment to p_paddr from lma.
1300 * merge.c (sec_merge_emit): New local "opb". Convert
1301 "alignment_power" to octets.
1302 (_bfd_add_merge_section): New locals "alignment_power" and
1303 "opb". Fix comparison between "alignment_power" and
1305 (_bfd_merge_sections): New local "opb". Divide size by opb
1306 before checking align mask.
1308 2020-03-13 Christian Eggers <ceggers@gmx.de>
1310 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1311 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1313 (_bfd_elf_make_section_from_phdr): Similarly.
1314 (elf_fake_sections): Fix calculation of
1315 Elf_Internal_shdr::sh_addr from section VMA.
1316 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1318 (assign_file_positions_for_load_sections): Fix calculations of
1319 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1320 comparison between program header address and section LMA.
1321 (assign_file_positions_for_non_load_sections): Likewise.
1322 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1323 (IS_CONTAINED_BY_VMA): Add parameter opb.
1324 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1325 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1326 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1327 Fix calculations of p_addr_valid and p_vaddr_offset.
1328 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1329 with octets per byte when comparing against p_vaddr.
1331 2020-03-11 Alan Modra <amodra@gmail.com>
1333 * som.c (setup_sections): Sanity check subspace.name.
1335 2020-03-11 Alan Modra <amodra@gmail.com>
1337 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1339 2020-03-10 Alan Modra <amodra@gmail.com>
1342 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1345 2020-03-09 Alan Modra <amodra@gmail.com>
1347 * wasm-module.c (wasm_scan): Sanity check file name length
1348 before allocating memory. Move common section setup code. Do
1349 without bfd_tell to calculate section size.
1351 2020-03-06 Nick Clifton <nickc@redhat.com>
1353 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1354 with error messages and failure return values.
1356 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1358 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1359 relocation sections for any removed reference to a dynamic symbol.
1361 2020-03-05 Nick Clifton <nickc@redhat.com>
1363 * elf-bfd.h (struct elf_backend_data): Add new fields:
1364 init_secondary_reloc_section, slurp_secondary_reloc_section,
1365 write_secondary_reloc_section.
1366 (_bfd_elf_init_secondary_reloc_section): Prototype.
1367 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1368 (_bfd_elf_write_secondary_reloc_section): Prototype.
1369 * elf.c ( bfd_section_from_shdr): Invoke the new
1370 init_secondary_reloc_section backend function, if defined, when a
1371 second reloc section is encountered.
1372 (swap_out_syms): Invoke the new symbol_section_index function, if
1373 defined, when computing the section index of an OS/PROC specific
1375 (_bfd_elf_init_secondary_reloc_section): New function.
1376 (_bfd_elf_slurp_secondary_reloc_section): New function.
1377 (_bfd_elf_write_secondary_reloc_section): New function.
1378 (_bfd_elf_copy_special_section_fields): New function.
1379 * elfcode.h (elf_write_relocs): Invoke the new
1380 write_secondary_relocs function, if defined, in order to emit
1382 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1383 function, if defined, in order to read in secondary relocs.
1384 * elfxx-target.h (elf_backend_copy_special_section_fields):
1385 Provide a non-NULL default definition.
1386 (elf_backend_init_secondary_reloc_section): Likewise.
1387 (elf_backend_slurp_secondary_reloc_section): Likewise.
1388 (elf_backend_write_secondary_reloc_section): Likewise.
1389 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1391 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1392 * configure: Regenerate.
1394 2020-03-05 Alan Modra <amodra@gmail.com>
1396 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1397 against file size before allocating memory. Use bfd_alloc rather
1398 than bfd_zalloc for carsym/strings memory.
1400 2020-03-04 Alan Modra <amodra@gmail.com>
1402 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1403 sh_addr mod sh_addalign is zero.
1405 2020-03-04 Alan Modra <amodra@gmail.com>
1407 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1409 2020-03-03 Alan Modra <amodra@gmail.com>
1411 * format.c (struct bfd_preserve): Add cleanup field.
1412 (bfd_preserve_save): Add cleanup param and save.
1413 (bfd_preserve_restore): Return cleanup.
1414 (bfd_preserve_finish): Call the cleanup for the discarded match.
1415 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1416 and clear when preserving a match. Restore cleanup too when
1417 restoring that match.
1419 2020-03-02 Alan Modra <amodra@gmail.com>
1421 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1422 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1423 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1424 (core_sco5_vec): Correct initialisers.
1426 2020-03-02 Alan Modra <amodra@gmail.com>
1428 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1429 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1430 * cisco-core.c (cisco_core_file_validate): Likewise.
1431 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1432 * hpux-core.c (hpux_core_core_file_p): Likewise.
1433 * irix-core.c (irix_core_core_file_p): Likewise.
1434 * lynx-core.c (lynx_core_file_p): Likewise.
1435 * netbsd-core.c (netbsd_core_file_p): Likewise.
1436 * osf-core.c (osf_core_core_file_p): Likewise.
1437 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1438 * sco5-core.c (sco5_core_file_p): Likewise.
1440 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1442 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1444 2020-03-02 Alan Modra <amodra@gmail.com>
1446 * targets.c (bfd_cleanup): New typedef.
1447 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1448 * libbfd-in.h (_bfd_no_cleanup): Define.
1449 * format.c (bfd_reinit): Add cleanup parameter, call it.
1450 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1451 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1452 * aout-target.h (callback, object_p): Return bfd_cleanup.
1453 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1454 * archive.c (bfd_generic_archive_p): Likewise.
1455 * binary.c (binary_object_p): Likewise.
1456 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1457 * coff-ia64.c (ia64coff_object_p): Likewise.
1458 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1459 * coff-sh.c (coff_small_object_p): Likewise.
1460 * coff-stgo32.c (go32_check_format): Likewise.
1461 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1462 (xcoff64_core_p): Likewise.
1463 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1464 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1465 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1466 * elfcode.h (elf_object_p): Likewise.
1467 * elfcore.h (elf_core_file_p): Likewise.
1468 * i386msdos.c (msdos_object_p): Likewise.
1469 * ihex.c (ihex_object_p): Likewise.
1470 * libaout.h (some_aout_object_p): Likewise.
1471 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1472 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1473 * libbfd.c (_bfd_dummy_target): Likewise.
1474 * libcoff-in.h (coff_object_p): Likewise.
1475 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1476 (bfd_mach_o_arm64_core_p): Likewise.
1477 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1478 (bfd_mach_o_arm_core_p): Likewise.
1479 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1480 (bfd_mach_o_i386_core_p): Likewise.
1481 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1482 (bfd_mach_o_x86_64_core_p): Likewise.
1483 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1484 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1485 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1486 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1487 * mmo.c (mmo_object_p): Likewise.
1488 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1489 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1490 (pe_bfd_object_p): Likewise.
1491 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1492 * ppcboot.c (ppcboot_object_p): Likewise.
1493 * rs6000-core.c (rs6000coff_core_p): Likewise.
1494 * som.c (som_object_setup, som_object_p): Likewise.
1495 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1496 * tekhex.c (tekhex_object_p): Likewise.
1497 * vms-alpha.c (alpha_vms_object_p): Likewise.
1498 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1499 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1500 * wasm-module.c (wasm_object_p): Likewise.
1501 * xsym.c (bfd_sym_object_p): Likewise.
1502 * xsym.h (bfd_sym_object_p): Likewise.
1503 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1505 * pdp11.c (some_aout_object_p): Likewise.
1506 * plugin.c (register_ld_plugin_object_p): Update object_p
1508 * plugin.h (register_ld_plugin_object_p): Likewise.
1509 * bfd-in2.h: Regenerate.
1510 * libbfd.h: Regenerate.
1511 * libcoff.h: Regenerate.
1513 2020-03-02 Alan Modra <amodra@gmail.com>
1515 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1516 applicable section flags.
1517 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1518 (mips_ecoff_bele_vec): Likewise.
1519 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1521 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1522 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1524 2020-03-02 Alan Modra <amodra@gmail.com>
1526 * elf32-m32r.c (m32r_elf_section_flags): New function.
1527 (elf_backend_section_flags): Define.
1528 * elf32-nds32.c (nds32_elf_section_flags): New function.
1529 (elf_backend_section_flags): Define.
1530 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1531 .sbss and .sdata sections.
1532 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1533 for SHF_V850_GPREL sections.
1534 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1536 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1537 for SHF_PARISC_SHORT sections.
1538 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1539 (elf_backend_section_flags): Define.
1540 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1541 for SHF_MIPS_GPREL sections. Delete FIXME.
1543 2020-03-02 Alan Modra <amodra@gmail.com>
1545 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1546 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1547 calling elf_backend_section_flags with adjusted params. Use
1548 newsect->flags past that point.
1549 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1551 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1552 to have their type overridden, and all sh_flags but processor and
1554 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1555 * elf32-mep.c (mep_elf_section_flags): Likewise.
1556 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1557 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1558 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1559 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1560 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1561 stub BFD and non-aarch64 input files when scanning for stubs.
1563 2020-03-02 Alan Modra <amodra@gmail.com>
1565 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1566 limit to decompressed element size.
1568 2020-03-02 Alan Modra <amodra@gmail.com>
1570 * vms-lib.c (vms_traverse_index): Add recur_count param and
1571 update calls. Fail on excessive recursion.
1573 2020-03-02 Alan Modra <amodra@gmail.com>
1575 * vms-alpha.c (vms_get_remaining_object_record): Use
1576 bfd_realloc_or_free rather than bfd_realloc.
1577 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1578 (dst_define_location, parse_module): Likewise, and check realloc
1579 return status before using memory. Return status from function
1580 adjusting all callers.
1582 2020-02-28 Alan Modra <amodra@gmail.com>
1584 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1586 2020-02-28 Alan Modra <amodra@gmail.com>
1588 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1589 Remove duplicate undersize check.
1591 2020-02-27 Alan Modra <amodra@gmail.com>
1594 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1596 2020-02-27 Alan Modra <amodra@gmail.com>
1599 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1600 (coff_section_type): Adjust comment.
1601 (decode_section_type): Likewise. Call coff_section_type before
1602 decode_section_type.
1603 (bfd_decode_symclass): Use 'c' for common sections other than
1606 2020-02-27 Alan Modra <amodra@gmail.com>
1608 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1611 2020-02-27 Alan Modra <amodra@gmail.com>
1613 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1614 if file is an archive element.
1615 * bfd-in2.h: Regenerate.
1617 2020-02-26 Alan Modra <amodra@gmail.com>
1619 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1620 bfd_set_error on failing test. Don't bother changing bfd_error on
1621 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1622 Check sym name is within string buffer. Use size_t for some vars.
1623 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1624 int_buf. Don't change bfd_error on file read error. Use
1625 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1626 calculations to catch overflows before they occur. malloc and
1627 free raw armap rather than using bfd_alloc. Read raw armap before
1628 allocating carsym+strings buffer.
1629 (_bfd_slurp_extended_name_table): Localize variables. Check
1630 name size against file size.
1632 2020-02-26 Alan Modra <amodra@gmail.com>
1634 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1636 2020-02-26 Alan Modra <amodra@gmail.com>
1638 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1639 malloc. Check for NULL return from bfd_malloc.
1640 (rx_table_find, rx_table_map): Likewise.
1641 (rx_set_section_contents): Check bfd_alloc return.
1642 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1644 2020-02-26 Alan Modra <amodra@gmail.com>
1646 * aoutx.h: Indent labels correctly. Format error strings.
1647 * archive.c: Likewise.
1648 * archive64.c: Likewise.
1649 * coff-arm.c: Likewise.
1650 * coff-rs6000.c: Likewise.
1651 * coff-stgo32.c: Likewise.
1652 * cpu-arm.c: Likewise.
1653 * dwarf2.c: Likewise.
1654 * elf-ifunc.c: Likewise.
1655 * elf-properties.c: Likewise.
1656 * elf-s390-common.c: Likewise.
1657 * elf-strtab.c: Likewise.
1659 * elf32-arm.c: Likewise.
1660 * elf32-bfin.c: Likewise.
1661 * elf32-cr16.c: Likewise.
1662 * elf32-csky.c: Likewise.
1663 * elf32-i386.c: Likewise.
1664 * elf32-m68k.c: Likewise.
1665 * elf32-msp430.c: Likewise.
1666 * elf32-nds32.c: Likewise.
1667 * elf32-nios2.c: Likewise.
1668 * elf32-pru.c: Likewise.
1669 * elf32-xtensa.c: Likewise.
1670 * elf64-ia64-vms.c: Likewise.
1671 * elf64-x86-64.c: Likewise.
1672 * elfcode.h: Likewise.
1673 * elfcore.h: Likewise.
1674 * elflink.c: Likewise.
1675 * elfnn-aarch64.c: Likewise.
1676 * elfnn-ia64.c: Likewise.
1677 * elfnn-riscv.c: Likewise.
1678 * elfxx-mips.c: Likewise.
1679 * elfxx-sparc.c: Likewise.
1680 * elfxx-x86.c: Likewise.
1681 * i386lynx.c: Likewise.
1682 * merge.c: Likewise.
1683 * pdp11.c: Likewise.
1684 * plugin.c: Likewise.
1685 * reloc.c: Likewise.
1687 2020-02-26 Alan Modra <amodra@gmail.com>
1690 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1692 (bfd_elf_add_dt_needed_tag): Declare.
1693 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1694 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1695 from elf_add_dt_needed_tag. Remove soname and doit param.
1696 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1697 to see whether as-needed lib is already loaded, use dyn_loaded
1698 list instead. When saving and restoring around as-needed lib
1699 handle possibility that dynstr has not been initialised. Don't
1700 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1701 Mark libs loaded via DT_NEEDED entries of other libs with
1702 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1704 (elf_link_check_versioned_symbol): Remove now unneccesary
1705 DYNAMIC check when traversing dyn_loaded list.
1707 2020-02-26 Alan Modra <amodra@gmail.com>
1709 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1711 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1714 * plugin.c (need_lto_wrapper_p): New.
1715 (bfd_plugin_set_program_name): Add an int argument to set
1717 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1719 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1721 2020-02-24 Alan Modra <amodra@gmail.com>
1723 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1725 2020-02-24 Alan Modra <amodra@gmail.com>
1727 * vms-lib.c (struct carsym_mem): Add limit.
1728 (vms_add_index): Heed limit.
1729 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1730 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1731 Always return actual number read.
1732 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1733 assertion with error exit.
1735 2020-02-22 Alan Modra <amodra@gmail.com>
1738 * elf.c (assign_file_positions_for_load_sections): Continue linking
1739 on "PHDR segment not covered by LOAD segment" errors.
1741 2020-02-21 Alan Modra <amodra@gmail.com>
1743 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1745 (bfd_mach_o_canonicalize_reloc): Likewise.
1746 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1747 counts and offsets against file size.
1748 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1749 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1750 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1751 against file size. Delete symbol table error message.
1752 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1754 (bfd_mach_o_read_symtab): Likewise.
1755 (bfd_mach_o_read_command): Pass file size.
1756 (bfd_mach_o_scan): Sanity check command count against file size.
1758 2020-02-21 Alan Modra <amodra@gmail.com>
1761 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1762 "text", "data" and "bss" section pointer vars. Don't update
1763 section size, just exec header sizes.
1764 (adjust_sizes_and_vmas): Don't update text section size. Set
1765 initial exec header a_text. Print exec headers sizes.
1766 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1767 (adjust_sizes_and_vmas): Similarly. Formatting.
1768 (final_link): Correct final file extension.
1770 2020-02-20 Nick Clifton <nickc@redhat.com>
1772 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1774 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1776 (elfNN_bed): Initialise the symbol_section_index field.
1777 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1778 OS and PROC specific section indicies. Warn if converting other
1779 reserved incidies to SHN_ABS.
1781 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1784 * cpu-z80.c: Add machine type compatibility checking.
1786 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1789 * plugin.c (plugin_list_entry): Remove handle.
1790 (try_load_plugin): Call dlclose before return.
1792 2020-02-19 Alan Modra <amodra@gmail.com>
1794 * libbfd-in.h (_bfd_constant_p): Define.
1795 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1796 file size before allocating memory.
1797 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1798 * elf.c (bfd_elf_get_str_section): Likewise.
1799 (_bfd_elf_slurp_version_tables): Likewise.
1800 * libbfd.h: Regenerate.
1802 2020-02-19 Alan Modra <amodra@gmail.com>
1804 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1805 * aoutx.h (aout_get_external_symbols): Replace calls to
1806 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1807 (slurp_reloc_table): Likewise.
1808 * archive.c (do_slurp_bsd_armap): Likewise.
1809 (do_slurp_coff_armap): Likewise.
1810 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1811 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1812 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1813 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1814 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1815 (_bfd_coff_get_external_symbols): Likewise.
1816 * ecoff.c (ecoff_slurp_symbolic_header),
1817 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1818 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1819 (ecoff_indirect_link_order): Likewise.
1820 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1821 (_bfd_elf_slurp_version_tables): Likewise.
1822 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1823 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1824 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1825 * elf64-alpha.c (READ): Likewise.
1826 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1827 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1828 * elfcode.h (elf_slurp_symbol_table),
1829 (elf_slurp_reloc_table_from_section): Likewise.
1830 * elflink.c (elf_link_add_object_symbols),
1831 (elf_link_check_versioned_symbol): Likewise.
1832 * elfxx-mips.c (READ): Likewise.
1833 * i386lynx.c (slurp_reloc_table): Likewise.
1834 * lynx-core.c (lynx_core_file_p): Likewise.
1835 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1836 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1837 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1838 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1839 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1840 (bfd_pef_parse_symbols): Likewise.
1841 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1842 * som.c (setup_sections, som_slurp_string_table),
1843 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1844 (som_bfd_fill_in_ar_symbols): Likewise.
1845 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1846 (evax_bfd_print_image): Likewise.
1847 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1848 * wasm-module.c (wasm_scan): Likewise.
1849 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1850 * xsym.c (bfd_sym_read_name_table),
1851 (bfd_sym_print_type_information_table_entry): Likewise.
1852 * libbfd.h: Regenerate.
1854 2020-02-19 Alan Modra <amodra@gmail.com>
1856 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1857 reading external relocs.
1858 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1859 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1861 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1863 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1864 (m32c_elf_relax_section): Likewise.
1865 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1866 (rl78_elf_relax_section): Likewise.
1867 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1868 (elf32_rx_relax_section): Likewise.
1869 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1870 parameter types and use..
1871 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1872 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1873 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1874 being read from file, just the extra.
1875 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1876 after reading external syms. Free on failure.
1878 2020-02-19 Alan Modra <amodra@gmail.com>
1880 * coffcode.h (buy_and_read, coff_slurp_line_table),
1881 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1882 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1883 corresponding bfd_alloc call. Adjust variables to suit.
1884 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1885 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1886 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1887 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1888 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1889 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1890 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1891 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1892 * elf64-alpha.c (READ): Likewise.
1893 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1894 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1895 (bfd_from_remote_memory): Likewise.
1896 * elfcore.h (core_find_build_id): Likewise.
1897 * elfxx-mips.c (READ): Likewise.
1898 * mach-o.c (bfd_mach_o_mangle_sections),
1899 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1900 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1901 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1902 * som.c (setup_sections, som_prep_for_fixups)
1903 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1904 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1905 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1906 (som_bfd_ar_write_symbol_stuff): Likewise.
1907 * vms-alpha.c (vector_grow1): Likewise.
1908 * vms-lib.c (vms_add_index): Likewise.
1909 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1910 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1911 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1912 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1913 (bfd_alloc2, bfd_zalloc2): Delete.
1914 (_bfd_mul_overflow): Define.
1915 * libbfd.h: Regenerate.
1917 2020-02-19 Alan Modra <amodra@gmail.com>
1919 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1921 (assign_section_numbers): Likewise.
1922 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1923 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1924 bfd_malloc2, size_t amt, and unsigned tls_count.
1925 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1926 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1927 (elf_output_implib): Use bfd_alloc.
1929 2020-02-19 Alan Modra <amodra@gmail.com>
1931 * bfd.c (struct bfd): Move format and direction to other
1932 bitfields. Add "size".
1933 * bfdio.c (bfd_get_size): Cache size when not writing file.
1934 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1935 returning zero, ie. unknown.
1936 (bfd_get_alt_debug_link_info): Likewise.
1937 * bfd-in2.h: Regenerate.
1939 2020-02-19 Alan Modra <amodra@gmail.com>
1941 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1942 bfd_get_file_size twice.
1943 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1944 zero, ie. unknown, return.
1945 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1946 * elfcode.h (elf_swap_shdr_in): Likewise.
1947 (elf_object_p): Don't call bfd_get_file_size twice and correct
1950 2020-02-19 Alan Modra <amodra@gmail.com>
1952 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1953 FALSE if memory alloc fails. Adjust calls.
1954 * som.c (som_prep_for_fixups): Likewise.
1955 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1956 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1957 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1958 * som.c (som_build_and_write_symbol_table): Return via error_return
1960 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1961 (VEC_APPEND_EL): Delete.
1962 (vector_grow1): Return pointer to element. Catch overflow.
1963 Return NULL on memory allocation failure.
1964 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1965 (alpha_vms_add_fixup_ca): Likewise.
1966 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1968 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1970 2020-02-19 Alan Modra <amodra@gmail.com>
1972 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1973 * aout-target.h (object_p): Likewise.
1974 * aout-tic30.c (tic30_aout_object_p): Likewise.
1975 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1976 (emit_stringtab, write_syms, link_hash_table_create),
1977 (aout_link_write_other_symbol): Likewise.
1978 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1979 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1980 (_bfd_compute_and_write_armap): Likewise.
1981 * archures.c (bfd_arch_list): Likewise.
1982 * bfd.c (bfd_record_phdr): Likewise.
1983 * binary.c (binary_canonicalize_symtab): Likewise.
1984 * cisco-core.c (cisco_core_file_validate): Likewise.
1985 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1986 (find_arm_glue, record_arm_to_thumb_glue),
1987 (record_thumb_to_arm_glue): Likewise.
1988 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1989 (ppc_allocate_toc_section): Likewise.
1990 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1991 * coff-sh.c (sh_relax_section): Likewise.
1992 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1993 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1994 (coff_set_alignment_hook, coff_mkobject),
1995 (coff_compute_section_file_positions): Likewise.
1996 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1997 (coff_find_nearest_line_with_names),
1998 ( bfd_coff_set_symbol_class): Likewise.
1999 * cofflink.c (_bfd_coff_link_hash_table_create),
2000 (_bfd_coff_link_input_bfd): Likewise.
2001 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
2002 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
2003 (build_line_info_table, sort_line_sequences),
2004 (line_info_add_include_dir, line_info_add_file_name),
2005 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
2006 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
2007 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
2008 (_bfd_ecoff_find_nearest_line),
2009 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
2010 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
2011 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
2012 * elf-m10300.c (mn10300_elf_relax_section),
2013 (elf32_mn10300_link_hash_table_create): Likewise.
2014 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
2015 * elf.c (make_mapping, copy_elf_program_header): Likewise.
2016 * elf32-arm.c (elf32_arm_link_hash_table_create),
2017 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
2018 (elf32_arm_new_section_hook): Likewise.
2019 * elf32-avr.c (elf_avr_new_section_hook),
2020 (elf32_avr_link_hash_table_create, get_local_syms),
2021 (elf32_avr_setup_section_lists): Likewise.
2022 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
2023 (bfin_link_hash_table_create): Likewise.
2024 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
2025 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
2026 * elf32-csky.c (csky_elf_link_hash_table_create),
2027 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
2028 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
2029 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
2030 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
2031 * elf32-i386.c (elf_i386_check_relocs): Likewise.
2032 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
2033 * elf32-m32r.c (m32r_elf_link_hash_table_create),
2034 (m32r_elf_check_relocs): Likewise.
2035 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
2036 (elf32_m68hc11_setup_section_lists),
2037 (elf32_m68hc11_size_stubs): Likewise.
2038 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
2039 * elf32-metag.c (elf_metag_link_hash_table_create),
2040 (elf_metag_setup_section_lists): Likewise.
2041 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
2042 (microblaze_elf_check_relocs): Likewise.
2043 * elf32-nds32.c (nds32_elf_link_hash_table_create),
2044 (nds32_elf_check_relocs): Likewise.
2045 * elf32-nios2.c (nios2_elf32_setup_section_lists),
2046 (get_local_syms, nios2_elf32_check_relocs),
2047 (nios2_elf32_link_hash_table_create): Likewise.
2048 * elf32-or1k.c (or1k_elf_link_hash_table_create),
2049 (or1k_elf_check_relocs): Likewise.
2050 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
2051 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
2052 * elf32-s390.c (elf_s390_link_hash_table_create),
2053 (elf_s390_check_relocs): Likewise.
2054 * elf32-score.c (score_elf_create_got_section),
2055 (s3_elf32_score_new_section_hook),
2056 (elf32_score_link_hash_table_create): Likewise.
2057 * elf32-score7.c (score_elf_create_got_section),
2058 (s7_elf32_score_new_section_hook): Likewise.
2059 * elf32-sh.c (sh_elf_link_hash_table_create),
2060 (sh_elf_check_relocs): Likewise.
2061 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
2062 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
2063 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
2064 (tilepro_elf_check_relocs): Likewise.
2065 * elf32-v850.c (remember_hi16s_reloc): Likewise.
2066 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
2067 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
2068 (elf_xtensa_new_section_hook): Likewise.
2069 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
2070 (get_got_entry, elf64_alpha_check_relocs): Likewise.
2071 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
2072 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
2073 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2074 * elf64-ppc.c (ppc64_elf_new_section_hook),
2075 (ppc64_elf_link_hash_table_create, update_local_sym_info),
2076 (update_plt_info, ppc64_elf_check_relocs): Likewise.
2077 * elf64-s390.c (elf_s390_link_hash_table_create),
2078 (elf_s390_check_relocs): Likewise.
2079 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2080 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
2081 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
2082 (elf_link_add_archive_symbols, compute_bucket_count),
2083 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
2084 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
2085 (bfd_elf_final_link): Likewise.
2086 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
2087 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
2088 (elfNN_aarch64_new_section_hook): Likewise.
2089 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
2090 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
2091 (riscv_elf_check_relocs): Likewise.
2092 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
2093 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
2094 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
2095 (_bfd_mips_elf_link_hash_table_create): Likewise.
2096 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
2097 (_bfd_sparc_elf_check_relocs),
2098 (_bfd_sparc_elf_new_section_hook): Likewise.
2099 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
2100 (tilegx_elf_check_relocs): Likewise.
2101 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
2102 * format.c (bfd_check_format_matches): Likewise.
2103 * hash.c (_bfd_stringtab_init): Likewise.
2104 * ihex.c (ihex_scan): Likewise.
2105 * irix-core.c (irix_core_core_file_p): Likewise.
2106 * linker.c (bfd_wrapped_link_hash_lookup),
2107 (_bfd_generic_link_hash_table_create),
2108 (_bfd_generic_reloc_link_order): Likewise.
2109 * lynx-core.c (lynx_core_file_p): Likewise.
2110 * netbsd-core.c (netbsd_core_file_p): Likewise.
2111 * osf-core.c (osf_core_core_file_p): Likewise.
2112 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
2113 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
2114 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
2115 * peicode.h (pe_mkobject): Likewise.
2116 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
2117 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2118 * sco5-core.c (read_uarea): Likewise.
2119 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
2120 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
2121 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
2122 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
2123 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
2124 * srec.c (srec_scan): Likewise.
2125 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
2126 * targets.c (bfd_target_list): Likewise.
2127 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
2128 * trad-core.c (trad_unix_core_file_p): Likewise.
2129 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
2130 (vms_new_section_hook): Likewise.
2131 * wasm-module.c (wasm_make_empty_symbol): Likewise.
2132 * xcofflink.c (xcoff_get_section_contents),
2133 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
2134 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
2135 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
2137 2020-02-19 Alan Modra <amodra@gmail.com>
2139 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
2141 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
2143 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
2144 and use it if it isn't NULL. Remove has_plugin_p argument. Add
2145 a build_list_p argument. Don't search plugin_list. Short circuit
2146 when building the plugin list.
2147 (has_plugin): Renamed to has_plugin_list.
2148 (bfd_plugin_set_plugin): Don't set has_plugin.
2149 (bfd_plugin_specified_p): Check plugin_list instead.
2150 (build_plugin_list): New function.
2151 (load_plugin): Call build_plugin_list and use plugin_list.
2153 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2156 * plugin.c (try_claim): Always clean up for LTO wrapper.
2157 (try_load_plugin): Treat each object as independent. Create a
2158 copy for plugin name.
2160 2020-02-11 Nick Clifton <nickc@redhat.com>
2162 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
2163 for addresses in print statements.
2164 (msp430_elf_relax_delete_bytes): Likewise.
2165 (msp430_elf_relax_add_words): Likewise.
2166 (msp430_elf_relax_section): Likewise.
2168 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
2170 * plugin.c (add_symbols): Clear plugin_data memory.
2172 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
2175 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
2176 (EXECUTABLE_SUFFIX): Likewise.
2177 * config.in: Regenerated.
2178 * configure: Likewise.
2179 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
2180 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
2181 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
2182 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
2183 (get_lto_wrapper): New.
2184 (setup_lto_wrapper_env): Likewise.
2185 (current_plugin): Likewise.
2186 (register_all_symbols_read): Likewise.
2187 (register_cleanup): Likewise.
2188 (get_symbols): Likewise.
2189 (add_input_file): Likewise.
2190 (bfd_plugin_close_and_cleanup): Likewise.
2191 (claim_file): Removed.
2192 (register_claim_file): Set current_plugin->claim_file.
2193 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
2194 lto_syms in current_plugin.
2195 (try_claim): Use current_plugin->claim_file. Call LTO plugin
2196 all_symbols_read handler. Copy real symbols to plugin_data.
2197 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
2198 (try_load_plugin): Don't reuse the previous plugin for LTO
2199 wrapper. Set up GCC LTO wrapper if possible. Don't set
2200 plugin_list_iter->claim_file.
2201 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
2203 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
2206 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2208 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
2209 check if previous instruction matches a conditional jump inserted
2210 earlier. Invert conditional jump and delete branch in this case.
2212 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2214 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
2215 msp430_elf_relax_add_words. Support insertion of either one or two
2217 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
2218 needs to be grown. Handle insertion of branch instruction to replace
2221 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2223 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2224 debugging relocations.
2225 (msp430_elf_relax_delete_bytes): Likewise.
2226 (msp430_elf_relax_add_two_words): Likewise.
2227 (msp430_elf_relax_section): Likewise.
2229 2020-02-10 Alan Modra <amodra@gmail.com>
2231 * archures.c: Wrap overlong z80 comments.
2232 * bfd-in2.h: Regenerate.
2234 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2237 * archures.c: Add GBZ80 and Z80N machine values.
2238 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2239 * coff-z80.c: Add support for new reloc.
2240 * coffcode.h: Add support for new machine values.
2241 * cpu-z80.c: Add support for new machine names.
2242 * elf32-z80.c: Add support for new reloc.
2243 * bfd-in2.h: Regenerate.
2244 * libbfd.h: Regenerate.
2246 2020-02-07 Nick Clifton <nickc@redhat.com>
2249 * elf.c (rewrite_elf_program_header): Do not complain if no
2250 sections are mapped to a segment.
2252 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2255 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2256 for garbage collection on __patchable_function_entries section
2257 without linked-to section.
2259 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2262 * bfd-in2.h: Regenerated.
2263 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2264 on section if gc_mark of any of its linked-to sections is set
2265 and don't set gc_mark again.
2266 * section.c (asection): Add linked_to_symbol_name to map_head
2269 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
2271 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2272 reporting an unrecognized instruction with R_V850_LONGJUMP.
2274 2020-02-05 Alan Modra <amodra@gmail.com>
2276 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2278 2020-02-04 Alan Modra <amodra@gmail.com>
2280 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2281 R_PPC_VLE_ADDR20, goto copy_reloc.
2283 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2285 * bfd-in2.h: Regenerated.
2286 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2288 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2291 * bfd-in2.h: Regenerated.
2292 * ecoff.c (bfd_debug_section): Add section_id.
2293 * section.c (bfd_section): Add section_id.
2294 (SEC_ASSEMBLER_SECTION_ID): New.
2295 (BFD_FAKE_SECTION): Add section_id.
2297 2020-02-01 Nick Clifton <nickc@redhat.com>
2299 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2302 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2304 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2305 encodings are relative to the GOT on nios2, too.
2307 2020-01-31 Alan Modra <amodra@gmail.com>
2309 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2310 file. Use $< and $@ in rules.
2311 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2312 (elf32-ia64.c, elf64-ia64.c): Likewise.
2313 (elf32-riscv.c, elf64-riscv.c): Likewise.
2314 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2315 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2316 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2317 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2318 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2319 * Makefile.in: Regenerate.
2321 2020-01-31 Alan Modra <amodra@gmail.com>
2324 * elf.c (setup_group): Don't clear entire section contents,
2325 just the padding after group flags. Release alloc'd memory
2326 after a seek or read failure.
2328 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2330 * peXXigen.c (pe_is_repro): New function.
2331 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2332 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2334 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2336 * peXXigen.c (debug_type_names): Add names for new debug data type
2339 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2341 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2342 inner loop. Fix a memory leak.
2344 2020-01-30 Alan Modra <amodra@gmail.com>
2346 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2347 or obj_coff_keep_strings here.
2348 (coff_get_normalized_symtab): Free external syms directly.
2349 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2352 2020-01-27 Jim Wilson <jimw@sifive.com>
2354 * cpu-riscv.c (riscv_scan): New.
2355 (N): Change bfd_default_scan to riscv_scan.
2357 2020-01-27 Andreas Schwab <schwab@suse.de>
2359 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2360 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2361 * Makefile.in: Regenerate.
2362 * cpu-plugin.c: Remove.
2363 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2364 (bfd_plugin_arch): Remove declaration.
2365 * bfd-in2.h: Regenerate.
2366 * po/SRC-POTFILES.in: Regenerate.
2368 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2369 Alan Modra <amodra@gmail.com>
2372 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2374 2020-01-24 Jim Wilson <jimw@sifive.com>
2376 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2377 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2378 avoid over long line.
2380 2020-01-24 Nick Clifton <nickc@redhat.com>
2383 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2384 syms and keep strings flags as these may have been set in order to
2385 prevent a bogus call to free.
2387 2020-01-23 Nick Clifton <nickc@redhat.com>
2389 * po/fr.po: Updated French translation.
2391 2020-01-23 Alan Modra <amodra@gmail.com>
2394 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2395 by zero when p_align is zero.
2397 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2399 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2400 (riscv_prefix_cmp): Likewise.
2401 (riscv_non_std_ext_p): Deleted.
2402 (riscv_std_sv_ext_p): Likewise.
2403 (riscv_non_std_sv_ext_p): Likewise.
2404 (riscv_merge_non_std_and_sv_ext): Rename to...
2405 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2406 (riscv_merge_arch_attr_info): Replace 3 calls to
2407 riscv_merge_non_std_and_sv_ext with single call to
2408 riscv_merge_multi_letter_ext.
2409 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2410 encounter a 'z' prefix.
2411 (riscv_get_prefix_class): New function, return prefix class based
2412 on first few characters of input string.
2413 (riscv_parse_config): New structure to factor out minor differences
2414 in extension class parsing behaviour.
2415 (riscv_parse_sv_or_non_std_ext): Rename to...
2416 (riscv_parse_prefixed_ext): and parameterise with
2418 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2419 (riscv_multi_letter_ext_valid_p): New.
2420 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2421 (riscv_parse_subset): Delegate all non-single-letter parsing work
2422 to riscv_parse_prefixed_ext.
2423 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2424 (riscv_get_prefix_class): Declare.
2426 2020-01-22 Alan Modra <amodra@gmail.com>
2428 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2429 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2430 __tls_get_addr_desc.
2431 (ppc64_elf_size_stubs): Add section for linker generated
2432 __tls_get_addr_desc wrapper function. Loop at least once if
2433 generating this function.
2434 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2435 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2437 2020-01-22 Alan Modra <amodra@gmail.com>
2439 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2440 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2442 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2443 (STDU_R1_0R1, ADDI_R1_R1): Define.
2444 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2445 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2446 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2447 no_tls_get_addr_regsave.
2448 (branch_reloc_hash_match): Add hash3 and hash4.
2449 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2450 (ppc64_elf_size_dynamic_sections): Likewise.
2451 (ppc64_elf_relocate_section): Likewise.
2452 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2453 __tls_get_addr stub.
2454 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2456 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2457 eh_frame for regsave __tls_get_addr.
2459 2020-01-22 Alan Modra <amodra@gmail.com>
2461 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2462 which __tls_get_addr calls will be eliminated.
2464 2020-01-20 Nick Clifton <nickc@redhat.com>
2466 * po/pt.po: Updates Portuguese translation.
2467 * po/ru.po: Updated Russian translation.
2468 * po/uk.po: Updated Ukranian translation.
2470 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2473 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2474 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2476 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2477 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2478 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2479 "rex leal x@tlsdesc(%rip), %reg" to
2480 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2481 "call *(%eax)" to "nopl (%rax)".
2483 2020-01-20 Alan Modra <amodra@gmail.com>
2485 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2486 (MTLR_R11): Don't define.
2487 (LD_R0_0R3, CMPDI_R0_0): Define.
2488 (build_tls_get_addr_stub): Don't use r11 in stub.
2490 2020-01-20 Alan Modra <amodra@gmail.com>
2492 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2493 (defined_sym_val, is_tls_get_addr): Likewise.
2495 2020-01-18 Nick Clifton <nickc@redhat.com>
2497 * version.m4 (BFD_VERSION): Set to 2.34.50.
2498 * configure: Regenerate.
2499 * po/bfd.pot: Regenerate.
2501 2020-01-18 Nick Clifton <nickc@redhat.com>
2503 Binutils 2.34 branch created.
2505 2020-01-17 Christian Biesinger <cbiesinger@google.com>
2507 * coff-arm.c: Fix spelling error (seperate).
2508 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2510 * sysdep.h (strnlen): Fix spelling error (seperate).
2512 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
2515 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2517 2020-01-15 Alan Modra <amodra@gmail.com>
2520 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2521 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2522 of function symbols unless dot symbols are present. Do warn
2523 whenever one is created, regardles of whether a PLT entry is
2524 also emitted for the function symbol.
2526 2020-01-14 Alan Modra <amodra@gmail.com>
2528 * som.c (som_bfd_count_ar_symbols): Error when file position
2529 of symbols on chains is not strictly increasing.
2531 2020-01-14 Alan Modra <amodra@gmail.com>
2533 * vms.h (VMS_DEBUG): Define as 0.
2534 * vms-alpha.c (image_write): Move debug output after bounds check.
2536 (_bfd_vms_slurp_eihd): Warning fix.
2537 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2539 2020-01-13 Alan Modra <amodra@gmail.com>
2541 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2542 for "ignored" records.
2544 2020-01-13 Alan Modra <amodra@gmail.com>
2546 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2547 Delete asect name check. Move asect NULL check to wasm_object_p.
2548 Correct bounds check of sizes against end. Replace uses of
2549 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2550 just one bfd_release.
2551 (wasm_scan): Don't use malloc/strdup for section names,
2552 bfd_alloc instead. Simplify code prefixing section name.
2553 Formatting. Don't attempt to free memory here..
2554 (wasm_object_p): ..do so here.
2556 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2559 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2560 UNDEFWEAK_NO_DYNAMIC_RELOC.
2561 (allocate_dynrelocs_for_symbol): Likewise.
2563 2020-01-10 Tamar Christina <tamar.christina@arm.com>
2566 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2568 2020-01-10 Alan Modra <amodra@gmail.com>
2570 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2572 2020-01-09 Nick Clifton <nickc@redhat.com>
2575 * bfd.c (bfd_convert_section_contents): Check for a compress
2576 header size that is larger than the actual section size.
2578 2020-01-08 Alan Modra <amodra@gmail.com>
2581 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2582 after removing sections.
2584 2020-01-06 Jim Wilson <jimw@sifive.com>
2587 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2588 check for !bfd_link_pic (info).
2589 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2590 <R_RISCV_JAL>: Add comment.
2591 (_bfd_riscv_relax_section): For plt.offset check, add check for
2592 bfd_link_pic (info). Add comment.
2594 2020-01-06 Alan Modra <amodra@gmail.com>
2596 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2597 match failures. Don't init to bfd_error_wrong_format before
2598 calling _bfd_check_format.
2600 2020-01-06 Alan Modra <amodra@gmail.com>
2602 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2603 status rather than exiting on stack overflow or underflow.
2604 (_bfd_vms_slurp_etir): Adjust to suit.
2606 2020-01-06 Alan Modra <amodra@gmail.com>
2608 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2610 2020-01-06 Alan Modra <amodra@gmail.com>
2612 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2613 command. Check name offset is within command.
2614 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2615 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2616 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2617 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2618 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2619 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2620 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2621 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2622 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2623 (bfd_mach_o_read_segment): Similarly.
2624 (bfd_mach_o_read_thread): Properly bound check thread struct.
2625 Don't repeat checks on second loop.
2626 (bfd_mach_o_read_command): Fail on invalid command length.
2628 2020-01-04 Alan Modra <amodra@gmail.com>
2630 * format.c (bfd_check_format_matches): Add preserve_match.
2631 Save initial bfd state in "preserve", matched bfd state in
2632 "preserve_match". Save just the first match. Release
2633 bfd_alloc memory. Restore and finish preserved state as
2634 appropriate on all function exit paths.
2636 2020-01-04 Alan Modra <amodra@gmail.com>
2638 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2640 2020-01-04 Alan Modra <amodra@gmail.com>
2642 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2645 2020-01-03 Nick Clifton <nickc@redhat.com>
2648 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2649 there is enough data remaining in the code buffer before
2650 attempting to read a function stub.
2652 2020-01-03 Nick Clifton <nickc@redhat.com>
2655 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2656 return value from bfd_malloc.
2657 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2658 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2659 (elf32_arm_filter_cmse_symbols): Likewise.
2660 (elf32_arm_write_section): Likewise.
2661 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2662 (bfd_mach_o_follow_dsym): Likewise.
2663 * pef.c (bfd_pef_print_loader_section): Likewise.
2664 (bfd_pef_scan_start_address): Likewise.
2665 (bfd_pef_parse_function_stubs): Likewise.
2666 (bfd_pef_parse_symbols): Likewise.
2668 2020-01-03 Sergei Trofimovich <siarheit@google.com>
2670 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2671 on binary inputs ld/PR25316.
2672 (is_ia64_elf): new helper to filter on ia64 objects.
2674 2020-01-03 Jan Beulich <jbeulich@suse.com>
2676 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2678 (bfd_mach_o_scan): Insert underscore in two variable names.
2680 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2682 * Makefile.am: Add z80-elf target support.
2683 * configure.ac: Likewise.
2684 * targets.c: Likewise.
2685 * Makefile.in: Regenerate.
2686 * configure: Regenerate.
2687 * config.bfd: Add z80-elf target support and new arches: ez80 and
2689 * elf32-z80.c: New file.
2690 * archures.c: Add new z80 architectures: eZ80 and Z180.
2691 * coffcode.h: Likewise.
2692 * cpu-z80.c: Likewise.
2693 * coff-z80.c: Add new relocations for Z80 target and local label
2695 * reloc.c: Add new relocs.
2696 * bfd-in2.h: Regenerate.
2697 * libbfd.h: Regenerate.
2699 2020-01-02 Tamar Christina <tamar.christina@arm.com>
2703 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2705 2020-01-01 Alan Modra <amodra@gmail.com>
2707 Update year range in copyright notice of all files.
2709 For older changes see ChangeLog-2019
2711 Copyright (C) 2020 Free Software Foundation, Inc.
2713 Copying and distribution of this file, with or without modification,
2714 are permitted in any medium without royalty provided the copyright
2715 notice and this notice are preserved.
2721 version-control: never