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