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