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