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