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