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