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