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