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