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