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