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