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