1 2020-08-25 Alan Modra <amodra@gmail.com>
4 * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
5 before accessing elf fields.
7 2020-08-25 Alan Modra <amodra@gmail.com>
10 * som.c (som_compute_checksum): XOR 32-bit words in header,
11 not unsigned long sized words.
13 2020-08-25 Alan Modra <amodra@gmail.com>
16 * elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
17 amount copied for elf_segment_map defined with one element
20 2020-08-25 Alan Modra <amodra@gmail.com>
23 * elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
24 bfd_get_x size function to read addends out of fields. Apply
25 rightshift adjustment too. Don't apply the now unnecessary
26 howto->size shift to branch REL addends. Don't refetch R_ARM_ABS8
27 and R_ARM_ABS16 addends. Don't refetch thumb branch addends.
28 Correct R_ARM_THM_JUMP6 addend.
30 2020-08-25 Alan Modra <amodra@gmail.com>
33 * elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
34 before start of section.
36 2020-08-25 Alan Modra <amodra@gmail.com>
38 * elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
39 before accessing elf_hash_table_id.
40 * elf32-arc.c (elf_arc_hash_table): Likewise.
41 * elf32-arm.c (elf32_arm_hash_table): Likewise.
42 * elf32-avr.c (avr_link_hash_table): Likewise.
43 * elf32-bfin.c (bfinfdpic_hash_table): Likewise.
44 * elf32-cris.c (elf_cris_hash_table): Likewise.
45 * elf32-csky.c (csky_elf_hash_table): Likewise.
46 * elf32-frv.c (frvfdpic_hash_table): Likewise.
47 * elf32-hppa.c (hppa_link_hash_table): Likewise.
48 * elf32-lm32.c (lm32_elf_hash_table): Likewise.
49 * elf32-m32r.c (m32r_elf_hash_table): Likewise.
50 * elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
51 * elf32-m68k.c (elf_m68k_hash_table): Likewise.
52 * elf32-metag.c (metag_link_hash_table): Likewise.
53 * elf32-microblaze.c (elf32_mb_hash_table): Likewise.
54 * elf32-nds32.h (nds32_elf_hash_table): Likewise.
55 * elf32-or1k.c (or1k_elf_hash_table): Likewise.
56 * elf32-s390.c (elf_s390_hash_table): Likewise.
57 * elf32-sh.c (sh_elf_hash_table): Likewise.
58 * elf32-spu.c (spu_hash_table): Likewise.
59 * elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
60 * elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
61 * elf64-alpha.c (alpha_elf_hash_table): Likewise.
62 * elf64-hppa.c (hppa_link_hash_table): Likewise.
63 * elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
64 * elf64-s390.c (elf_s390_hash_table): Likewise.
65 * elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
66 * elfnn-riscv.c (riscv_elf_hash_table): Likewise.
67 * elfxx-mips.c (mips_elf_hash_table): Likewise.
68 * elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
69 * elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.
71 2020-08-21 Jon Turney <jon.turney@dronecode.org.uk>
73 * elf.c (elfcore_grok_win32pstatus): Change name_size to unsigned
74 int. Use '%u' format with _bfd_error_handler to render it.
76 2020-08-25 Alan Modra <amodra@gmail.com>
79 * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
80 and code_sec->makes_toc_func_call before sec_info[code_sec->id].
82 2020-08-25 Alan Modra <amodra@gmail.com>
85 * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
86 accessing elf_hash_table_id.
88 2020-08-25 Alan Modra <amodra@gmail.com>
91 * elf32-ppc.c (ppc_elf_hash_table): Test is_elf_hash_table before
92 accessing elf_hash_table_id.
94 2020-08-24 Mark Wielaard <mark@klomp.org>
96 * dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
97 (read_formatted_entries): Likewise. And skip zero entry.
99 2020-08-24 Cooper Qu <cooper.qu@linux.alibaba.com>
101 * bfd-in2.h (bfd_mach_ck860): New.
102 * cpu-csky.c (arch_info_struct): Add item for CK860.
104 2020-08-24 Alan Modra <amodra@gmail.com>
106 * elf32-ppc.c (ppc_elf_check_relocs): Set has_tls_reloc for
107 high part tprel16 relocs.
108 (ppc_elf_tls_optimize): Sanity check high part tprel16 relocs.
109 Clear do_tls_opt on odd instructions.
110 (ppc_elf_relocate_section): Move TPREL16_HA/LO optimisation later.
111 Don't sanity check them here.
112 * elf64-ppc.c (ppc64_elf_check_relocs): Set has_tls_reloc for
113 high part tprel16 relocs.
114 (ppc64_elf_tls_optimize): Sanity check high part tprel16 relocs.
115 Clear do_tls_opt on odd instructions.
116 (ppc64_elf_relocate_section): Don't sanity check TPREL16_HA.
118 2020-08-23 John David Anglin <danglin@gcc.gnu.org>
121 * configure.ac: Disable plugins by default on 32-bit hppa*-*-hpux*.
122 * configure: Regenerate.
124 2020-08-22 H.J. Lu <hongjiu.lu@intel.com>
127 * elflink.c (elf_link_output_symstrtab): Keep only one '@' for
128 versioned symbols, which are defined in shared objects, in
131 2020-08-21 Nick Clifton <nickc@redhat.com>
133 * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
134 the data map if there are entries in it.
135 (_bfd_aarch64_erratum_843419_scan): Likewise.
137 2020-08-21 Jan Beulich <jbeulich@suse.com>
139 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check
140 last byte of debug dir, not first.
142 2020-08-20 Nick Clifton <nickc@redhat.com>
145 * bfd.c (bfd_update_compression_header): Also set the sh_addralign
146 field in the ELF header of the compressed sections.
148 2020-08-20 Nick Clifton <nickc@redhat.com>
151 * elf-bfd.h (struct bfd_elf_section_data): Add
152 has_secondary_relocs field.
153 * elf.c (_bfd_elf_copy_special_section_fields): Set the
154 has_secondary_relocs field for sections which have associated
156 * elfcode.h (elf_write_relocs): Only call write_secondary_relocs
157 on sections which have associated secondary relocs.
159 2020-08-15 Alan Modra <amodra@gmail.com>
161 * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
162 small common section.
163 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
164 * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
165 * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
166 * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
167 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
168 * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
169 * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
170 * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
171 * elf32-v850.c (v850_elf_check_relocs): Likewise.
172 (v850_elf_add_symbol_hook): Likewise.
173 * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
174 * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
175 * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
176 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
178 2020-08-15 Alan Modra <amodra@gmail.com>
181 * syms.c (bfd_decode_symclass): Choose 'c' for commons only when
183 * elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
184 on small common section.
185 * elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
186 * elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
187 * elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
188 * elf32-v850.c (v850_elf_symbol_processing): Likewise.
189 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
190 * ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.
192 2020-08-14 Alan Modra <amodra@gmail.com>
194 * hash.c (bfd_hash_set_default_size): Use higher_prime_number
195 rather than another copy of primes. Increase maximum default
198 2020-08-13 Alan Modra <amodra@gmail.com>
200 * config.bfd: Obsolete arm*-*-symbianelf*, and ia64*-*-*.
202 2020-08-13 Alan Modra <amodra@gmail.com>
204 * elf64-ppc.h (struct ppc64_elf_params): Add no_pcrel_opt.
205 * elf64-ppc.c (ppc64_elf_relocate_section): Disable GOT reloc
206 optimizations when --no-toc-optimize. Disable R_PPC64_PCREL_OPT
207 optimization when --no-pcrel-optimize.
209 2020-08-13 Alan Modra <amodra@gmail.com>
212 * bfd.c (struct bfd): Add read_only.
213 * elfcode.h (elf_swap_shdr_in): Test both sh_offset and sh_size.
214 Set read_only on warning.
215 (elf_object_p): Sanity check program header alignment. Set
216 read_only on warning.
217 * bfd-in2.h: Regenerate.
219 2020-08-12 Jon Turney <jon.turney@dronecode.org.uk>
221 * elf.c (elfcore_grok_win32pstatus): Use unsigned int for
222 win32pstatus note type to avoid signedness comparison warning.
224 2020-07-21 Jon Turney <jon.turney@dronecode.org.uk>
226 * elf.c (elfcore_grok_win32pstatus): Warn on malformed
227 win32pstatus notes, and return TRUE so we continue rather than
228 stopping as if it was an error.
230 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
232 * elf.c (elfcore_grok_win32pstatus): Handle NOTE_INFO_MODULE64.
234 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
236 * elf.c (elfcore_grok_win32pstatus): Don't apply size constraint
237 for NOTE_INFO_THREAD to all win32pstatus ELF notes, instead apply
238 appropriate size constraint for each win32pstatus note type.
240 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
242 * elf.c (elfcore_grok_win32pstatus): Don't hardcode the size of
243 the Win32 API thread CONTEXT type read from a NOTE_INFO_THREAD
246 2020-07-11 Jon Turney <jon.turney@dronecode.org.uk>
248 * elf.c (NOTE_INFO{_PROCESS,_THREAD,_MODULE}): Define.
249 (elfcore_grok_win32pstatus): Use.
251 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
253 * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read
254 the tid from a win32pstatus NOTE_INFO_THREAD ELF note. Fix
255 offsets used to read NOTE_INFO_PROCESS.
257 2020-08-12 Nick Clifton <nickc@redhat.com>
259 * po/ru.po: Updated Russian translation.
260 * po/sr.po: Updated Serbian translation.
262 2020-08-07 David Faust <david.faust@oracle.com>
264 * elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
265 DISP16 and DISP32 relocations.
267 2020-08-05 David Faust <david.faust@oracle.com>
269 * elf64-bpf.c (bpf_elf_generic_reloc): New function.
270 (bpf_elf_howto_table): Use it here.
271 (bpf_elf_relocate_section): Use addends recorded in input_bfd for
272 instruction and data relocations.
274 2020-08-03 Alan Modra <amodra@gmail.com>
276 * vms-lib.c (vms_traverse_index): Sanity check size remaining
277 before accessing vms_idx or vms_elfidx.
279 2020-08-03 Alan Modra <amodra@gmail.com>
282 * elf.c (_bfd_elf_get_symtab_upper_bound): Sanity check symbol table
283 size against file size. Correct LONG_MAX limit check.
284 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
285 (_bfd_elf_get_reloc_upper_bound): Don't check file size if writing.
286 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
287 * elf64-x86-64-.c (elf_x86_64_get_synthetic_symtab): Use
288 bfd_malloc_and_get_section.
290 2020-07-31 Alan Modra <amodra@gmail.com>
293 * elflink.c (bfd_elf_link_record_dynamic_symbol): Don't allow
294 IR symbols to become dynamic.
295 (elf_link_add_object_symbols): Don't exclude IR symbols when
296 deciding whether an as-needed shared library is needed.
298 2020-07-30 Szabolcs Nagy <szabolcs.nagy@arm.com>
301 * elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
303 (elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.
305 2020-07-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
307 * bfd.m4 (BFD_SYS_PROCFS_H): New macro.
308 (BFD_HAVE_SYS_PROCFS_TYPE): Require BFD_SYS_PROCFS_H.
309 Don't define _STRUCTURED_PROC.
310 (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
311 * elf.c [HAVE_SYS_PROCFS_H] (_STRUCTURED_PROC): Don't define.
312 * configure.ac: Use BFD_SYS_PROCFS_H to check for <sys/procfs.h>.
313 * configure, config.in: Regenerate.
314 * Makefile.am (AM_CPPFLAGS): Add LARGEFILE_CPPFLAGS.
315 * Makefile.in, doc/Makefile.in: Regenerate.
317 2020-07-30 H.J. Lu <hongjiu.lu@intel.com>
319 * elf-bfd.h (sym_cache): Moved before elf_link_hash_table.
320 (elf_link_hash_table): Add sym_cache.
321 * elf32-arm.c (elf32_arm_link_hash_table): Remove sym_cache.
322 (elf32_arm_check_relocs): Updated.
323 (elf32_arm_size_dynamic_sections): Likewise.
324 * elf32-bfin.c (bfin_link_hash_table): Removed.
325 (bfin_link_hash_newfunc): Updated.
326 (bfin_hash_table): Removed.
327 * elf32-csky.c (csky_elf_link_hash_table): Remove sym_cache.
328 (csky_elf_check_relocs): Updated.
329 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove sym_cache.
330 (elf32_hppa_check_relocs): Updated.
331 * elf32-i386.c (elf_i386_tls_transition): Updated.
332 (elf_i386_convert_load_reloc): Likewise.
333 (elf_i386_check_relocs): Likewise.
334 * elf32-m32r.c (elf_m32r_link_hash_table): Removed.
335 (m32r_elf_hash_table): Updated.
336 (m32r_elf_link_hash_table_create): Likewise.
337 (m32r_elf_create_dynamic_sections): Likewise.
338 (m32r_elf_adjust_dynamic_symbol): Likewise.
339 (allocate_dynrelocs): Likewise.
340 (m32r_elf_size_dynamic_sections): Likewise.
341 (m32r_elf_relocate_section): Likewise.
342 (m32r_elf_finish_dynamic_symbol): Likewise.
343 (m32r_elf_check_relocs): Likewise.
344 * elf32-m68hc1x.h (m68hc11_elf_link_hash_table): Remove
346 * elf32-m68k.c (elf_m68k_link_hash_table): Likewise.
347 (elf_m68k_check_relocs): Updated.
348 * elf32-metag.c (elf_metag_link_hash_table): Remove sym_cache.
349 (elf_metag_check_relocs): Updated.
350 * elf32-microblaze.c (elf32_mb_link_hash_table): Remove sym_sec.
351 (microblaze_elf_check_relocs): Updated.
352 * elf32-nds32.c (nds32_elf_link_hash_table_create): Likewise.
353 (nds32_elf_create_dynamic_sections): Likewise.
354 (nds32_elf_adjust_dynamic_symbol): Likewise.
355 (nds32_elf_check_relocs): Likewise.
356 * elf32-nds32.h (elf_nds32_link_hash_table): Remove sdynbss,
357 srelbss and aym_cache.
358 * elf32-nios2.c (elf32_nios2_link_hash_table): Remove sym_cache.
359 (nios2_elf32_check_relocs): Updated.
360 * elf32-or1k.c (elf_or1k_link_hash_table): Remove sym_sec.
361 (or1k_elf_check_relocs): Updated.
362 * elf32-ppc.c (ppc_elf_check_relocs): Remove sym_cache.
363 (ppc_elf_check_relocs): Updated.
364 * elf32-s390.c (elf_s390_link_hash_table): Remove sym_cache.
365 (elf_s390_check_relocs): Updated.
366 (elf_s390_finish_dynamic_sections): Likewise.
367 * elf32-sh.c (elf_sh_link_hash_table): Remove sdynbss, srelbss
369 (sh_elf_create_dynamic_sections): Updated.
370 (sh_elf_adjust_dynamic_symbol): Likewise.
371 (sh_elf_size_dynamic_sections): Likewise.
372 (sh_elf_check_relocs): Likewise.
373 * elf32-tic6x.c (elf32_tic6x_link_hash_table): Remove sym_cache.
374 (elf32_tic6x_check_relocs): Updated.
375 * elf32-tilepro.c (tilepro_elf_link_hash_table): Removed.
376 (tilepro_elf_hash_table): Updated.
377 (tilepro_elf_link_hash_table_create): Likewise.
378 (tilepro_elf_check_relocs): Likewise.
379 (tilepro_elf_adjust_dynamic_symbol): Likewise.
380 (allocate_dynrelocs): Likewise.
381 (tilepro_elf_size_dynamic_sections): Likewise.
382 (tilepro_elf_relocate_section): Likewise.
383 (tilepro_elf_finish_dynamic_symbol): Likewise.
384 (tilepro_finish_dyn): Likewise.
385 (tilepro_elf_finish_dynamic_sections): Likewise.
386 * elf64-ppc.c (ppc_link_hash_table): Remove sym_cache.
387 (ppc64_elf_before_check_relocs): Updated.
388 (ppc64_elf_check_relocs): Likewise.
389 * elf64-s390.c (elf_s390_link_hash_table): Remove sym_cache.
390 (elf_s390_check_relocs): Updated.
391 (elf_s390_relocate_section): Likewise.
392 (elf_s390_finish_dynamic_sections): Likewise.
393 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
394 (elf_x86_64_check_relocs): Likewise.
395 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
397 (elfNN_aarch64_check_relocs): Updated.
398 * elfnn-riscv.c (riscv_elf_link_hash_table): Remove sym_cache.
399 (riscv_elf_check_relocs): Updated.
400 * elfxx-mips.c (mips_elf_link_hash_table): Remove sym_cache.
401 (mips_elf_resolve_got_page_ref): Updated.
402 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
403 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
405 * elfxx-tilegx.c (tilegx_elf_link_hash_table): Likewise.
406 (tilegx_elf_check_relocs): Updated.
407 * elfxx-x86.h (elf_x86_link_hash_table): Remove sym_cache.
409 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
411 * elflink.c (bfd_elf_final_link): Give local symbols a name if
413 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
414 return TRUE if making ET_REL output.
416 2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
418 * elf-bfd.h (elf_backend_data): Add
419 `elf_backend_elfsym_local_is_section' member.
420 * elfxx-target.h (elf_backend_elfsym_local_is_section): New
422 (elfNN_bed): Add `elf_backend_elfsym_local_is_section' member.
423 * elflink.c (bfd_elf_final_link): Use it to determine whether
424 set the `.symtab' section's `sh_info' value to the index of the
425 first non-local or non-section symbol.
426 * elf32-mips.c (mips_elf32_elfsym_local_is_section): New
428 (elf_backend_elfsym_local_is_section): New macro.
429 * elfn32-mips.c (mips_elf_n32_elfsym_local_is_section): New
431 (elf_backend_elfsym_local_is_section): New macro.
433 2020-07-29 Alan Modra <amodra@gmail.com>
435 * elflink.c (bfd_elf_final_link): Don't segfault on local dynsyms
436 defined in excluded sections.
438 2020-07-28 Alan Modra <amodra@gmail.com>
440 * elf.c (assign_section_numbers): Comment. Don't segfault on
441 discarded sections when setting linked-to section for generic
443 * elflink.c (bfd_elf_match_symbols_in_sections): Allow NULL info.
445 2020-07-27 Alan Modra <amodra@gmail.com>
447 * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
449 (bfd_xcoff_import_symbol): Don't fuss over absolute symbol
452 2020-07-24 Nick Clifton <nickc@redhat.com>
454 * config.bfd: Move xc16x target to the obsolete list.
456 2020-07-22 Kevin Buettner <kevinb@redhat.com>
458 * binary.c (binary_get_section_contents): Seek using offset
459 from section's file position.
461 2020-07-22 Kevin Buettner <kevinb@redhat.com>
463 * elf.c (_bfd_elf_make_section_from_phdr): Remove hack for GDB.
465 2020-07-22 Max Filippov <jcmvbkbc@gmail.com>
468 * elf32-xtensa.c (removed_literal_compare): Use correct pointer
469 type for the first function argument. Rename pointers to reflect
470 that they have distinct types.
472 2020-07-20 Alan Modra <amodra@gmail.com>
474 * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
476 2020-07-19 Alan Modra <amodra@gmail.com>
478 * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
479 (select_alt_stub): New function.
480 (ppc_get_stub_entry): Use it here.
481 (ppc64_elf_check_relocs): Set had_power10_relocs rather than
483 (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't
484 merge notoc stubs with other varieties when power10_stubs is "auto".
485 Instead dup the stub hash table entry.
486 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
487 tests of power10_stubs.
489 2020-07-15 Alan Modra <amodra@gmail.com>
492 * coffgen.c (_bfd_coff_close_and_cleanup): Free dwarf2 info.
494 2020-07-15 Nick Clifton <nickc@redhat.com>
497 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
498 check for aux entries that overflow the buufer.
500 2020-07-15 Hans-Peter Nilsson <hp@bitrange.com>
502 * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
503 R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.
505 2020-07-15 Markus Böck <markus.boeck02@gmail.com>
506 Alan Modra <amodra@gmail.com>
509 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin
510 objects both before and after normal object files.
511 * elflink.c (_bfd_elf_section_already_linked): Likewise.
513 2020-07-10 Alan Modra <amodra@gmail.com>
515 * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs.
516 * elf64-ppc.c (struct ppc_link_hash_table): Delete
518 (ppc64_elf_check_relocs): Adjust setting of power10_stubs.
519 (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
520 uses of power10_stubs.
522 2020-07-09 Alan Modra <amodra@gmail.com>
524 * coff-ppc.c: Delete.
527 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC.
528 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove
530 (coff_write_object_contents): Remove PPC_PE code.
531 * config.bfd: Move powerpcle-pe to removed targets.
532 * configure.ac: Remove powerpc PE entries.
533 * libcoff-in.h (ppc_allocate_toc_section): Delete.
534 (ppc_process_before_allocation): Delete.
535 * peXXigen.c: Remove POWERPC_LE_PE code and comments.
536 * targets.c: Remove powerpc PE vectors.
537 * po/SRC-POTFILES.in: Regenerate.
538 * libcoff.h: Regenerate.
539 * Makefile.in: Regenerate.
540 * configure: Regenerate.
542 2020-07-09 Nick Clifton <nickc@redhat.com>
544 * po/fr.po: Updated French translation.
546 2020-07-07 Alan Modra <amodra@gmail.com>
548 * xcofflink.c (xcoff_mark): Don't mark const sections.
549 (bfd_xcoff_record_link_assignment): Add FIXME.
550 (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic
551 sections being discarded by linker script.
553 2020-07-07 Alan Modra <amodra@gmail.com>
555 * coff-rs6000.c (xcoff_write_archive_contents_old): Set default
556 time, uid, gid and mode for deterministic archive.
557 (xcoff_write_archive_contents_big): Likewise.
559 2020-07-07 Alan Modra <amodra@gmail.com>
561 * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and
564 2020-07-06 Nick Clifton <nickc@redhat.com>
566 * po/pt.po: Updated Portuguese translation.
567 * po/uk.po: Updated Ukranian translation.
569 2020-07-04 Nick Clifton <nickc@redhat.com>
571 * version.m4: Set version to 2.35.50.
572 * configure: Regenerate.
573 * po/bbfd.pot: Regenerate.
575 2020-07-04 Nick Clifton <nickc@redhat.com>
577 Binutils 2.35 branch created.
579 2020-07-01 Alan Modra <amodra@gmail.com>
582 * coffgen.c (coff_find_nearest_line_with_names): Sanity check
583 raw syment index before dereferencing.
585 2020-07-01 Alan Modra <amodra@gmail.com>
587 * elf32-i386.c (elf_backend_object_p): Undef for vxworks.
589 2020-07-01 Alan Modra <amodra@gmail.com>
591 * config.bfd: Obsolete xc16x.
593 2020-06-30 H.J. Lu <hongjiu.lu@intel.com>
595 * archures.c (bfd_mach_i386_nacl): Removed.
596 (bfd_mach_i386_i386_nacl): Likewise.
597 (bfd_mach_x86_64_nacl): Likewise.
598 (bfd_mach_x64_32_nacl): Likewise.
599 * config.bfd: Remove *-*-nacl* targets.
600 * configure.ac: Remove x86 NaCl target vectors.
601 * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed.
602 (bfd_x64_32_nacl_arch): Likewise.
603 (bfd_x86_64_nacl_arch): Likewise.
604 (bfd_i386_nacl_arch): Likewise.
605 (bfd_x64_32_arch_intel_syntax): Updated.
606 * elf32-i386.c: Don't include "elf-nacl.h".
607 (elf_i386_nacl_plt): Removed.
608 (elf_i386_nacl_plt0_entry): Likewise.
609 (elf_i386_nacl_plt_entry): Likewise.
610 (elf_i386_nacl_pic_plt0_entry): Likewise.
611 (elf_i386_nacl_pic_plt_entry): Likewise.
612 (elf_i386_nacl_eh_frame_plt): Likewise.
613 (elf_i386_nacl_plt): Likewise.
614 (elf32_i386_nacl_elf_object_p): Likewise.
615 (elf_i386_get_synthetic_symtab): Updated.
616 (elf_i386_link_setup_gnu_properties): Likewise.
617 * elf64-x86-64.c: Don't include "elf-nacl.h".
618 (elf_x86_64_nacl_plt): Removed.
619 (elf64_x86_64_nacl_elf_object_p): Likewise.
620 (elf_x86_64_nacl_plt0_entry): Likewise.
621 (elf_x86_64_nacl_plt_entry): Likewise.
622 (elf_x86_64_nacl_eh_frame_plt): Likewise.
623 (elf_x86_64_nacl_plt): Likewise.
624 (elf32_x86_64_nacl_elf_object_p): Likewise.
625 (elf_x86_64_get_synthetic_symtab): Updated.
626 (elf_x86_64_link_setup_gnu_properties): Likewise.
627 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
628 * targets.c: Remove x86 NaCl target vectors.
629 * bfd-in2.h: Regenerated.
630 * configure: Likewise.
632 2020-06-29 H.J. Lu <hongjiu.lu@intel.com>
634 * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call
635 _bfd_elf_add_dynamic_tags.
637 2020-06-29 Alan Modra <amodra@gmail.com>
639 * peXXigen.c (_bfd_XXi_slurp_codeview_record): Properly check
640 return value of bfd_bread. Don't read more than requested length.
641 Sanity check length. Properly terminate file name.
643 2020-06-29 Alan Modra <amodra@gmail.com>
645 * arc-got.h: Use C style comments.
646 * coff-z80.c: Likewise.
647 * elf32-csky.c: Likewise.
648 * peXXigen.c: Likewise.
649 * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out
652 2020-06-26 Pat Bernardi <bernardi@adacore.com>
654 * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function.
655 (elf32_m68k_merge_private_bfd_data): Merge GNU attributes.
657 2020-06-26 Alan Modra <amodra@gmail.com>
659 * elfxx-riscv.c (struct priv_spec_t, priv_specs),
660 (riscv_get_priv_spec_class, riscv_get_priv_spec_class_from_numbers),
661 (riscv_get_priv_spec_name): Move to..
662 * cpu-riscv.c: ..here.
663 (riscv_get_priv_spec_class_from_numbers): Don't xmalloc temp buffer.
664 Use %u to print unsigned numbers.
666 2020-06-24 Andrew Burgess <andrew.burgess@embecosm.com>
668 * cpu-riscv.c (riscv_scan): Don't allow shorter matches using the
669 default architecture.
671 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
674 * elf32-csky.c (csky_elf_size_dynamic_sections): Call
675 _bfd_elf_add_dynamic_tags.
677 2020-06-24 H.J. Lu <hongjiu.lu@intel.com>
680 * elf32-cris.c (elf_cris_size_dynamic_sections): Call
681 _bfd_elf_add_dynamic_tags.
683 2020-06-24 Alan Modra <amodra@gmail.com>
685 * vms-alpha.c (_bfd_vms_slurp_etir <ETIR__C_OPR_ASH>): Implement
686 shifts without undefined behaviour.
688 2020-06-23 H.J. Lu <hongjiu.lu@intel.com>
690 * elf-bfd.h (elf_link_hash_table): Add dt_pltgot_required and
692 (_bfd_elf_add_dynamic_tags): New.
693 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Call
694 _bfd_elf_add_dynamic_tags.
695 * elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
696 * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
697 * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
698 * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
699 * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
700 * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
701 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
702 * elf32-microblaze.c (microblaze_elf_size_dynamic_sections):
704 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
705 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
706 * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
707 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
708 * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
709 * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
710 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
711 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
712 * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections):
714 * elfnn-riscv.c (riscv_elf_size_dynamic_sections): Likewise.
715 * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
716 * elf32-arm.c (elf32_arm_size_dynamic_sections): Call
717 _bfd_elf_maybe_vxworks_add_dynamic_tags.
718 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
719 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections):
721 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
722 (_bfd_x86_elf_size_dynamic_sections): Likewise.
723 * elfxx-x86.h (elf_x86_link_hash_table): Remove dt_reloc,
724 dt_reloc_sz and dt_reloc_ent.
725 * elf-vxworks.c (_bfd_elf_maybe_vxworks_add_dynamic_tags): New.
726 * elf-vxworks.h (_bfd_elf_maybe_vxworks_add_dynamic_tags):
728 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Set
729 etab.dt_pltgot_required.
730 (elf32_hppa_size_dynamic_sections): Call
731 _bfd_elf_add_dynamic_tags.
732 * elf32-metag.c (elf_metag_link_hash_table_create): Set
733 etab.dt_pltgot_required.
734 (elf_metag_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags.
735 * elf32-sh.c (sh_elf_link_hash_table_create): Set
736 root.dt_pltgot_required for FDPIC output.
737 (sh_elf_size_dynamic_sections): Call
738 _bfd_elf_maybe_vxworks_add_dynamic_tags.
739 * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Set
740 elf.dt_pltgot_required.
741 (elf_xtensa_size_dynamic_sections): Call
742 _bfd_elf_add_dynamic_tags.
743 * elf64-hppa.c (elf64_hppa_hash_table_create): Set
744 root.dt_pltgot_required.
745 (elf64_hppa_size_dynamic_sections): Call
746 _bfd_elf_add_dynamic_tags.
747 * elfnn-ia64.c (elfNN_ia64_hash_table_create): Set
748 root.dt_pltgot_required.
749 (elfNN_ia64_size_dynamic_sections): Set root.dt_jmprel_required
750 for rel_pltoff_sec. Call _bfd_elf_add_dynamic_tags.
751 * elflink.c (_bfd_elf_add_dynamic_tags): New.
753 2020-06-22 Saagar Jha <saagar@saagarjha.com>
755 * mach-o.c: Support the new load commands by reading a linkedit
756 data command for them.
758 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
760 * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from
761 opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker.
762 (riscv_get_priv_spec_class): Likewise.
763 (riscv_get_priv_spec_name): Likewise.
764 (riscv_get_priv_spec_class_from_numbers): New function, convert
765 the version numbers into string, then call riscv_get_priv_spec_class
766 to get the priv spec class.
767 * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration
768 from include/opcode/riscv.h to bfd/elfxx-riscv.h.
769 (riscv_get_priv_spec_name): Likewise.
770 (riscv_get_priv_spec_class_from_numbers): New forward declaration.
771 (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c.
772 * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes
773 of input and output objects form their priv spec attributes by
774 riscv_get_priv_spec_class_from_numbers. Report warning rather than
775 errors when linking objects with differnet priv spec versions. We do
776 know v1.9.1 may have conflicts to other versions, so report the
777 warning, too. After that, update the output priv spec version to the
780 2020-06-22 Nelson Chu <nelson.chu@sifive.com>
782 * elfnn-riscv.c (riscv_merge_attributes): Once we meet one of the
783 priv attributes, we will check the conflicts for all of them (major,
784 minor and revision), and then set the priv_attrs_merged to TRUE to
785 indicate that we have handled all of the priv attributes. Remove
786 the unused boolean priv_may_conflict, in_priv_zero and out_priv_zero.
788 2020-06-21 Alan Modra <amodra@gmail.com>
791 * configure.ac: Disable plugins by default for some targets.
792 * plugin.c: Comment typo fix.
793 * configure: Regenerate.
795 2020-06-19 Nick Clifton <nickc@redhat.com>
797 * plugin.c (try_load_plugin): Suppress the error message about
798 being unable to open a plugin if creating a list of viable
801 2020-06-16 Alan Modra <amodra@gmail.com>
803 * aout-tic30.c: Delete file.
804 * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo.
805 (BFD32_BACKENDS_CFILES): Remove aout-tic30.c.
806 * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry.
807 (xc16x-*-elf): Sort properly.
808 * configure.ac: Remove tic30_aout_vec.
809 * targets.c: Likewise.
810 * Makefile.in: Regenerate.
811 * configure: Regenerate.
812 * po/SRC-POTFILES.in: Regenerate.
814 2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
816 * elf32-xtensa.c (XSHAL_ABI, XTHAL_ABI_UNDEFINED)
817 (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New macros.
818 (elf32xtensa_abi): New global variable.
819 (xtensa_abi_choice): New function.
820 (elf_xtensa_create_plt_entry): Use xtensa_abi_choice instead of
821 XSHAL_ABI to select PLT code.
823 2020-06-15 Roland McGrath <mcgrathr@google.com>
825 * elflink.c (bfd_elf_define_start_stop): Use start_stop_visibility
826 field of bfd_link_info.
828 2020-06-15 Alan Modra <amodra@gmail.com>
830 * config.bfd: Obsolete powerpcle-*-pe targets.
832 2020-06-15 Alan Modra <amodra@gmail.com>
835 * elflink.c (elf_link_add_archive_symbols): Exclude undefined
836 symbols that were defined in discarded sections.
837 * cofflink.c (coff_link_check_archive_element): Likewise.
838 (coff_link_add_symbols): Set indx to -3 for symbols defined in
840 (_bfd_coff_write_global_sym): Don't emit such symbols.
841 libcoff-in.h (struct coff_link_hash_entry): Update indx comment.
842 libcoff.h: Regenerate.
844 2020-06-11 Alan Modra <amodra@gmail.com>
847 * pdp11.c (is_stab): Replace legacy "index" function with "strchr".
849 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
851 * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
852 (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
853 (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
856 2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
859 * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
860 Clear verinfo.verdef.
862 2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
865 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers.
866 (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the
867 bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC
869 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
870 Set ifunc_resolvers if there are FUNC resolvers.
871 * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver.
872 (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver
873 with elf.ifunc_resolvers.
874 (write_plt_relocs_for_local_syms): Likewise.
875 (ppc64_elf_relocate_section): Likewise.
876 (ppc64_elf_finish_dynamic_sections): Likewise.
877 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
879 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
880 (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers
881 instead of readonly_dynrelocs_against_ifunc.
882 * elfxx-x86.h (elf_x86_link_hash_table): Remove
883 readonly_dynrelocs_against_ifunc.
885 2020-06-09 Alan Modra <amodra@gmail.com>
887 * elf64-ppc.c (struct ppc_link_hash_table): Delete
888 maybe_local_ifunc_resolver field.
889 (build_global_entry_stubs_and_plt): Set local_ifunc_resolver in
890 cases where maybe_local_ifunc_resolver was set.
891 (ppc64_elf_relocate_section): Likewise.
892 (ppc64_elf_finish_dynamic_sections): Downgrade ifunc with textrel
895 2020-06-08 H.J. Lu <hongjiu.lu@intel.com>
897 * elf-bfd.h (elf_link_hash_entry): Add tlsdesc_plt and
899 * elf32-arm.c (elf32_arm_link_hash_table): Remove tlsdesc_plt
901 (elf32_arm_size_dynamic_sections): Updated. Clear
902 root.tlsdesc_plt for DF_BIND_NOW.
903 (elf32_arm_finish_dynamic_sections): Updated.
904 (elf32_arm_output_arch_local_syms): Likewise.
905 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Updated.
906 Clear root.tlsdesc_plt for DF_BIND_NOW.
907 (nds32_elf_finish_dynamic_sections): Updated.
908 * elf32-nds32.h (elf_nds32_link_hash_table): Remove
909 dt_tlsdesc_plt and dt_tlsdesc_got.
910 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Updated.
911 * elfnn-aarch64.c (elf_aarch64_link_hash_table): Remove
912 tlsdesc_plt and dt_tlsdesc_got.
913 (elfNN_aarch64_allocate_dynrelocs): Updated.
914 (elfNN_aarch64_finish_dynamic_sections): Likewise.
915 (elfNN_aarch64_size_dynamic_sections): Updated. Clear
916 root.tlsdesc_plt for DF_BIND_NOW. Don't check DF_BIND_NOW
918 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
919 (_bfd_x86_elf_size_dynamic_sections): Likewise.
920 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
921 * elfxx-x86.h (elf_x86_link_hash_table): Remove tlsdesc_plt and
924 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
926 * elf32-tic6x.c (elf32_bed): Defined the default to
929 2020-06-07 H.J. Lu <hongjiu.lu@intel.com>
931 * elf64-hppa.c (elf64_hppa_link_hash_table): Remove plt_sec and
933 (elf64_hppa_check_relocs): Replace plt_sec/plt_rel_sec with
934 root.splt/root.srelplt.
935 (elf64_hppa_create_dynamic_sections): Likewise.
936 (elf64_hppa_size_dynamic_sections): Likewise.
937 (elf64_hppa_finish_dynamic_symbol): Likewise.
938 (elf_hppa_final_link): Likewise.
939 (elf_hppa_final_link_relocate): Likewise.
941 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
943 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Updated.
944 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Remove
947 2020-06-06 H.J. Lu <hongjiu.lu@intel.com>
949 * elf-bfd.h (elf_target_os): New.
950 (elf_link_hash_table): Add target_os.
951 (elf_backend_data): Add target_os.
952 * elf32-arm.c (elf32_arm_link_hash_table): Remove vxworks_p,
953 symbian_p and nacl_p.
954 (create_got_section): Updated.
955 (elf32_arm_create_dynamic_sections): Likewise.
956 (arm_type_of_stub): Likewise.
957 (elf32_arm_create_or_find_stub_sec): Likewise.
958 (elf32_arm_allocate_plt_entry): Likewise.
959 (elf32_arm_populate_plt_entry): Likewise.
960 (elf32_arm_final_link_relocate): Likewise.
961 (elf32_arm_check_relocs): Likewise.
962 (allocate_dynrelocs_for_symbol): Likewise.
963 (elf32_arm_finish_dynamic_symbol): Likewise.
964 (elf32_arm_finish_dynamic_sections): Likewise.
965 (elf32_arm_output_plt_map_1): Likewise.
966 (elf32_arm_output_arch_local_syms): Likewise.
967 (elf32_arm_add_symbol_hook): Likewise.
968 (elf32_arm_nacl_link_hash_table_create): Likewise.
969 (elf32_arm_vxworks_link_hash_table_create): Likewise.
970 (elf32_arm_symbian_link_hash_table_create): Likewise.
971 (ELF_TARGET_OS): New.
972 * elf32-i386.c (elf_i386_arch_bed): Removed.
973 (elf_backend_arch_data): Likewise.
974 (elf_i386_solaris_arch_bed): Likewise.
975 (elf_i386_nacl_arch_bed): Likewise.
976 (elf_i386_vxworks_arch_bed): Likewise.
977 (elf_i386_relocate_section): Updated.
978 (elf_i386_finish_dynamic_sections): Likewise.
979 (elf_i386_get_synthetic_symtab): Likewise.
980 (elf_i386_link_setup_gnu_properties): Likewise.
981 (ELF_TARGET_OS): New.
982 * elf32-mips.c (ELF_TARGET_OS): New.
983 * elf32-ppc.c (ppc_elf_link_hash_table): Remove is_vxworks.
984 (ppc_elf_create_got): Updated.
985 (ppc_elf_create_dynamic_sections): Likewise.
986 (ppc_elf_check_relocs): Likewise.
987 (ppc_elf_adjust_dynamic_symbol): Likewise.
988 (ppc_elf_size_dynamic_sections): Likewise.
989 (ppc_elf_relocate_section): Likewise.
990 (ppc_elf_finish_dynamic_sections): Likewise.
991 (ppc_elf_vxworks_link_hash_table_create): Likewise.
992 (ELF_TARGET_OS): New.
993 * elf32-sh.c (elf_sh_link_hash_table): Remove vxworks_p.
994 (sh_elf_link_hash_table_create): Updated.
995 (sh_elf_create_dynamic_sections): Likewise.
996 (allocate_dynrelocs): Likewise.
997 (sh_elf_size_dynamic_sections): Likewise.
998 (sh_elf_relocate_section): Likewise.
999 (sh_elf_finish_dynamic_symbol): Likewise.
1000 (sh_elf_finish_dynamic_sections): Likewise.
1001 (ELF_TARGET_OS): New.
1002 * elf32-sparc.c (elf32_sparc_vxworks_link_hash_table_create):
1004 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1005 (ELF_TARGET_OS): New.
1006 * elf64-x86-64.c (elf_x86_64_arch_bed): Removed.
1007 (elf_x86_64_solaris_arch_bed): Likewise.
1008 (elf_x86_64_nacl_arch_bed): Likewise.
1009 (elf_x86_64_finish_dynamic_sections): Updated.
1010 (elf_x86_64_get_synthetic_symtab): Likewise.
1011 (elf_x86_64_link_setup_gnu_properties): Likewise.
1012 (ELF_TARGET_OS): New.
1013 * elflink.c (_bfd_elf_link_hash_table_init): Initialize
1015 * elfxx-mips.c (mips_elf_link_hash_table): Remove is_vxworks.
1016 (MIPS_ELF_REL_DYN_NAME): Updated.
1017 (ELF_MIPS_GP_OFFSET): Likewise.
1018 (mips_elf_create_local_got_entry): Likewise.
1019 (mips_elf_allocate_dynamic_relocations): Likewise.
1020 (mips_elf_count_got_symbols): Likewise.
1021 (is_gott_symbol): Likewise.
1022 (mips_elf_calculate_relocation): Likewise.
1023 (mips_elf_create_dynamic_relocation): Likewise.
1024 (_bfd_mips_elf_check_relocs): Likewise.
1025 (allocate_dynrelocs): Likewise.
1026 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
1027 (mips_elf_lay_out_got): Likewise.
1028 (mips_elf_set_plt_sym_value): Likewise.
1029 (_bfd_mips_elf_size_dynamic_sections): Likewise.
1030 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1031 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
1032 (_bfd_mips_elf_final_link): Likewise.
1033 (_bfd_mips_init_file_header): Likewise.
1034 * elfxx-sparc.c (_bfd_sparc_elf_create_dynamic_sections):
1036 (allocate_dynrelocs): Likewise.
1037 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1038 (_bfd_sparc_elf_relocate_section): Likewise.
1039 (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1040 (sparc_finish_dyn): Likewise.
1041 (_bfd_sparc_elf_finish_dynamic_sections): Likewise.
1042 * elfxx-target.h (ELF_TARGET_OS): New.
1043 (elfNN_bed): Add ELF_TARGET_OS.
1044 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Updated.
1045 (_bfd_x86_elf_link_hash_table_create): Likewise.
1046 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1047 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
1048 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1049 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1050 * elfxx-x86.h (elf_x86_target_os): Removed.
1051 (elf_x86_backend_data): Likewise.
1052 (get_elf_x86_backend_data): Likewise.
1053 (elf_x86_link_hash_table): Remove target_os.
1055 2020-06-06 Alan Modra <amodra@gmail.com>
1058 BFD_RELOC_PPC64_GOT_TLSGD34 to BFD_RELOC_PPC64_GOT_TLSGD_PCREL34,
1059 BFD_RELOC_PPC64_GOT_TLSLD34 to BFD_RELOC_PPC64_GOT_TLSLD_PCREL34,
1060 BFD_RELOC_PPC64_GOT_TPREL34 to BFD_RELOC_PPC64_GOT_TPREL_PCREL34,
1061 BFD_RELOC_PPC64_GOT_DTPREL34 to BFD_RELOC_PPC64_GOT_DTPREL_PCREL34.
1062 * elf64-ppc.c: Update throughout for reloc renaming.
1063 (ppc64_elf_reloc_name_lookup): Handle old reloc names.
1064 * libbfd.h: Regenerate.
1065 * bfd-in2.h: Regenerate.
1067 2020-06-05 H.J. Lu <hongjiu.lu@intel.com>
1070 * elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
1073 2020-06-05 Nick Clifton <nickc@redhat.com>
1075 * pdp11.c (aout_link_add_symbols): Fix use before initialisation
1078 2020-06-05 Nelson Chu <nelson.chu@sifive.com>
1080 * elfnn-riscv.c (riscv_merge_attributes): Add new boolean
1081 priv_may_conflict, in_priv_zero and out_priv_zero to decide
1082 whether the object can be linked according to it's priv
1083 attributes. The object without any priv spec attributes can
1084 be linked with others. If the first input object doesn't contain
1085 any priv attributes, then we need to copy the setting from the
1086 next input one. Also report more detailed error messages to user.
1088 2020-06-04 Stephen Casner <casner@acm.org>
1090 Extend pdp11-aout symbol table format to accommodate .stab
1091 symbols and implement correct handling of them.
1093 * pdp11.c (pdp11_external_nlist): Repurposed e_unused to e_desc.
1094 (N_STAB, is_stab): Needed new function is_stab to disambiguate
1095 normal vs. .stab symbol table type values, replacing N_STAB mask.
1096 (translate_from_native_sym_flags): Determine correct section for
1097 different .stab types.
1098 (translate_to_native_sym_flags): Leave .stab types intact.
1099 (translate_symbol_table): Error if symbol indicates overlay;
1100 store desc field from .stab symbols.
1101 (write_syms): Output desc field with symbol.
1102 (aout_link_check_ar_symbols): Skip .stab symbols.
1103 (aout_link_add_symbols): Correctly distinguish .stab symbols.
1104 (aout_link_write_other_symbol): Write 0 for desk and ovly fields.
1105 (aout_link_write_symbols): Write 0 for desk and ovly fields;
1106 correctly distinguish .stab symbols and select calculate their
1107 section and value; and copy desc and ovly fields from input symbol
1110 2020-06-04 Stephen Casner <casner@acm.org>
1112 * aoutx.h (translate_symbol_table): Comment had external and
1114 * pdp11.c (translate_symbol_table): Likewise.
1116 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1118 * elfxx-x86.h (elf_x86_link_hash_table): Remove target_id.
1119 (is_x86_elf): Check elf.hash_table_id instead of target_id.
1120 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Updated.
1122 2020-06-04 H.J. Lu <hongjiu.lu@intel.com>
1125 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation
1126 in debug section against symbol defined in shared library to 0.
1127 * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check.
1128 * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
1129 * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1130 * elf32-nds32.c (nds32_elf_check_relocs): Likewise.
1131 * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
1132 * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1133 * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1134 * elf32-sh.c (sh_elf_check_relocs): Likewise.
1135 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1136 * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
1137 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1138 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1139 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1140 * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT
1142 (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if
1143 there is non-GOT reference.
1144 * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded,
1145 non-alloced sections.
1147 2020-06-03 Stephen Casner <casner@acm.org>
1149 Copy several years of fixes from bfd/aoutx.h to bfd/pdp11.c.
1151 * pdp11.c (some_aout_object_p): 4c1534c7a2a - Don't set EXEC_P for
1153 (aout_get_external_symbols): 6b8f0fd579d - Return if count is zero.
1154 0301ce1486b PR 22306 - Handle stringsize of zero, and error for any
1155 other size that doesn't qcover the header word.
1156 bf82069dce1 PR 23056 - Allocate an extra byte at the end of the
1157 string table, and zero it.
1158 (translate_symbol_table): 0d329c0a83a PR 22887 - Print an error
1159 message and set bfd_error on finding an invalid name string offset.
1160 (add_to_stringtab): INLINE -> inline
1161 (pdp11_aout_swap_reloc_in): 116acb2c268 PR 22887 - Correct r_index
1163 (squirt_out_relocs): e2996cc315d PR 20921 - Check for and report
1164 any relocs that could not be recognised.
1165 92744f05809 PR 20929 - Check for relocs without an associated symbol.
1166 (find_nearest_line): 808346fcfcf PR 23055 - Check that the symbol
1167 name exists and is long enough, before attempting to see if it is
1169 c3864421222 - Correct case for N_SO being the last symbol.
1170 50455f1ab29 PR 20891 - Handle the case where the main file name
1171 and the directory name are both empty.
1172 e82ab856bb4 PR 20892 - Handle the case where function name is empty.
1173 (aout_link_add_symbols): e517df3dbf7 PR 19629 - Check for out of
1174 range string table offsets.
1175 531336e3a0b PR 20909 - Fix off-by-one error in check for an
1176 illegal string offset.
1177 (aout_link_includes_newfunc): Add comment.
1178 (pdp11_aout_link_input_section): ad756e3f9e6 - Return with an error
1179 on unexpected relocation type rather than ASSERT.
1181 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1184 * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Call
1185 _bfd_elf_maybe_set_textrel to set DF_TEXTREL.
1187 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1190 * elf32-nios2.c (nios2_elf32_check_relocs): Skip non-loaded,
1191 non-alloced sections.
1193 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1195 * elf32-frv.c (elf32_frv_relocate_section): Don't generate
1196 dynamic relocations for non SEC_ALLOC sections.
1198 2020-06-03 Gunther Nikl <gnikl@justmail.de>
1200 * aout64.c (BMAGIC, QMAGIC): Do not define.
1201 * aoutx.h (N_IS_BMAGIC, N_SET_QMAGIC): New defines.
1202 (NAME (aout, some_aout_object_p)): Use N_IS_QMAGIC and N_IS_BMAGIC
1203 to check the file format.
1204 (adjust_z_magic): Use N_SET_QMAGIC to set file format.
1205 * i386aout.c (NO_WRITE_HEADER_KLUDGE): Delete define.
1206 * libaout.h (NO_WRITE_HEADER_KLUDGE): Do not define.
1208 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1210 * elf32-arc.c (elf_arc_relocate_section): Don't generate dynamic
1211 relocations for non SEC_ALLOC sections.
1213 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1215 * elf-bfd.h (_bfd_elf_maybe_set_textrel): New
1216 * elf32-arm.c (maybe_set_textrel): Removed.
1217 (elf32_arm_size_dynamic_sections): Replace maybe_set_textrel
1218 with _bfd_elf_maybe_set_textrel.
1219 * elf32-csky.c (maybe_set_textrel): Removed.
1220 (csky_elf_size_dynamic_sections): Replace maybe_set_textrel
1221 with _bfd_elf_maybe_set_textrel.
1222 * elf32-hppa.c (maybe_set_textrel): Removed.
1223 (elf32_hppa_size_dynamic_sections): Replace maybe_set_textrel
1224 with _bfd_elf_maybe_set_textrel.
1225 * elf32-lm32.c (maybe_set_textrel): Removed.
1226 (lm32_elf_size_dynamic_sections): Replace maybe_set_textrel
1227 with _bfd_elf_maybe_set_textrel.
1228 * elf32-m32r.c (maybe_set_textrel): Removed.
1229 (m32r_elf_size_dynamic_sections): Replace maybe_set_textrel
1230 with _bfd_elf_maybe_set_textrel.
1231 * elf32-metag.c (maybe_set_textrel): Removed.
1232 (elf_metag_size_dynamic_sections): Replace maybe_set_textrel
1233 with _bfd_elf_maybe_set_textrel.
1234 * elf32-nds32.c (maybe_set_textrel): Removed.
1235 (nds32_elf_size_dynamic_sections): Replace maybe_set_textrel
1236 with _bfd_elf_maybe_set_textrel.
1237 * elf32-or1k.c (maybe_set_textrel): Removed.
1238 (or1k_elf_size_dynamic_sections): Replace maybe_set_textrel
1239 with _bfd_elf_maybe_set_textrel.
1240 * elf32-ppc.c (maybe_set_textrel): Removed.
1241 (ppc_elf_size_dynamic_sections): Replace maybe_set_textrel
1242 with _bfd_elf_maybe_set_textrel.
1243 * elf32-s390.c (maybe_set_textrel): Removed.
1244 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1245 with _bfd_elf_maybe_set_textrel.
1246 * elf32-sh.c (maybe_set_textrel): Removed.
1247 (sh_elf_size_dynamic_sections): Replace maybe_set_textrel
1248 with _bfd_elf_maybe_set_textrel.
1249 * elf32-tic6x.c (maybe_set_textrel): Removed.
1250 (elf32_tic6x_size_dynamic_sections): Replace maybe_set_textrel
1251 with _bfd_elf_maybe_set_textrel.
1252 * elf32-tilepro.c (maybe_set_textrel): Removed.
1253 (tilepro_elf_size_dynamic_sections): Replace maybe_set_textrel
1254 with _bfd_elf_maybe_set_textrel.
1255 * elf64-ppc.c (maybe_set_textrel): Removed.
1256 (ppc64_elf_size_dynamic_sections): Replace maybe_set_textrel
1257 with _bfd_elf_maybe_set_textrel.
1258 * elf64-s390.c (maybe_set_textrel): Removed.
1259 (elf_s390_size_dynamic_sections): Replace maybe_set_textrel
1260 with _bfd_elf_maybe_set_textrel.
1261 * elfnn-aarch64.c (maybe_set_textrel): Removed.
1262 (elfNN_aarch64_size_dynamic_sections): Replace maybe_set_textrel
1263 with _bfd_elf_maybe_set_textrel.
1264 * elfnn-riscv.c (maybe_set_textrel): Removed.
1265 (riscv_elf_size_dynamic_sections): Replace maybe_set_textrel
1266 with _bfd_elf_maybe_set_textrel.
1267 * elfxx-sparc.c (maybe_set_textrel): Removed.
1268 (_bfd_sparc_elf_size_dynamic_sections): Replace maybe_set_textrel
1269 with _bfd_elf_maybe_set_textrel.
1270 * elfxx-tilegx.c (maybe_set_textrel): Removed.
1271 (tilegx_elf_size_dynamic_sections): Replace maybe_set_textrel
1272 with _bfd_elf_maybe_set_textrel.
1273 * elfxx-x86.c (maybe_set_textrel): Removed.
1274 (_bfd_x86_elf_size_dynamic_sections): Replace maybe_set_textrel
1275 with _bfd_elf_maybe_set_textrel.
1276 * elflink.c (_bfd_elf_maybe_set_textrel): New.
1278 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1281 * elf32-arm.c (elf32_arm_copy_indirect_symbol): Don't copy
1283 * elf32-csky.c (csky_elf_copy_indirect_symbol): Likewise.
1284 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
1285 * elf32-metag.c (elf_metag_copy_indirect_symbol): Likewise.
1286 * elf32-microblaze.c (microblaze_elf_copy_indirect_symbol):
1288 * elf32-nds32.c (nds32_elf_copy_indirect_symbol): Likewise.
1289 * elf32-nios2.c (nios2_elf32_copy_indirect_symbol): Likewise.
1290 * elf32-or1k.c (or1k_elf_copy_indirect_symbol): Likewise.
1291 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1292 * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
1293 * elf32-tilepro.c (tilepro_elf_copy_indirect_symbol): Likewise.
1294 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
1295 * elfnn-aarch64.c (elfNN_aarch64_copy_indirect_symbol): Likewise.
1296 * elfnn-riscv.c (riscv_elf_copy_indirect_symbol): Likewise.
1297 * elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1298 * elfxx-tilegx.c (tilegx_elf_copy_indirect_symbol): Likewise.
1299 * elfxx-x86.c (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1300 * elf32-lm32.c (lm32_elf_copy_indirect_symbol): Removed.
1301 (elf_backend_copy_indirect_symbol): Likewise.
1302 * elf32-m32r.c (m32r_elf_copy_indirect_symbol): Removed.
1303 (elf_backend_copy_indirect_symbol): Likewise.
1304 * elflink.c (_bfd_elf_link_hash_copy_indirect): Copy dyn_relocs.
1306 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1309 * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
1310 * elf32-arm.c (readonly_dynrelocs): Removed.
1311 (maybe_set_textrel): Replace readonly_dynrelocs with
1312 _bfd_elf_readonly_dynrelocs.
1313 * elf32-csky.c (readonly_dynrelocs): Removed.
1314 (maybe_set_textrel): Replace readonly_dynrelocs with
1315 _bfd_elf_readonly_dynrelocs.
1316 * elf32-hppa.c(readonly_dynrelocs): Removed.
1317 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1318 _bfd_elf_readonly_dynrelocs.
1319 (maybe_set_textrel): Likewise.
1320 * elf32-lm32.c (readonly_dynrelocs): Removed.
1321 (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1322 with _bfd_elf_readonly_dynrelocs.
1323 (maybe_set_textrel): Likewise.
1324 * elf32-m32r.c (readonly_dynrelocs): Removed.
1325 (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1326 with _bfd_elf_readonly_dynrelocs.
1327 (maybe_set_textrel): Likewise.
1328 * elf32-metag.c (readonly_dynrelocs): Removed.
1329 (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
1330 with _bfd_elf_readonly_dynrelocs.
1331 (maybe_set_textrel): Likewise.
1332 * elf32-microblaze.c (readonly_dynrelocs): Removed.
1333 (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1334 with _bfd_elf_readonly_dynrelocs.
1335 * elf32-nds32.c (readonly_dynrelocs): Removed.
1336 (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1337 with _bfd_elf_readonly_dynrelocs.
1338 (maybe_set_textrel): Likewise.
1339 * elf32-or1k.c (readonly_dynrelocs): Removed.
1340 (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1341 with _bfd_elf_readonly_dynrelocs.
1342 * elf32-ppc.c (readonly_dynrelocs): Removed.
1343 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1344 _bfd_elf_readonly_dynrelocs.
1345 (ppc_elf_adjust_dynamic_symbol): Likewise.
1346 (maybe_set_textrel): Likewise.
1347 * elf32-s390.c (readonly_dynrelocs): Removed.
1348 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1349 with _bfd_elf_readonly_dynrelocs.
1350 (maybe_set_textrel): Likewise.
1351 * elf32-sh.c (readonly_dynrelocs): Removed.
1352 (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
1353 _bfd_elf_readonly_dynrelocs.
1354 (maybe_set_textrel): Likewise.
1355 * elf32-tic6x.c (readonly_dynrelocs): Removed.
1356 (maybe_set_textrel): Replace readonly_dynrelocs with
1357 _bfd_elf_readonly_dynrelocs.
1358 * elf32-tilepro.c (readonly_dynrelocs): Removed.
1359 (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1360 with _bfd_elf_readonly_dynrelocs.
1361 (maybe_set_textrel): Likewise.
1362 * elf64-ppc.c (readonly_dynrelocs): Removed.
1363 (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
1364 _bfd_elf_readonly_dynrelocs.
1365 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1366 (maybe_set_textrel): Likewise.
1367 * elf64-s390.c (readonly_dynrelocs): Removed.
1368 (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
1369 with _bfd_elf_readonly_dynrelocs.
1370 (maybe_set_textrel): Likewise.
1371 * elflink.c (_bfd_elf_readonly_dynrelocs): New.
1372 * elfnn-aarch64.c (readonly_dynrelocs): Removed.
1373 (maybe_set_textrel): Replace readonly_dynrelocs with
1374 _bfd_elf_readonly_dynrelocs.
1375 * elfnn-riscv.c (readonly_dynrelocs): Removed.
1376 (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1377 with _bfd_elf_readonly_dynrelocs.
1378 (maybe_set_textrel): Likewise.
1379 * elfxx-sparc.c (readonly_dynrelocs): Removed.
1380 (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
1381 readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
1382 (maybe_set_textrel): Likewise.
1383 * elfxx-tilegx.c (readonly_dynrelocs): Removed.
1384 (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
1385 with _bfd_elf_readonly_dynrelocs.
1386 (maybe_set_textrel): Likewise.
1387 * elfxx-x86.c (readonly_dynrelocs): Removed.
1388 (maybe_set_textrel): Replace readonly_dynrelocs with
1389 _bfd_elf_readonly_dynrelocs.
1390 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
1392 2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
1394 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
1395 -fsanitize=undefined.
1397 2020-06-03 Alan Modra <amodra@gmail.com>
1401 * peicode.h (pe_ILF_make_a_section): Align data for compilers
1403 (pe_ILF_build_a_bfd): Likewise.
1405 2020-06-03 Alan Modra <amodra@gmail.com>
1408 * elf.c (_bfd_elf_close_and_cleanup): Free elf_shstrtab for
1409 core files as well as objects.
1411 2020-06-01 H.J. Lu <hongjiu.lu@intel.com>
1414 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
1415 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
1417 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
1418 (elf_arc_link_hash_newfunc): Updated.
1419 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
1420 (elf32_arm_link_hash_newfunc): Updated.
1421 (elf32_arm_copy_indirect_symbol): Likewise.
1422 (elf32_arm_check_relocs): Likewise.
1423 (readonly_dynrelocs): Likewise.
1424 (allocate_dynrelocs_for_symbol): Likewise.
1425 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
1426 (csky_elf_link_hash_newfunc): Updated.
1427 (csky_allocate_dynrelocs): Likewise.
1428 (readonly_dynrelocs): Likewise.
1429 (csky_elf_copy_indirect_symbol): Likewise.
1430 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
1431 (hppa_link_hash_newfunc): Updated.
1432 (elf32_hppa_copy_indirect_symbol): Likewise.
1433 (elf32_hppa_hide_symbol): Likewise.
1434 (elf32_hppa_adjust_dynamic_symbol): Likewise.
1435 (allocate_dynrelocs): Likewise.
1436 (elf32_hppa_relocate_section): Likewise.
1437 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1438 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
1439 (lm32_elf_link_hash_newfunc): Likewise.
1440 (lm32_elf_link_hash_table_create): Updated.
1441 (readonly_dynrelocs): Likewise.
1442 (allocate_dynrelocs): Likewise.
1443 (lm32_elf_copy_indirect_symbol): Likewise.
1444 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
1445 (m32r_elf_link_hash_newfunc): Likewise.
1446 (m32r_elf_link_hash_table_create): Updated.
1447 (m32r_elf_copy_indirect_symbol): Likewise.
1448 (allocate_dynrelocs): Likewise.
1449 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
1450 (metag_link_hash_newfunc): Updated.
1451 (elf_metag_copy_indirect_symbol): Likewise.
1452 (readonly_dynrelocs): Likewise.
1453 (allocate_dynrelocs): Likewise.
1454 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
1456 (link_hash_newfunc): Updated.
1457 (microblaze_elf_check_relocs): Likewise.
1458 (microblaze_elf_copy_indirect_symbol): Likewise.
1459 (readonly_dynrelocs): Likewise.
1460 (allocate_dynrelocs): Likewise.
1461 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
1462 (nds32_elf_link_hash_newfunc): Updated.
1463 (nds32_elf_copy_indirect_symbol): Likewise.
1464 (readonly_dynrelocs): Likewise.
1465 (allocate_dynrelocs): Likewise.
1466 (nds32_elf_check_relocs): Likewise.
1467 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
1468 (link_hash_newfunc): Updated.
1469 (nios2_elf32_copy_indirect_symbol): Likewise.
1470 (nios2_elf32_check_relocs): Likewise.
1471 (allocate_dynrelocs): Likewise.
1472 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
1473 (or1k_elf_link_hash_newfunc): Updated.
1474 (readonly_dynrelocs): Likewise.
1475 (allocate_dynrelocs): Likewise.
1476 (or1k_elf_copy_indirect_symbol): Likewise.
1477 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
1478 (ppc_elf_link_hash_newfunc): Updated.
1479 (ppc_elf_copy_indirect_symbol): Likewise.
1480 (ppc_elf_check_relocs): Likewise.
1481 (readonly_dynrelocs): Likewise.
1482 (ppc_elf_adjust_dynamic_symbol): Likewise.
1483 (allocate_dynrelocs): Likewise.
1484 (ppc_elf_relocate_section): Likewise.
1485 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1486 (link_hash_newfunc): Updated.
1487 (elf_s390_copy_indirect_symbol): Likewise.
1488 (readonly_dynrelocs): Likewise.
1489 (elf_s390_adjust_dynamic_symbol): Likewise.
1490 (allocate_dynrelocs): Likewise.
1491 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
1492 (sh_elf_link_hash_newfunc): Updated.
1493 (readonly_dynrelocs): Likewise.
1494 (allocate_dynrelocs): Likewise.
1495 (sh_elf_copy_indirect_symbol): Likewise.
1496 (sh_elf_check_relocs): Likewise.
1497 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
1498 (elf32_tic6x_link_hash_newfunc): Likewise.
1499 (elf32_tic6x_link_hash_table_create): Updated.
1500 (readonly_dynrelocs): Likewise.
1501 (elf32_tic6x_check_relocs): Likewise.
1502 (elf32_tic6x_allocate_dynrelocs): Likewise.
1503 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
1505 (link_hash_newfunc): Updated.
1506 (tilepro_elf_copy_indirect_symbol): Likewise.
1507 (tilepro_elf_check_relocs): Likewise.
1508 (allocate_dynrelocs): Likewise.
1509 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
1510 (ppc64_elf_copy_indirect_symbol): Updated.
1511 (ppc64_elf_check_relocs): Likewise.
1512 (readonly_dynrelocs): Likewise.
1513 (ppc64_elf_adjust_dynamic_symbol): Likewise.
1514 (dec_dynrel_count): Likewise.
1515 (allocate_dynrelocs): Likewise.
1516 (ppc64_elf_relocate_section): Likewise.
1517 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
1518 (link_hash_newfunc): Updated.
1519 (elf_s390_copy_indirect_symbol): Likewise.
1520 (readonly_dynrelocs): Likewise.
1521 (allocate_dynrelocs): Likewise.
1522 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1523 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
1525 (elfNN_aarch64_link_hash_newfunc): Updated.
1526 (elfNN_aarch64_copy_indirect_symbol): Likewise.
1527 (readonly_dynrelocs): Likewise.
1528 (need_copy_relocation_p): Likewise.
1529 (elfNN_aarch64_allocate_dynrelocs): Likewise.
1530 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
1531 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
1532 (link_hash_newfunc): Updated.
1533 (riscv_elf_copy_indirect_symbol): Likewise.
1534 (riscv_elf_check_relocs): Likewise.
1535 (readonly_dynrelocs): Likewise.
1536 (allocate_dynrelocs): Likewise.
1537 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
1539 (link_hash_newfunc): Updated.
1540 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
1541 (_bfd_sparc_elf_check_relocs): Likewise.
1542 (readonly_dynrelocs): Likewise.
1543 (allocate_dynrelocs): Likewise.
1544 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
1545 (link_hash_newfunc): Updated.
1546 (tilegx_elf_copy_indirect_symbol): Likewise.
1547 (tilegx_elf_check_relocs): Likewise.
1548 (readonly_dynrelocs): Likewise.
1549 (allocate_dynrelocs): Likewise.
1550 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1551 (readonly_dynrelocs): Likewise.
1552 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
1553 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
1555 2020-06-01 Alan Modra <amodra@gmail.com>
1557 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
1558 command against cmd_length, not the end of record. For
1559 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
1560 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
1563 2020-05-28 David Faust <david.faust@oracle.com>
1565 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
1566 R_BPF_INSN_{32,64} relocations.
1568 2020-05-28 Stephen Casner <casner@acm.org>
1570 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
1571 addreses in .long (used in testsuites) and .stab values.
1573 2020-05-27 H.J. Lu <hongjiu.lu@intel.com>
1576 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
1577 Check bfd_link_dll when issue a DT_TEXTREL warning.
1578 * elfxx-x86.c (maybe_set_textrel): Likewise.
1579 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1581 2020-05-26 Nick Clifton <nickc@redhat.com>
1583 * plugin.c (try_load_plugin): Extend error message when a plugin
1586 2020-05-23 Alan Modra <amodra@gmail.com>
1588 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
1590 2020-05-22 Alan Modra <amodra@gmail.com>
1593 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
1594 attributes from shared libraries, and do not return an error if
1597 2020-05-21 Alan Modra <amodra@gmail.com>
1600 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
1602 (_bfd_delete_bfd): Free the copy.
1603 (_bfd_new_bfd): Free nbfd->memory on error.
1605 2020-05-21 Alan Modra <amodra@gmail.com>
1607 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
1608 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
1609 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
1610 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
1611 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1612 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
1613 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
1614 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
1615 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
1616 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
1617 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
1618 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
1619 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
1620 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
1621 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
1622 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
1623 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
1624 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
1625 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
1626 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
1628 2020-05-20 Nelson Chu <nelson.chu@sifive.com>
1630 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
1631 get_default_version. It is used to find the default version for
1632 the specific extension.
1633 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
1634 default_major_version and default_minor_version. Add new bfd_boolean
1635 parameter *use_default_version. Set it to TRUE if we need to call
1636 the callback rps->get_default_version to find the default version.
1637 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
1638 the default version in riscv_parsing_subset_version, and then call
1639 riscv_add_subset to add the subset into subset list.
1640 (riscv_parse_prefixed_ext): Likewise.
1641 (riscv_std_z_ext_strtab): Support Zicsr extensions.
1642 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
1643 strings rather than characters.
1644 riscv_merge_arch_attr_info): The callback function get_default_version
1645 is only needed for assembler, so set it to NULL int the linker.
1646 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
1647 * elfxx-riscv.h: Updated.
1649 2020-05-20 Alan Modra <amodra@gmail.com>
1652 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
1653 use bfd_set_filename.
1654 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
1655 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
1656 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
1657 (bfd_create): Likewise.
1658 (_bfd_delete_bfd): Don't free filename.
1659 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
1660 return pointer to the copy or NULL on alloc fail.
1661 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
1662 result of bfd_set_filename.
1663 * bfd-in2.h: Regenerate.
1665 2020-05-20 Alan Modra <amodra@gmail.com>
1668 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
1669 section size against file size.
1670 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
1672 2020-05-19 Gunther Nikl <gnikl@justmail.de>
1675 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
1676 and memset when allocating memory for the sections_being_created
1679 2020-05-19 Stafford Horne <shorne@gmail.com>
1681 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
1683 (or1k_elf_relocate_section): Access srelgot via
1684 htab->root.srelgot. Add assertions for srelgot->contents.
1685 Introduce local variable for srelgot to not reuse global
1687 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
1688 (or1k_set_got_and_rela_sizes): New function.
1689 (or1k_initial_exec_offset): New function.
1690 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
1691 (or1k_elf_relocate_section): Allow for TLS to handle multiple
1693 (or1k_elf_check_relocs): Use OR to set TLS access.
1694 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
1696 (or1k_elf_size_dynamic_sections): Use
1697 or1k_set_got_and_rela_sizes to set sizes.
1698 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
1699 (TCB_SIZE): New macro.
1700 (tpoff): Use TCB_SIZE and alignment to calculate offset.
1701 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
1702 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
1703 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
1704 (tpoff): Add dynamic boolean argument.
1705 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
1707 2020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
1709 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
1710 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
1711 cases with BFD_RELOC_AARCH64_JUMP26.
1712 (elfNN_aarch64_check_relocs): Likewise.
1714 2020-05-19 Alan Modra <amodra@gmail.com>
1716 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
1717 bfd_get_filename rather than accessing bfd->filename directly.
1718 * aout-target.h (MY (object_p)): Likewise.
1719 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1720 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
1721 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
1722 (_bfd_archive_bsd44_construct_extended_name_table),
1723 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
1724 (_bfd_bsd_write_armap): Likewise.
1725 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
1726 * cache.c (bfd_open_file): Likewise.
1727 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
1728 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
1729 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
1730 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
1731 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
1732 * elf32-nds32.c (nds32_elf_output_symbol_hook),
1733 (patch_tls_desc_to_ie): Likewise.
1734 * elf32-spu.c (sort_bfds, print_one_overlay_section),
1735 (spu_elf_auto_overlay): Likewise.
1736 * elf64-hppa.c (elf_hppa_final_link): Likewise.
1737 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
1738 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
1739 * elflink.c (bfd_elf_size_dynamic_sections),
1740 (elf_link_input_bfd): Likewise.
1741 * linker.c (_bfd_generic_link_output_symbols): Likewise.
1742 * mach-o.c (bfd_mach_o_follow_dsym),
1743 (bfd_mach_o_close_and_cleanup): Likewise.
1744 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
1745 (find_separate_debug_file, get_build_id_name): Likewise.
1746 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
1747 * plugin.c (bfd_plugin_open_input): Likewise.
1748 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
1749 * som.c (som_write_armap): Likewise.
1750 * srec.c (srec_write_record, srec_write_symbols): Likewise.
1751 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
1752 (_bfd_vms_lib_write_archive_contents): Likewise.
1753 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
1755 2020-05-19 Alan Modra <amodra@gmail.com>
1758 * bfdio.c (_bfd_real_fopen): Typo fix.
1760 2020-05-18 Nick Clifton <nickc@redhat.com>
1763 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
1764 for the sections_being_created array.
1766 2020-05-18 Alan Modra <amodra@gmail.com>
1768 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
1769 they can be freed without also freeing internal_relocs.
1771 2020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
1774 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
1775 separators into DOS style when creating a WIN32 fullpath.
1777 2020-05-14 Nelson Chu <nelson.chu@sifive.com>
1779 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
1780 to initialize RISC-V tdata.
1782 2020-05-12 Gunther Nikl <gnikl@justmail.de>
1784 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
1787 2020-05-11 Alan Modra <amodra@gmail.com>
1789 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
1791 2020-05-11 Alan Modra <amodra@gmail.com>
1793 * elf64-ppc.c: Rename powerxx to power10 throughout.
1795 2020-05-11 Alan Modra <amodra@gmail.com>
1798 * coffgen.c (coff_get_normalized_symtab): Check that buffer
1799 contains required number of auxents before processing any auxent.
1800 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
1801 file name from auxents for PE.
1803 2020-05-04 Gunther Nikl <gnikl@justmail.de>
1805 * aout-cris.c (DEFAULT_ARCH): Delete define.
1806 (MY_set_arch_mach): Likewise.
1807 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
1809 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
1810 of r_type before the shift.
1812 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
1815 * elfnn-aarch64.c (group_sections): Copy implementation from
1818 2020-05-01 Alan Modra <amodra@gmail.com>
1821 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
1822 accessing root.u.def of symbols. Also check root.u.def.section
1823 is non-NULL. Reverse tests so as to make the logic positive.
1825 2020-05-01 Alan Modra <amodra@gmail.com>
1828 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
1829 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
1831 2020-05-01 Alan Modra <amodra@gmail.com>
1834 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
1835 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1836 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1837 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
1838 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
1839 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
1840 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
1841 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
1842 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
1843 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
1845 2020-05-01 Alan Modra <amodra@gmail.com>
1848 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
1849 from shared libraries.
1851 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
1853 * elf32-xtensa.c (relax_section): Don't negate diff_value for
1854 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
1855 equals 0. Report overflow when the result has negative sign but
1856 all significant bits are zero.
1858 2020-04-29 Gunther Nikl <gnikl@justmail.de>
1860 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
1861 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
1863 2020-04-28 Alan Modra <amodra@gmail.com>
1865 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
1866 Emit warning message.
1868 2020-04-27 Tamar Christina <tamar.christina@arm.com>
1870 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
1871 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
1872 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
1873 to x86_64_pe_big_vec as it not a big-endian format.
1874 (vec i386_pe_big_vec): New.
1875 * configure.ac: Likewise.
1876 * targets.c: Likewise.
1877 * configure: Regenerate.
1878 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
1879 COFF_WITH_PE_BIGOBJ): New.
1880 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
1882 (x86_64_pe_be_vec): Moved.
1884 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
1886 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
1887 * elf.c (elfcore_grok_arc_v2): New function.
1888 (elfcore_grok_note): Call the new function to handle the corresponding
1890 (elfcore_write_arc_v2): New function.
1891 (elfcore_write_register_note): Call the new function to handle the
1892 corresponding pseudo-sections.
1894 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
1897 * bfd-in2.h: Regenerated.
1898 * elf32-xtensa.c (elf_howto_table): New entries for
1899 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
1900 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
1901 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
1902 R_XTENSA_NDIFF{8,16,32}.
1903 * libbfd.h (bfd_reloc_code_real_names): Add names for
1904 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
1905 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1906 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
1907 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
1909 2020-04-21 Tamar Christina <tamar.christina@arm.com>
1912 * compress.c (bfd_get_full_section_contents): Exclude sections with no
1915 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1918 * elf-bfd.h (elf_backend_data): Add
1919 elf_backend_strip_zero_sized_dynamic_sections.
1920 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
1921 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
1923 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
1925 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
1927 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
1929 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
1931 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
1933 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
1935 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
1937 2020-04-21 Nick Clifton <nickc@redhat.com>
1939 * po/sr.po: Updated Serbian translation.
1941 2020-04-21 Alan Modra <amodra@gmail.com>
1943 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
1946 2020-04-20 Stephen Casner <casner@acm.org>
1948 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
1949 causing globals from linker script to be treated as debug symbols.
1950 (translate_symbol_table): Don't sign-extend symbol values from 16
1951 to 64 bits in nm output.
1953 2020-04-20 Alan Modra <amodra@gmail.com>
1955 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
1957 2020-04-18 Alan Modra <amodra@gmail.com>
1959 * section.c (bfd_is_const_section): Correct test for special
1961 * bfd-in2.h: Regenerate.
1963 2020-04-17 Alan Modra <amodra@gmail.com>
1966 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
1969 2020-04-16 Nick Clifton <nickc@redhat.com>
1972 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
1973 abort with a more helpful error message.
1975 2020-04-16 Alan Modra <amodra@gmail.com>
1978 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
1981 2020-04-15 Fangrui Song <maskray@google.com>
1984 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
1985 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
1986 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
1987 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
1988 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1989 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1990 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1991 * elf32-sh.c (sh_elf_relocate_section): Likewise.
1992 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1993 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
1994 * elflink.c (elf_link_output_extsym): Likewise.
1995 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
1997 2020-04-15 Alan Modra <amodra@gmail.com>
2000 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
2001 pointer into strings that may be freed for section name, always
2002 allocate a new string.
2004 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2005 Jan W. Jagersma <jwjagersma@gmail.com>
2007 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
2008 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2009 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
2010 (_bfd_go32_mkobject): New functions.
2011 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
2012 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
2013 (go32exe_mkobject): Call _bfd_go32_mkobject.
2014 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
2015 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
2017 (coff_write_relocs): Enable extended reloc counter code if
2018 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
2019 (coff_write_object_contents): Likewise. Pad section headers
2020 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
2021 instead of coff_swap_scnhdr_out.
2022 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
2023 enable extended reloc counter.
2024 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
2025 Declare with ATTRIBUTE_UNUSED.
2026 * libcoff-in.h: (struct coff_tdata): New field go32.
2028 * libcoff.h: Regenerate.
2030 2020-04-14 Fangrui Song <maskray@google.com>
2033 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
2036 2020-04-14 Stephen Casner <casner@acm.org>
2039 * pdp11.c: Add implementation of --imagic option.
2040 (adjust_o_magic): Fix objcopy --extract-symbol test.
2041 * libaout.h (enum aout_magic): Add i_magic.
2043 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2044 Nick Clifton <nickc@redhat.com>
2046 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
2048 <default>: Error rather than abort.
2050 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
2053 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
2054 relocation section from section group.
2056 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
2058 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
2059 bfd->origin to file offset.
2060 * bfdwin.c (bfd_get_file_window): Likewise.
2061 * bfd.c: Clarify the use of the bfd->origin field.
2062 * bfd-in2.h: Regenerate.
2063 * coff-i386.c: Don't include go32exe.h. Allow overriding
2064 coff_write_object_contents via COFF_WRITE_CONTENTS.
2065 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
2066 (go32exe_write_object_contents): New functions.
2067 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
2068 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
2069 (create_go32_stub): Remove check for 2k size limit. Read stub
2070 from go32exe_temp_stub if present.
2071 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
2072 copy variable-length stub.
2073 (go32_check_format): Read stub to go32exe_temp_stub, set
2074 origin, return go32exe_cleanup.
2075 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
2076 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
2077 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
2078 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
2079 Remove functions and their associated #defines.
2080 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
2081 * libcoff-in.h: (struct coff_tdata): New field stub_size.
2082 Rename field go32stub to stub.
2083 * libcoff.h: Regenerate.
2084 * coff-stgo32.c (go32_check_format): Rename to...
2085 (go32exe_check_format): ...this.
2086 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
2087 (go32exe_copy_private_bfd_data): ...this.
2088 (stub_bytes): Rename to...
2089 (go32exe_default_stub): ...this.
2090 (create_go32_stub): Rename to...
2091 (go32exe_create_stub): ...this.
2092 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
2095 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
2099 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
2100 relocation to R_386_32 for relocation against non-preemptible
2102 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
2103 allocate dynamic relocation for non-preemptible absolute symbol.
2104 (elf_i386_relocate_section): Pass sec to
2105 GENERATE_DYNAMIC_RELOCATION_P.
2106 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
2107 (elf_x86_64_convert_load_reloc): Covert load relocation to
2108 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
2109 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
2110 for non-preemptible absolute symbol if they overflow.
2111 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
2112 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
2113 symbol. Don't allocate dynamic relocation for non-preemptible
2115 (elf_x86_64_relocate_section): Don't generate relative relocation
2116 for GOTPCREL relocations aganst local absolute symbol. Pass sec
2117 to GENERATE_DYNAMIC_RELOCATION_P.
2118 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
2119 against non-preemptible absolute symbol.
2120 (_bfd_elf_x86_valid_reloc_p): New function.
2121 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
2123 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
2124 argument. Don't generate dynamic relocation against
2125 non-preemptible absolute symbol.
2126 (ABS_SYMBOL_P): New.
2127 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
2128 against non-preemptible absolute symbol.
2130 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
2131 (_bfd_elf_x86_valid_reloc_p): New.
2133 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2136 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
2137 address in the GOT if in thumb only mode.
2139 2020-04-01 Tamar Christina <tamar.christina@arm.com>
2141 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
2143 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
2145 * mmo.c (mmo_scan): Create .text section only when needed, not
2148 2020-03-31 Alan Modra <amodra@gmail.com>
2150 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
2153 2020-03-31 Alan Modra <amodra@gmail.com>
2155 * vms-alpha.c (image_write): Check bounds for sections without
2156 contents too. Error on non-zero write to section without
2158 (_bfd_vms_slurp_etir): Check return of image_write* functions.
2160 2020-03-31 Alan Modra <amodra@gmail.com>
2162 * tekhex.c (pass_over): Check is_eof before reading buffer.
2164 2020-03-30 Nick Clifton <nickc@redhat.com>
2167 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
2168 field to timestamp and make it an integer.
2169 * libcoff.h: Regenerate.
2170 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
2171 field in the pe_data structure rather than the insert_timestamp
2174 2020-03-30 Alan Modra <amodra@gmail.com>
2177 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
2180 2020-03-26 Nick Clifton <nickc@redhat.com>
2182 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
2183 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
2185 * libbfd.h: Regenerate.
2187 2020-03-26 Alan Modra <amodra@gmail.com>
2189 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
2191 2020-03-26 Alan Modra <amodra@gmail.com>
2193 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
2195 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
2197 2020-03-25 Nick Clifton <nickc@redhat.com>
2199 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
2201 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
2202 * libbfd.h: Regenerate.
2204 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
2206 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
2207 correct field name in the output string.
2209 2020-03-25 Alan Modra <amodra@gmail.com>
2212 * elf.c (assign_file_positions_for_load_sections): Adjust offset
2213 for SHT_NOBITS section if first in segment.
2215 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2218 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
2219 (_bfd_elf_get_symbol_version_string): This.
2220 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
2221 (_bfd_elf_get_symbol_version_string): This.
2222 (bfd_elf_print_symbol): Pass TRUE to
2223 _bfd_elf_get_symbol_version_string.
2224 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
2225 bfd_boolean argument.
2226 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
2227 * targets.c (_bfd_get_symbol_version_string): Likewise.
2228 (bfd_get_symbol_version_string): Likewise.
2229 * bfd-in2.h: Regenerated.
2231 2020-03-24 Nick Clifton <nickc@redhat.com>
2232 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
2235 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
2238 2020-03-24 Nick Clifton <nickc@redhat.com>
2241 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
2242 segment to use for PT_GNU_RELRO, ignore empty sections in a
2243 segment's current list.
2245 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2248 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
2250 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
2253 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
2254 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
2255 on the previous _bfd_elf_get_symbol_version_string.
2256 (_bfd_elf_get_symbol_version_string): Use it.
2258 2020-03-24 Alan Modra <amodra@gmail.com>
2260 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
2261 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
2264 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
2266 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
2268 2020-03-23 Alan Modra <amodra@gmail.com>
2270 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
2271 symbol count. Allocate an extra byte to ensure name strings
2272 are terminated. Sanity check name offsets. Release memory on
2275 2020-03-23 Alan Modra <amodra@gmail.com>
2277 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
2278 field hasn't been read. Remove unnecessary casts.
2280 2020-03-22 Alan Modra <amodra@gmail.com>
2282 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
2283 enough to read number of symbols.
2285 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
2287 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
2288 (EXECUTABLE_SUFFIX): Likewise.
2289 * config.in: Regenerated.
2290 * configure: Likewise.
2291 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
2292 _bfd_generic_close_and_cleanup.
2293 (plugin_list_entry): Remove resolution_file, resolution_option,
2294 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
2295 lto_wrapper, gcc_env and initialized,
2296 (need_lto_wrapper_p): Removed.
2297 (get_lto_wrapper): Likewise.
2298 (setup_lto_wrapper_env): Likewise.
2299 (register_all_symbols_read): Likewise.
2300 (egister_cleanup): Likewise.
2301 (get_symbols): Likewise.
2302 (add_input_file): Likewise.
2303 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
2304 (add_symbols): Updated.
2305 (try_claim): Likewise.
2306 (try_load_plugin): Likewise.
2307 (bfd_plugin_canonicalize_symtab): Likewise.
2308 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
2309 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
2311 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
2314 * plugin.c (plugin_list_entry): Add has_symbol_type.
2315 (add_symbols_v2): New function.
2316 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
2317 provides symbol type.
2318 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
2319 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
2322 2020-03-20 Alan Modra <amodra@gmail.com>
2324 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
2325 enough to read number of symbols.
2327 2020-03-20 Alan Modra <amodra@gmail.com>
2329 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
2330 backend functions for NULL before calling.
2331 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
2332 (bfd_section_from_shdr, assign_section_numbers): Likewise.
2333 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
2334 * elfnn-ia64.c (ignore_errors): New function.
2335 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
2337 2020-03-19 Nick Clifton <nickc@redhat.com>
2340 * dwarf2.c (struct varinfo): Add unit_offset field to record the
2341 location of the varinfo in the unit's debug info data. Change the
2342 type of the stack field to a boolean.
2343 (lookup_var_by_offset): New function. Returns the varinfo
2344 structure for the variable described at the given offset in the
2346 (scan_unit_for_symbols): Add support for variables which have the
2347 DW_AT_specification attribute.
2349 2020-03-19 Nick Clifton <nickc@redhat.com>
2352 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
2355 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
2357 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
2359 2020-03-18 Nick Clifton <nickc@redhat.com>
2362 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
2363 memory access when processing a corrupt secondary reloc section.
2365 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
2367 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
2368 instead of calling abort.
2369 * elf32-csky.c (csky_build_one_stub): Likewise.
2370 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2371 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2372 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2373 * elf32-metag.c (metag_build_one_stub): Likewise.
2374 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2375 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2376 (ppc_size_one_stub): Likewise.
2377 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2379 2020-03-17 Nick Clifton <nickc@redhat.com>
2382 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
2383 with error messages.
2385 2020-03-17 Nick Clifton <nickc@redhat.com>
2388 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
2389 free. Add free on another failure path.
2391 2020-03-16 Alan Modra <amodra@gmail.com>
2394 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
2395 we have a non-zero section count. Do lma comparison in octets.
2397 2020-03-16 Alan Modra <amodra@gmail.com>
2399 * vms-alpha.c (dst_restore_location): Validate index into
2400 dst_ptr_offsets array before accessing. Return status.
2401 (dst_retrieve_location): Similarly, making "loc" parameter a
2402 pointer to return value.
2403 (_bfd_vms_slurp_etir): Update calls to above functions.
2405 2020-03-14 Kamil Rytarowski <n54@gmx.com>
2407 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
2409 * configure: Regenerated.
2411 2020-03-14 Alan Modra <amodra@gmail.com>
2413 * section.c (BFD_FAKE_SECTIONS): Formatting.
2414 * bfd-in2.h: Regenerate.
2416 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2418 * elf.c (elfcore_grok_netbsd_note): Add support for
2419 NT_NETBSDCORE_LWPSTATUS notes.
2421 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
2423 * bfd-in2.h: Regenerate.
2424 * section.c (asection): Add already_assigned field.
2425 (BFD_FAKE_SECTION): Add default initializer for it.
2426 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
2427 * elf32-arm.c (arm_build_one_stub): Add support for
2428 non_contiguous_regions.
2429 * elf32-csky.c (csky_build_one_stub): Likewise.
2430 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2431 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
2432 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
2433 * elf32-metag.c (metag_build_one_stub): Likewise.
2434 * elf32-nios2.c (nios2_build_one_stub): Likewise.
2435 * elf64-ppc.c (ppc_build_one_stub): Likewise.
2436 (ppc_size_one_stub): Likewise.
2437 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
2438 * elflink.c (elf_link_input_bfd): Likewise.
2440 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
2443 * elf-linker-x86.h (elf_linker_x86_params): Add
2444 static_before_all_inputs and has_dynamic_linker.
2445 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
2446 dynamic input objects if -static is passed at command-line
2447 before all input files without --dynamic-linker unless
2448 --no-dynamic-linker is used.
2450 2020-03-13 Kamil Rytarowski <n54@gmx.com>
2452 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
2454 2020-03-13 Christian Eggers <ceggers@gmx.de>
2456 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
2457 "p_paddr" from "at".
2458 * elfcode.h (bfd_from_remote_memory): Add units to several
2459 parameters. New local "opb". Fix usage of p_align. Fix
2460 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
2461 call of target_read_memory.
2462 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
2463 calculation of "offset" and "output_offset".
2464 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
2465 from "offset" and fix calculation of "end" from "vma+size". Fix
2466 comparison between "sh_addr" and "vma"/"output_offset".
2467 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
2468 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
2470 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
2471 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
2472 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
2473 assignment of p_paddr from phdr_lma. Fix comparison between
2474 "lma+size" and "next->lma".
2475 (elf_sort_segments): Fix assignment from p_paddr to lma.
2476 (assign_file_positions_for_load_sections): Add unit (bytes) to
2477 local "align". Fix calculation of local "off_adjust". Fix
2478 calculation of local "filehdr_vaddr".
2479 (assign_file_positions_for_non_load_sections): New local "opb".
2480 Fix calculation of "end" from "p_size". Fix comparison between
2481 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
2482 from "end" and "p_vaddr".
2483 (rewrite_elf_program_header): Fix comparison between p_vaddr and
2484 vma. Fix assignment to p_paddr from lma. Fix comparison between
2485 p_paddr and lma. Fix assignment to p_paddr from lma.
2486 * merge.c (sec_merge_emit): New local "opb". Convert
2487 "alignment_power" to octets.
2488 (_bfd_add_merge_section): New locals "alignment_power" and
2489 "opb". Fix comparison between "alignment_power" and
2491 (_bfd_merge_sections): New local "opb". Divide size by opb
2492 before checking align mask.
2494 2020-03-13 Christian Eggers <ceggers@gmx.de>
2496 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
2497 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
2499 (_bfd_elf_make_section_from_phdr): Similarly.
2500 (elf_fake_sections): Fix calculation of
2501 Elf_Internal_shdr::sh_addr from section VMA.
2502 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
2504 (assign_file_positions_for_load_sections): Fix calculations of
2505 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
2506 comparison between program header address and section LMA.
2507 (assign_file_positions_for_non_load_sections): Likewise.
2508 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
2509 (IS_CONTAINED_BY_VMA): Add parameter opb.
2510 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
2511 INCLUDE_SECTION_IN_SEGMENT): Likewise.
2512 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
2513 Fix calculations of p_addr_valid and p_vaddr_offset.
2514 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
2515 with octets per byte when comparing against p_vaddr.
2517 2020-03-11 Alan Modra <amodra@gmail.com>
2519 * som.c (setup_sections): Sanity check subspace.name.
2521 2020-03-11 Alan Modra <amodra@gmail.com>
2523 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
2525 2020-03-10 Alan Modra <amodra@gmail.com>
2528 * ihex.c (ihex_write_object_contents): Don't assume ordering of
2531 2020-03-09 Alan Modra <amodra@gmail.com>
2533 * wasm-module.c (wasm_scan): Sanity check file name length
2534 before allocating memory. Move common section setup code. Do
2535 without bfd_tell to calculate section size.
2537 2020-03-06 Nick Clifton <nickc@redhat.com>
2539 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
2540 with error messages and failure return values.
2542 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
2544 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
2545 relocation sections for any removed reference to a dynamic symbol.
2547 2020-03-05 Nick Clifton <nickc@redhat.com>
2549 * elf-bfd.h (struct elf_backend_data): Add new fields:
2550 init_secondary_reloc_section, slurp_secondary_reloc_section,
2551 write_secondary_reloc_section.
2552 (_bfd_elf_init_secondary_reloc_section): Prototype.
2553 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
2554 (_bfd_elf_write_secondary_reloc_section): Prototype.
2555 * elf.c ( bfd_section_from_shdr): Invoke the new
2556 init_secondary_reloc_section backend function, if defined, when a
2557 second reloc section is encountered.
2558 (swap_out_syms): Invoke the new symbol_section_index function, if
2559 defined, when computing the section index of an OS/PROC specific
2561 (_bfd_elf_init_secondary_reloc_section): New function.
2562 (_bfd_elf_slurp_secondary_reloc_section): New function.
2563 (_bfd_elf_write_secondary_reloc_section): New function.
2564 (_bfd_elf_copy_special_section_fields): New function.
2565 * elfcode.h (elf_write_relocs): Invoke the new
2566 write_secondary_relocs function, if defined, in order to emit
2568 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
2569 function, if defined, in order to read in secondary relocs.
2570 * elfxx-target.h (elf_backend_copy_special_section_fields):
2571 Provide a non-NULL default definition.
2572 (elf_backend_init_secondary_reloc_section): Likewise.
2573 (elf_backend_slurp_secondary_reloc_section): Likewise.
2574 (elf_backend_write_secondary_reloc_section): Likewise.
2575 (struct elf_backend_data elfNN_bed): Add initialisers for the new
2577 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
2578 * configure: Regenerate.
2580 2020-03-05 Alan Modra <amodra@gmail.com>
2582 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
2583 against file size before allocating memory. Use bfd_alloc rather
2584 than bfd_zalloc for carsym/strings memory.
2586 2020-03-04 Alan Modra <amodra@gmail.com>
2588 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
2589 sh_addr mod sh_addalign is zero.
2591 2020-03-04 Alan Modra <amodra@gmail.com>
2593 * format.c (bfd_check_format_matches): Call cleanup on error exit.
2595 2020-03-03 Alan Modra <amodra@gmail.com>
2597 * format.c (struct bfd_preserve): Add cleanup field.
2598 (bfd_preserve_save): Add cleanup param and save.
2599 (bfd_preserve_restore): Return cleanup.
2600 (bfd_preserve_finish): Call the cleanup for the discarded match.
2601 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
2602 and clear when preserving a match. Restore cleanup too when
2603 restoring that match.
2605 2020-03-02 Alan Modra <amodra@gmail.com>
2607 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
2608 * hpux-core.c (hpux_core_core_file_p): Update prototype.
2609 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
2610 (core_sco5_vec): Correct initialisers.
2612 2020-03-02 Alan Modra <amodra@gmail.com>
2614 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
2615 * aix5ppc-core.c (xcoff64_core_p): Likewise.
2616 * cisco-core.c (cisco_core_file_validate): Likewise.
2617 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
2618 * hpux-core.c (hpux_core_core_file_p): Likewise.
2619 * irix-core.c (irix_core_core_file_p): Likewise.
2620 * lynx-core.c (lynx_core_file_p): Likewise.
2621 * netbsd-core.c (netbsd_core_file_p): Likewise.
2622 * osf-core.c (osf_core_core_file_p): Likewise.
2623 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
2624 * sco5-core.c (sco5_core_file_p): Likewise.
2626 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
2628 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
2630 2020-03-02 Alan Modra <amodra@gmail.com>
2632 * targets.c (bfd_cleanup): New typedef.
2633 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
2634 * libbfd-in.h (_bfd_no_cleanup): Define.
2635 * format.c (bfd_reinit): Add cleanup parameter, call it.
2636 (bfd_check_format_matches): Set cleanup from _bfd_check_format
2637 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
2638 * aout-target.h (callback, object_p): Return bfd_cleanup.
2639 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
2640 * archive.c (bfd_generic_archive_p): Likewise.
2641 * binary.c (binary_object_p): Likewise.
2642 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
2643 * coff-ia64.c (ia64coff_object_p): Likewise.
2644 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
2645 * coff-sh.c (coff_small_object_p): Likewise.
2646 * coff-stgo32.c (go32_check_format): Likewise.
2647 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
2648 (xcoff64_core_p): Likewise.
2649 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
2650 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
2651 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
2652 * elfcode.h (elf_object_p): Likewise.
2653 * elfcore.h (elf_core_file_p): Likewise.
2654 * i386msdos.c (msdos_object_p): Likewise.
2655 * ihex.c (ihex_object_p): Likewise.
2656 * libaout.h (some_aout_object_p): Likewise.
2657 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
2658 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
2659 * libbfd.c (_bfd_dummy_target): Likewise.
2660 * libcoff-in.h (coff_object_p): Likewise.
2661 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
2662 (bfd_mach_o_arm64_core_p): Likewise.
2663 * mach-o-arm.c (bfd_mach_o_arm_object_p),
2664 (bfd_mach_o_arm_core_p): Likewise.
2665 * mach-o-i386.c (bfd_mach_o_i386_object_p),
2666 (bfd_mach_o_i386_core_p): Likewise.
2667 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
2668 (bfd_mach_o_x86_64_core_p): Likewise.
2669 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
2670 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
2671 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
2672 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
2673 * mmo.c (mmo_object_p): Likewise.
2674 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
2675 * peicode.h (coff_real_object_p, pe_ILF_object_p),
2676 (pe_bfd_object_p): Likewise.
2677 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
2678 * ppcboot.c (ppcboot_object_p): Likewise.
2679 * rs6000-core.c (rs6000coff_core_p): Likewise.
2680 * som.c (som_object_setup, som_object_p): Likewise.
2681 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
2682 * tekhex.c (tekhex_object_p): Likewise.
2683 * vms-alpha.c (alpha_vms_object_p): Likewise.
2684 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
2685 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
2686 * wasm-module.c (wasm_object_p): Likewise.
2687 * xsym.c (bfd_sym_object_p): Likewise.
2688 * xsym.h (bfd_sym_object_p): Likewise.
2689 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
2691 * pdp11.c (some_aout_object_p): Likewise.
2692 * plugin.c (register_ld_plugin_object_p): Update object_p
2694 * plugin.h (register_ld_plugin_object_p): Likewise.
2695 * bfd-in2.h: Regenerate.
2696 * libbfd.h: Regenerate.
2697 * libcoff.h: Regenerate.
2699 2020-03-02 Alan Modra <amodra@gmail.com>
2701 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
2702 applicable section flags.
2703 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
2704 (mips_ecoff_bele_vec): Likewise.
2705 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
2707 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2708 (_bfd_ecoff_styp_to_sec_flags): Likewise.
2710 2020-03-02 Alan Modra <amodra@gmail.com>
2712 * elf32-m32r.c (m32r_elf_section_flags): New function.
2713 (elf_backend_section_flags): Define.
2714 * elf32-nds32.c (nds32_elf_section_flags): New function.
2715 (elf_backend_section_flags): Define.
2716 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
2717 .sbss and .sdata sections.
2718 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
2719 for SHF_V850_GPREL sections.
2720 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
2722 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
2723 for SHF_PARISC_SHORT sections.
2724 * elf64-ppc.c (ppc64_elf_section_flags): New function.
2725 (elf_backend_section_flags): Define.
2726 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
2727 for SHF_MIPS_GPREL sections. Delete FIXME.
2729 2020-03-02 Alan Modra <amodra@gmail.com>
2731 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
2732 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
2733 calling elf_backend_section_flags with adjusted params. Use
2734 newsect->flags past that point.
2735 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
2737 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
2738 to have their type overridden, and all sh_flags but processor and
2740 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
2741 * elf32-mep.c (mep_elf_section_flags): Likewise.
2742 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
2743 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
2744 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
2745 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
2746 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
2747 stub BFD and non-aarch64 input files when scanning for stubs.
2749 2020-03-02 Alan Modra <amodra@gmail.com>
2751 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
2752 limit to decompressed element size.
2754 2020-03-02 Alan Modra <amodra@gmail.com>
2756 * vms-lib.c (vms_traverse_index): Add recur_count param and
2757 update calls. Fail on excessive recursion.
2759 2020-03-02 Alan Modra <amodra@gmail.com>
2761 * vms-alpha.c (vms_get_remaining_object_record): Use
2762 bfd_realloc_or_free rather than bfd_realloc.
2763 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
2764 (dst_define_location, parse_module): Likewise, and check realloc
2765 return status before using memory. Return status from function
2766 adjusting all callers.
2768 2020-02-28 Alan Modra <amodra@gmail.com>
2770 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
2772 2020-02-28 Alan Modra <amodra@gmail.com>
2774 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
2775 Remove duplicate undersize check.
2777 2020-02-27 Alan Modra <amodra@gmail.com>
2780 * mmo.c (mmo_scan): Set SEC_DATA for .data.
2782 2020-02-27 Alan Modra <amodra@gmail.com>
2785 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
2786 (coff_section_type): Adjust comment.
2787 (decode_section_type): Likewise. Call coff_section_type before
2788 decode_section_type.
2789 (bfd_decode_symclass): Use 'c' for common sections other than
2792 2020-02-27 Alan Modra <amodra@gmail.com>
2794 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
2797 2020-02-27 Alan Modra <amodra@gmail.com>
2799 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
2800 if file is an archive element.
2801 * bfd-in2.h: Regenerate.
2803 2020-02-26 Alan Modra <amodra@gmail.com>
2805 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
2806 bfd_set_error on failing test. Don't bother changing bfd_error on
2807 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
2808 Check sym name is within string buffer. Use size_t for some vars.
2809 (do_slurp_coff_armap): Use size_t for some variables, fix size of
2810 int_buf. Don't change bfd_error on file read error. Use
2811 _bfd_mul_overflow when calculating carsym buffer size. Reorder
2812 calculations to catch overflows before they occur. malloc and
2813 free raw armap rather than using bfd_alloc. Read raw armap before
2814 allocating carsym+strings buffer.
2815 (_bfd_slurp_extended_name_table): Localize variables. Check
2816 name size against file size.
2818 2020-02-26 Alan Modra <amodra@gmail.com>
2820 * vms-lib.c (vms_lib_read_index): Release correct buffer.
2822 2020-02-26 Alan Modra <amodra@gmail.com>
2824 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
2825 malloc. Check for NULL return from bfd_malloc.
2826 (rx_table_find, rx_table_map): Likewise.
2827 (rx_set_section_contents): Check bfd_alloc return.
2828 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
2830 2020-02-26 Alan Modra <amodra@gmail.com>
2832 * aoutx.h: Indent labels correctly. Format error strings.
2833 * archive.c: Likewise.
2834 * archive64.c: Likewise.
2835 * coff-arm.c: Likewise.
2836 * coff-rs6000.c: Likewise.
2837 * coff-stgo32.c: Likewise.
2838 * cpu-arm.c: Likewise.
2839 * dwarf2.c: Likewise.
2840 * elf-ifunc.c: Likewise.
2841 * elf-properties.c: Likewise.
2842 * elf-s390-common.c: Likewise.
2843 * elf-strtab.c: Likewise.
2845 * elf32-arm.c: Likewise.
2846 * elf32-bfin.c: Likewise.
2847 * elf32-cr16.c: Likewise.
2848 * elf32-csky.c: Likewise.
2849 * elf32-i386.c: Likewise.
2850 * elf32-m68k.c: Likewise.
2851 * elf32-msp430.c: Likewise.
2852 * elf32-nds32.c: Likewise.
2853 * elf32-nios2.c: Likewise.
2854 * elf32-pru.c: Likewise.
2855 * elf32-xtensa.c: Likewise.
2856 * elf64-ia64-vms.c: Likewise.
2857 * elf64-x86-64.c: Likewise.
2858 * elfcode.h: Likewise.
2859 * elfcore.h: Likewise.
2860 * elflink.c: Likewise.
2861 * elfnn-aarch64.c: Likewise.
2862 * elfnn-ia64.c: Likewise.
2863 * elfnn-riscv.c: Likewise.
2864 * elfxx-mips.c: Likewise.
2865 * elfxx-sparc.c: Likewise.
2866 * elfxx-x86.c: Likewise.
2867 * i386lynx.c: Likewise.
2868 * merge.c: Likewise.
2869 * pdp11.c: Likewise.
2870 * plugin.c: Likewise.
2871 * reloc.c: Likewise.
2873 2020-02-26 Alan Modra <amodra@gmail.com>
2876 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
2878 (bfd_elf_add_dt_needed_tag): Declare.
2879 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
2880 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
2881 from elf_add_dt_needed_tag. Remove soname and doit param.
2882 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
2883 to see whether as-needed lib is already loaded, use dyn_loaded
2884 list instead. When saving and restoring around as-needed lib
2885 handle possibility that dynstr has not been initialised. Don't
2886 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
2887 Mark libs loaded via DT_NEEDED entries of other libs with
2888 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
2890 (elf_link_check_versioned_symbol): Remove now unneccesary
2891 DYNAMIC check when traversing dyn_loaded list.
2893 2020-02-26 Alan Modra <amodra@gmail.com>
2895 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
2897 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
2900 * plugin.c (need_lto_wrapper_p): New.
2901 (bfd_plugin_set_program_name): Add an int argument to set
2903 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
2905 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
2907 2020-02-24 Alan Modra <amodra@gmail.com>
2909 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
2911 2020-02-24 Alan Modra <amodra@gmail.com>
2913 * vms-lib.c (struct carsym_mem): Add limit.
2914 (vms_add_index): Heed limit.
2915 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
2916 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
2917 Always return actual number read.
2918 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
2919 assertion with error exit.
2921 2020-02-22 Alan Modra <amodra@gmail.com>
2924 * elf.c (assign_file_positions_for_load_sections): Continue linking
2925 on "PHDR segment not covered by LOAD segment" errors.
2927 2020-02-21 Alan Modra <amodra@gmail.com>
2929 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
2931 (bfd_mach_o_canonicalize_reloc): Likewise.
2932 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
2933 counts and offsets against file size.
2934 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
2935 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
2936 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
2937 against file size. Delete symbol table error message.
2938 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
2940 (bfd_mach_o_read_symtab): Likewise.
2941 (bfd_mach_o_read_command): Pass file size.
2942 (bfd_mach_o_scan): Sanity check command count against file size.
2944 2020-02-21 Alan Modra <amodra@gmail.com>
2947 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
2948 "text", "data" and "bss" section pointer vars. Don't update
2949 section size, just exec header sizes.
2950 (adjust_sizes_and_vmas): Don't update text section size. Set
2951 initial exec header a_text. Print exec headers sizes.
2952 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
2953 (adjust_sizes_and_vmas): Similarly. Formatting.
2954 (final_link): Correct final file extension.
2956 2020-02-20 Nick Clifton <nickc@redhat.com>
2958 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
2960 * elfxx-target.h (elf_backend_symbol_section_index): Provide
2962 (elfNN_bed): Initialise the symbol_section_index field.
2963 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
2964 OS and PROC specific section indicies. Warn if converting other
2965 reserved incidies to SHN_ABS.
2967 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
2970 * cpu-z80.c: Add machine type compatibility checking.
2972 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
2975 * plugin.c (plugin_list_entry): Remove handle.
2976 (try_load_plugin): Call dlclose before return.
2978 2020-02-19 Alan Modra <amodra@gmail.com>
2980 * libbfd-in.h (_bfd_constant_p): Define.
2981 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
2982 file size before allocating memory.
2983 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
2984 * elf.c (bfd_elf_get_str_section): Likewise.
2985 (_bfd_elf_slurp_version_tables): Likewise.
2986 * libbfd.h: Regenerate.
2988 2020-02-19 Alan Modra <amodra@gmail.com>
2990 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
2991 * aoutx.h (aout_get_external_symbols): Replace calls to
2992 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
2993 (slurp_reloc_table): Likewise.
2994 * archive.c (do_slurp_bsd_armap): Likewise.
2995 (do_slurp_coff_armap): Likewise.
2996 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
2997 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
2998 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
2999 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
3000 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
3001 (_bfd_coff_get_external_symbols): Likewise.
3002 * ecoff.c (ecoff_slurp_symbolic_header),
3003 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
3004 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
3005 (ecoff_indirect_link_order): Likewise.
3006 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
3007 (_bfd_elf_slurp_version_tables): Likewise.
3008 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3009 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3010 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3011 * elf64-alpha.c (READ): Likewise.
3012 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
3013 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
3014 * elfcode.h (elf_slurp_symbol_table),
3015 (elf_slurp_reloc_table_from_section): Likewise.
3016 * elflink.c (elf_link_add_object_symbols),
3017 (elf_link_check_versioned_symbol): Likewise.
3018 * elfxx-mips.c (READ): Likewise.
3019 * i386lynx.c (slurp_reloc_table): Likewise.
3020 * lynx-core.c (lynx_core_file_p): Likewise.
3021 * mach-o.c (bfd_mach_o_canonicalize_relocs),
3022 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
3023 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
3024 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
3025 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
3026 (bfd_pef_parse_symbols): Likewise.
3027 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
3028 * som.c (setup_sections, som_slurp_string_table),
3029 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3030 (som_bfd_fill_in_ar_symbols): Likewise.
3031 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
3032 (evax_bfd_print_image): Likewise.
3033 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
3034 * wasm-module.c (wasm_scan): Likewise.
3035 * xcofflink.c (xcoff_link_add_symbols): Likewise.
3036 * xsym.c (bfd_sym_read_name_table),
3037 (bfd_sym_print_type_information_table_entry): Likewise.
3038 * libbfd.h: Regenerate.
3040 2020-02-19 Alan Modra <amodra@gmail.com>
3042 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
3043 reading external relocs.
3044 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
3045 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
3047 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
3049 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
3050 (m32c_elf_relax_section): Likewise.
3051 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
3052 (rl78_elf_relax_section): Likewise.
3053 * elf32-rx.c (rx_offset_for_reloc): Likewise.
3054 (elf32_rx_relax_section): Likewise.
3055 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
3056 parameter types and use..
3057 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
3058 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
3059 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
3060 being read from file, just the extra.
3061 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
3062 after reading external syms. Free on failure.
3064 2020-02-19 Alan Modra <amodra@gmail.com>
3066 * coffcode.h (buy_and_read, coff_slurp_line_table),
3067 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
3068 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
3069 corresponding bfd_alloc call. Adjust variables to suit.
3070 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
3071 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
3072 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
3073 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
3074 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
3075 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
3076 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
3077 * elf32-rx.c (elf32_rx_relax_section): Likewise.
3078 * elf64-alpha.c (READ): Likewise.
3079 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
3080 (elf_slurp_symbol_table, elf_slurp_reloc_table),
3081 (bfd_from_remote_memory): Likewise.
3082 * elfcore.h (core_find_build_id): Likewise.
3083 * elfxx-mips.c (READ): Likewise.
3084 * mach-o.c (bfd_mach_o_mangle_sections),
3085 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
3086 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
3087 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
3088 * som.c (setup_sections, som_prep_for_fixups)
3089 (som_build_and_write_symbol_table, som_slurp_symbol_table),
3090 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
3091 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
3092 (som_bfd_ar_write_symbol_stuff): Likewise.
3093 * vms-alpha.c (vector_grow1): Likewise.
3094 * vms-lib.c (vms_add_index): Likewise.
3095 * wasm-module.c (wasm_scan_name_function_section): Likewise.
3096 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
3097 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
3098 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
3099 (bfd_alloc2, bfd_zalloc2): Delete.
3100 (_bfd_mul_overflow): Define.
3101 * libbfd.h: Regenerate.
3103 2020-02-19 Alan Modra <amodra@gmail.com>
3105 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
3107 (assign_section_numbers): Likewise.
3108 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
3109 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
3110 bfd_malloc2, size_t amt, and unsigned tls_count.
3111 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
3112 * elflink.c (elf_create_symbuf): Use bfd_malloc.
3113 (elf_output_implib): Use bfd_alloc.
3115 2020-02-19 Alan Modra <amodra@gmail.com>
3117 * bfd.c (struct bfd): Move format and direction to other
3118 bitfields. Add "size".
3119 * bfdio.c (bfd_get_size): Cache size when not writing file.
3120 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
3121 returning zero, ie. unknown.
3122 (bfd_get_alt_debug_link_info): Likewise.
3123 * bfd-in2.h: Regenerate.
3125 2020-02-19 Alan Modra <amodra@gmail.com>
3127 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
3128 bfd_get_file_size twice.
3129 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
3130 zero, ie. unknown, return.
3131 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
3132 * elfcode.h (elf_swap_shdr_in): Likewise.
3133 (elf_object_p): Don't call bfd_get_file_size twice and correct
3136 2020-02-19 Alan Modra <amodra@gmail.com>
3138 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
3139 FALSE if memory alloc fails. Adjust calls.
3140 * som.c (som_prep_for_fixups): Likewise.
3141 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
3142 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
3143 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
3144 * som.c (som_build_and_write_symbol_table): Return via error_return
3146 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
3147 (VEC_APPEND_EL): Delete.
3148 (vector_grow1): Return pointer to element. Catch overflow.
3149 Return NULL on memory allocation failure.
3150 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
3151 (alpha_vms_add_fixup_ca): Likewise.
3152 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
3154 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
3156 2020-02-19 Alan Modra <amodra@gmail.com>
3158 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
3159 * aout-target.h (object_p): Likewise.
3160 * aout-tic30.c (tic30_aout_object_p): Likewise.
3161 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
3162 (emit_stringtab, write_syms, link_hash_table_create),
3163 (aout_link_write_other_symbol): Likewise.
3164 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
3165 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
3166 (_bfd_compute_and_write_armap): Likewise.
3167 * archures.c (bfd_arch_list): Likewise.
3168 * bfd.c (bfd_record_phdr): Likewise.
3169 * binary.c (binary_canonicalize_symtab): Likewise.
3170 * cisco-core.c (cisco_core_file_validate): Likewise.
3171 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
3172 (find_arm_glue, record_arm_to_thumb_glue),
3173 (record_thumb_to_arm_glue): Likewise.
3174 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
3175 (ppc_allocate_toc_section): Likewise.
3176 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
3177 * coff-sh.c (sh_relax_section): Likewise.
3178 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
3179 * coffcode.h (handle_COMDAT, coff_new_section_hook),
3180 (coff_set_alignment_hook, coff_mkobject),
3181 (coff_compute_section_file_positions): Likewise.
3182 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
3183 (coff_find_nearest_line_with_names),
3184 ( bfd_coff_set_symbol_class): Likewise.
3185 * cofflink.c (_bfd_coff_link_hash_table_create),
3186 (_bfd_coff_link_input_bfd): Likewise.
3187 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
3188 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
3189 (build_line_info_table, sort_line_sequences),
3190 (line_info_add_include_dir, line_info_add_file_name),
3191 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
3192 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
3193 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
3194 (_bfd_ecoff_find_nearest_line),
3195 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
3196 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
3197 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
3198 * elf-m10300.c (mn10300_elf_relax_section),
3199 (elf32_mn10300_link_hash_table_create): Likewise.
3200 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
3201 * elf.c (make_mapping, copy_elf_program_header): Likewise.
3202 * elf32-arm.c (elf32_arm_link_hash_table_create),
3203 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
3204 (elf32_arm_new_section_hook): Likewise.
3205 * elf32-avr.c (elf_avr_new_section_hook),
3206 (elf32_avr_link_hash_table_create, get_local_syms),
3207 (elf32_avr_setup_section_lists): Likewise.
3208 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
3209 (bfin_link_hash_table_create): Likewise.
3210 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
3211 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
3212 * elf32-csky.c (csky_elf_link_hash_table_create),
3213 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
3214 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
3215 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
3216 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
3217 * elf32-i386.c (elf_i386_check_relocs): Likewise.
3218 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
3219 * elf32-m32r.c (m32r_elf_link_hash_table_create),
3220 (m32r_elf_check_relocs): Likewise.
3221 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
3222 (elf32_m68hc11_setup_section_lists),
3223 (elf32_m68hc11_size_stubs): Likewise.
3224 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
3225 * elf32-metag.c (elf_metag_link_hash_table_create),
3226 (elf_metag_setup_section_lists): Likewise.
3227 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
3228 (microblaze_elf_check_relocs): Likewise.
3229 * elf32-nds32.c (nds32_elf_link_hash_table_create),
3230 (nds32_elf_check_relocs): Likewise.
3231 * elf32-nios2.c (nios2_elf32_setup_section_lists),
3232 (get_local_syms, nios2_elf32_check_relocs),
3233 (nios2_elf32_link_hash_table_create): Likewise.
3234 * elf32-or1k.c (or1k_elf_link_hash_table_create),
3235 (or1k_elf_check_relocs): Likewise.
3236 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
3237 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
3238 * elf32-s390.c (elf_s390_link_hash_table_create),
3239 (elf_s390_check_relocs): Likewise.
3240 * elf32-score.c (score_elf_create_got_section),
3241 (s3_elf32_score_new_section_hook),
3242 (elf32_score_link_hash_table_create): Likewise.
3243 * elf32-score7.c (score_elf_create_got_section),
3244 (s7_elf32_score_new_section_hook): Likewise.
3245 * elf32-sh.c (sh_elf_link_hash_table_create),
3246 (sh_elf_check_relocs): Likewise.
3247 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
3248 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
3249 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
3250 (tilepro_elf_check_relocs): Likewise.
3251 * elf32-v850.c (remember_hi16s_reloc): Likewise.
3252 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
3253 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
3254 (elf_xtensa_new_section_hook): Likewise.
3255 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
3256 (get_got_entry, elf64_alpha_check_relocs): Likewise.
3257 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
3258 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
3259 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
3260 * elf64-ppc.c (ppc64_elf_new_section_hook),
3261 (ppc64_elf_link_hash_table_create, update_local_sym_info),
3262 (update_plt_info, ppc64_elf_check_relocs): Likewise.
3263 * elf64-s390.c (elf_s390_link_hash_table_create),
3264 (elf_s390_check_relocs): Likewise.
3265 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
3266 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
3267 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
3268 (elf_link_add_archive_symbols, compute_bucket_count),
3269 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
3270 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
3271 (bfd_elf_final_link): Likewise.
3272 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
3273 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
3274 (elfNN_aarch64_new_section_hook): Likewise.
3275 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
3276 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
3277 (riscv_elf_check_relocs): Likewise.
3278 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
3279 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
3280 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
3281 (_bfd_mips_elf_link_hash_table_create): Likewise.
3282 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
3283 (_bfd_sparc_elf_check_relocs),
3284 (_bfd_sparc_elf_new_section_hook): Likewise.
3285 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
3286 (tilegx_elf_check_relocs): Likewise.
3287 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
3288 * format.c (bfd_check_format_matches): Likewise.
3289 * hash.c (_bfd_stringtab_init): Likewise.
3290 * ihex.c (ihex_scan): Likewise.
3291 * irix-core.c (irix_core_core_file_p): Likewise.
3292 * linker.c (bfd_wrapped_link_hash_lookup),
3293 (_bfd_generic_link_hash_table_create),
3294 (_bfd_generic_reloc_link_order): Likewise.
3295 * lynx-core.c (lynx_core_file_p): Likewise.
3296 * netbsd-core.c (netbsd_core_file_p): Likewise.
3297 * osf-core.c (osf_core_core_file_p): Likewise.
3298 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
3299 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
3300 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
3301 * peicode.h (pe_mkobject): Likewise.
3302 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
3303 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
3304 * sco5-core.c (read_uarea): Likewise.
3305 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
3306 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
3307 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
3308 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
3309 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
3310 * srec.c (srec_scan): Likewise.
3311 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
3312 * targets.c (bfd_target_list): Likewise.
3313 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
3314 * trad-core.c (trad_unix_core_file_p): Likewise.
3315 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
3316 (vms_new_section_hook): Likewise.
3317 * wasm-module.c (wasm_make_empty_symbol): Likewise.
3318 * xcofflink.c (xcoff_get_section_contents),
3319 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
3320 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
3321 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
3323 2020-02-19 Alan Modra <amodra@gmail.com>
3325 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
3327 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
3329 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
3330 and use it if it isn't NULL. Remove has_plugin_p argument. Add
3331 a build_list_p argument. Don't search plugin_list. Short circuit
3332 when building the plugin list.
3333 (has_plugin): Renamed to has_plugin_list.
3334 (bfd_plugin_set_plugin): Don't set has_plugin.
3335 (bfd_plugin_specified_p): Check plugin_list instead.
3336 (build_plugin_list): New function.
3337 (load_plugin): Call build_plugin_list and use plugin_list.
3339 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3342 * plugin.c (try_claim): Always clean up for LTO wrapper.
3343 (try_load_plugin): Treat each object as independent. Create a
3344 copy for plugin name.
3346 2020-02-11 Nick Clifton <nickc@redhat.com>
3348 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
3349 for addresses in print statements.
3350 (msp430_elf_relax_delete_bytes): Likewise.
3351 (msp430_elf_relax_add_words): Likewise.
3352 (msp430_elf_relax_section): Likewise.
3354 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
3356 * plugin.c (add_symbols): Clear plugin_data memory.
3358 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
3361 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
3362 (EXECUTABLE_SUFFIX): Likewise.
3363 * config.in: Regenerated.
3364 * configure: Likewise.
3365 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
3366 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
3367 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
3368 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
3369 (get_lto_wrapper): New.
3370 (setup_lto_wrapper_env): Likewise.
3371 (current_plugin): Likewise.
3372 (register_all_symbols_read): Likewise.
3373 (register_cleanup): Likewise.
3374 (get_symbols): Likewise.
3375 (add_input_file): Likewise.
3376 (bfd_plugin_close_and_cleanup): Likewise.
3377 (claim_file): Removed.
3378 (register_claim_file): Set current_plugin->claim_file.
3379 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
3380 lto_syms in current_plugin.
3381 (try_claim): Use current_plugin->claim_file. Call LTO plugin
3382 all_symbols_read handler. Copy real symbols to plugin_data.
3383 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
3384 (try_load_plugin): Don't reuse the previous plugin for LTO
3385 wrapper. Set up GCC LTO wrapper if possible. Don't set
3386 plugin_list_iter->claim_file.
3387 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
3389 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
3392 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3394 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
3395 check if previous instruction matches a conditional jump inserted
3396 earlier. Invert conditional jump and delete branch in this case.
3398 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3400 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
3401 msp430_elf_relax_add_words. Support insertion of either one or two
3403 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
3404 needs to be grown. Handle insertion of branch instruction to replace
3407 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
3409 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
3410 debugging relocations.
3411 (msp430_elf_relax_delete_bytes): Likewise.
3412 (msp430_elf_relax_add_two_words): Likewise.
3413 (msp430_elf_relax_section): Likewise.
3415 2020-02-10 Alan Modra <amodra@gmail.com>
3417 * archures.c: Wrap overlong z80 comments.
3418 * bfd-in2.h: Regenerate.
3420 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
3423 * archures.c: Add GBZ80 and Z80N machine values.
3424 * reloc.c: Add BFD_RELOC_Z80_16_BE.
3425 * coff-z80.c: Add support for new reloc.
3426 * coffcode.h: Add support for new machine values.
3427 * cpu-z80.c: Add support for new machine names.
3428 * elf32-z80.c: Add support for new reloc.
3429 * bfd-in2.h: Regenerate.
3430 * libbfd.h: Regenerate.
3432 2020-02-07 Nick Clifton <nickc@redhat.com>
3435 * elf.c (rewrite_elf_program_header): Do not complain if no
3436 sections are mapped to a segment.
3438 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3441 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
3442 for garbage collection on __patchable_function_entries section
3443 without linked-to section.
3445 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
3448 * bfd-in2.h: Regenerated.
3449 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
3450 on section if gc_mark of any of its linked-to sections is set
3451 and don't set gc_mark again.
3452 * section.c (asection): Add linked_to_symbol_name to map_head
3455 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
3457 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
3458 reporting an unrecognized instruction with R_V850_LONGJUMP.
3460 2020-02-05 Alan Modra <amodra@gmail.com>
3462 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
3464 2020-02-04 Alan Modra <amodra@gmail.com>
3466 * elf32-ppc.c (ppc_elf_relocate_section): After applying
3467 R_PPC_VLE_ADDR20, goto copy_reloc.
3469 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3471 * bfd-in2.h: Regenerated.
3472 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
3474 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
3477 * bfd-in2.h: Regenerated.
3478 * ecoff.c (bfd_debug_section): Add section_id.
3479 * section.c (bfd_section): Add section_id.
3480 (SEC_ASSEMBLER_SECTION_ID): New.
3481 (BFD_FAKE_SECTION): Add section_id.
3483 2020-02-01 Nick Clifton <nickc@redhat.com>
3485 * config.bfd: Move the c30-aout and tic30-aout targets onto the
3488 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
3490 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
3491 encodings are relative to the GOT on nios2, too.
3493 2020-01-31 Alan Modra <amodra@gmail.com>
3495 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
3496 file. Use $< and $@ in rules.
3497 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
3498 (elf32-ia64.c, elf64-ia64.c): Likewise.
3499 (elf32-riscv.c, elf64-riscv.c): Likewise.
3500 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3501 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
3502 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
3503 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
3504 (peigen.c, pepigen.c, pex64igen.c): Likewise.
3505 * Makefile.in: Regenerate.
3507 2020-01-31 Alan Modra <amodra@gmail.com>
3510 * elf.c (setup_group): Don't clear entire section contents,
3511 just the padding after group flags. Release alloc'd memory
3512 after a seek or read failure.
3514 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3516 * peXXigen.c (pe_is_repro): New function.
3517 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
3518 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
3520 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3522 * peXXigen.c (debug_type_names): Add names for new debug data type
3525 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
3527 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
3528 inner loop. Fix a memory leak.
3530 2020-01-30 Alan Modra <amodra@gmail.com>
3532 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
3533 or obj_coff_keep_strings here.
3534 (coff_get_normalized_symtab): Free external syms directly.
3535 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
3538 2020-01-27 Jim Wilson <jimw@sifive.com>
3540 * cpu-riscv.c (riscv_scan): New.
3541 (N): Change bfd_default_scan to riscv_scan.
3543 2020-01-27 Andreas Schwab <schwab@suse.de>
3545 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
3546 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
3547 * Makefile.in: Regenerate.
3548 * cpu-plugin.c: Remove.
3549 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
3550 (bfd_plugin_arch): Remove declaration.
3551 * bfd-in2.h: Regenerate.
3552 * po/SRC-POTFILES.in: Regenerate.
3554 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
3555 Alan Modra <amodra@gmail.com>
3558 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
3560 2020-01-24 Jim Wilson <jimw@sifive.com>
3562 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
3563 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
3564 avoid over long line.
3566 2020-01-24 Nick Clifton <nickc@redhat.com>
3569 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
3570 syms and keep strings flags as these may have been set in order to
3571 prevent a bogus call to free.
3573 2020-01-23 Nick Clifton <nickc@redhat.com>
3575 * po/fr.po: Updated French translation.
3577 2020-01-23 Alan Modra <amodra@gmail.com>
3580 * elf.c (assign_file_positions_for_load_sections): Avoid divide
3581 by zero when p_align is zero.
3583 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
3585 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
3586 (riscv_prefix_cmp): Likewise.
3587 (riscv_non_std_ext_p): Deleted.
3588 (riscv_std_sv_ext_p): Likewise.
3589 (riscv_non_std_sv_ext_p): Likewise.
3590 (riscv_merge_non_std_and_sv_ext): Rename to...
3591 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
3592 (riscv_merge_arch_attr_info): Replace 3 calls to
3593 riscv_merge_non_std_and_sv_ext with single call to
3594 riscv_merge_multi_letter_ext.
3595 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
3596 encounter a 'z' prefix.
3597 (riscv_get_prefix_class): New function, return prefix class based
3598 on first few characters of input string.
3599 (riscv_parse_config): New structure to factor out minor differences
3600 in extension class parsing behaviour.
3601 (riscv_parse_sv_or_non_std_ext): Rename to...
3602 (riscv_parse_prefixed_ext): and parameterise with
3604 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
3605 (riscv_multi_letter_ext_valid_p): New.
3606 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
3607 (riscv_parse_subset): Delegate all non-single-letter parsing work
3608 to riscv_parse_prefixed_ext.
3609 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
3610 (riscv_get_prefix_class): Declare.
3612 2020-01-22 Alan Modra <amodra@gmail.com>
3614 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
3615 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
3616 __tls_get_addr_desc.
3617 (ppc64_elf_size_stubs): Add section for linker generated
3618 __tls_get_addr_desc wrapper function. Loop at least once if
3619 generating this function.
3620 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
3621 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
3623 2020-01-22 Alan Modra <amodra@gmail.com>
3625 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
3626 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
3628 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
3629 (STDU_R1_0R1, ADDI_R1_R1): Define.
3630 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
3631 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
3632 tga_desc_fd to opt_fd, and tga_desc to opt. Set
3633 no_tls_get_addr_regsave.
3634 (branch_reloc_hash_match): Add hash3 and hash4.
3635 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
3636 (ppc64_elf_size_dynamic_sections): Likewise.
3637 (ppc64_elf_relocate_section): Likewise.
3638 (plt_stub_size, build_plt_stub): Likewise. Size regsave
3639 __tls_get_addr stub.
3640 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
3642 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
3643 eh_frame for regsave __tls_get_addr.
3645 2020-01-22 Alan Modra <amodra@gmail.com>
3647 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
3648 which __tls_get_addr calls will be eliminated.
3650 2020-01-20 Nick Clifton <nickc@redhat.com>
3652 * po/pt.po: Updates Portuguese translation.
3653 * po/ru.po: Updated Russian translation.
3654 * po/uk.po: Updated Ukranian translation.
3656 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
3659 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
3660 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
3662 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
3663 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
3664 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
3665 "rex leal x@tlsdesc(%rip), %reg" to
3666 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
3667 "call *(%eax)" to "nopl (%rax)".
3669 2020-01-20 Alan Modra <amodra@gmail.com>
3671 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
3672 (MTLR_R11): Don't define.
3673 (LD_R0_0R3, CMPDI_R0_0): Define.
3674 (build_tls_get_addr_stub): Don't use r11 in stub.
3676 2020-01-20 Alan Modra <amodra@gmail.com>
3678 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
3679 (defined_sym_val, is_tls_get_addr): Likewise.
3681 2020-01-18 Nick Clifton <nickc@redhat.com>
3683 * version.m4 (BFD_VERSION): Set to 2.34.50.
3684 * configure: Regenerate.
3685 * po/bfd.pot: Regenerate.
3687 2020-01-18 Nick Clifton <nickc@redhat.com>
3689 Binutils 2.34 branch created.
3691 2020-01-17 Christian Biesinger <cbiesinger@google.com>
3693 * coff-arm.c: Fix spelling error (seperate).
3694 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
3696 * sysdep.h (strnlen): Fix spelling error (seperate).
3698 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
3701 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
3703 2020-01-15 Alan Modra <amodra@gmail.com>
3706 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
3707 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
3708 of function symbols unless dot symbols are present. Do warn
3709 whenever one is created, regardles of whether a PLT entry is
3710 also emitted for the function symbol.
3712 2020-01-14 Alan Modra <amodra@gmail.com>
3714 * som.c (som_bfd_count_ar_symbols): Error when file position
3715 of symbols on chains is not strictly increasing.
3717 2020-01-14 Alan Modra <amodra@gmail.com>
3719 * vms.h (VMS_DEBUG): Define as 0.
3720 * vms-alpha.c (image_write): Move debug output after bounds check.
3722 (_bfd_vms_slurp_eihd): Warning fix.
3723 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
3725 2020-01-13 Alan Modra <amodra@gmail.com>
3727 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
3728 for "ignored" records.
3730 2020-01-13 Alan Modra <amodra@gmail.com>
3732 * wasm-module.c (wasm_scan_name_function_section): Formatting.
3733 Delete asect name check. Move asect NULL check to wasm_object_p.
3734 Correct bounds check of sizes against end. Replace uses of
3735 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
3736 just one bfd_release.
3737 (wasm_scan): Don't use malloc/strdup for section names,
3738 bfd_alloc instead. Simplify code prefixing section name.
3739 Formatting. Don't attempt to free memory here..
3740 (wasm_object_p): ..do so here.
3742 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
3745 * elf32-arm.c (elf32_arm_final_link_relocate): Use
3746 UNDEFWEAK_NO_DYNAMIC_RELOC.
3747 (allocate_dynrelocs_for_symbol): Likewise.
3749 2020-01-10 Tamar Christina <tamar.christina@arm.com>
3752 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
3754 2020-01-10 Alan Modra <amodra@gmail.com>
3756 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
3758 2020-01-09 Nick Clifton <nickc@redhat.com>
3761 * bfd.c (bfd_convert_section_contents): Check for a compress
3762 header size that is larger than the actual section size.
3764 2020-01-08 Alan Modra <amodra@gmail.com>
3767 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
3768 after removing sections.
3770 2020-01-06 Jim Wilson <jimw@sifive.com>
3773 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
3774 check for !bfd_link_pic (info).
3775 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
3776 <R_RISCV_JAL>: Add comment.
3777 (_bfd_riscv_relax_section): For plt.offset check, add check for
3778 bfd_link_pic (info). Add comment.
3780 2020-01-06 Alan Modra <amodra@gmail.com>
3782 * format.c (bfd_check_format_matches): Ignore bfd_error on target
3783 match failures. Don't init to bfd_error_wrong_format before
3784 calling _bfd_check_format.
3786 2020-01-06 Alan Modra <amodra@gmail.com>
3788 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
3789 status rather than exiting on stack overflow or underflow.
3790 (_bfd_vms_slurp_etir): Adjust to suit.
3792 2020-01-06 Alan Modra <amodra@gmail.com>
3794 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
3796 2020-01-06 Alan Modra <amodra@gmail.com>
3798 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
3799 command. Check name offset is within command.
3800 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
3801 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
3802 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
3803 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
3804 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
3805 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
3806 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
3807 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
3808 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
3809 (bfd_mach_o_read_segment): Similarly.
3810 (bfd_mach_o_read_thread): Properly bound check thread struct.
3811 Don't repeat checks on second loop.
3812 (bfd_mach_o_read_command): Fail on invalid command length.
3814 2020-01-04 Alan Modra <amodra@gmail.com>
3816 * format.c (bfd_check_format_matches): Add preserve_match.
3817 Save initial bfd state in "preserve", matched bfd state in
3818 "preserve_match". Save just the first match. Release
3819 bfd_alloc memory. Restore and finish preserved state as
3820 appropriate on all function exit paths.
3822 2020-01-04 Alan Modra <amodra@gmail.com>
3824 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
3826 2020-01-04 Alan Modra <amodra@gmail.com>
3828 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
3831 2020-01-03 Nick Clifton <nickc@redhat.com>
3834 (bfd_pef_parse_function_stubs): Correct the test that ensures that
3835 there is enough data remaining in the code buffer before
3836 attempting to read a function stub.
3838 2020-01-03 Nick Clifton <nickc@redhat.com>
3841 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
3842 return value from bfd_malloc.
3843 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
3844 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
3845 (elf32_arm_filter_cmse_symbols): Likewise.
3846 (elf32_arm_write_section): Likewise.
3847 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
3848 (bfd_mach_o_follow_dsym): Likewise.
3849 * pef.c (bfd_pef_print_loader_section): Likewise.
3850 (bfd_pef_scan_start_address): Likewise.
3851 (bfd_pef_parse_function_stubs): Likewise.
3852 (bfd_pef_parse_symbols): Likewise.
3854 2020-01-03 Sergei Trofimovich <siarheit@google.com>
3856 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
3857 on binary inputs ld/PR25316.
3858 (is_ia64_elf): new helper to filter on ia64 objects.
3860 2020-01-03 Jan Beulich <jbeulich@suse.com>
3862 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
3864 (bfd_mach_o_scan): Insert underscore in two variable names.
3866 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
3868 * Makefile.am: Add z80-elf target support.
3869 * configure.ac: Likewise.
3870 * targets.c: Likewise.
3871 * Makefile.in: Regenerate.
3872 * configure: Regenerate.
3873 * config.bfd: Add z80-elf target support and new arches: ez80 and
3875 * elf32-z80.c: New file.
3876 * archures.c: Add new z80 architectures: eZ80 and Z180.
3877 * coffcode.h: Likewise.
3878 * cpu-z80.c: Likewise.
3879 * coff-z80.c: Add new relocations for Z80 target and local label
3881 * reloc.c: Add new relocs.
3882 * bfd-in2.h: Regenerate.
3883 * libbfd.h: Regenerate.
3885 2020-01-02 Tamar Christina <tamar.christina@arm.com>
3889 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
3891 2020-01-01 Alan Modra <amodra@gmail.com>
3893 Update year range in copyright notice of all files.
3895 For older changes see ChangeLog-2019
3897 Copyright (C) 2020 Free Software Foundation, Inc.
3899 Copying and distribution of this file, with or without modification,
3900 are permitted in any medium without royalty provided the copyright
3901 notice and this notice are preserved.
3907 version-control: never