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