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