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