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