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