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