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