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