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