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