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