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