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