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