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