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