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