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