aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2020-07-07Use is_pecoff_format in ld testsuiteAlan Modra8-25/+32
--image-base 0 is not just for x86_64 mingw. This patch fixes that, and a case where a changed LDFLAGS leaked out of one script to the next. * testsuite/ld-scripts/align.exp: Use is_pecoff_format. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/provide.exp: Likewise. * testsuite/ld-scripts/weak.exp: Likewise. * testsuite/ld-scripts/empty-address.exp: Likewise. Reset LDFLAGS on exit. * testsuite/ld-scripts/expr.exp: Set LDFLAGS earlier, and with --image-base for PE. * testsuite/ld-scripts/include.exp: Set LDFLAGS for PE. * testsuite/ld-scripts/script.exp: Use is_pecoff_format, and set LDFLAGS as well as flags.
2020-07-07Use is_xcoff_format in ld testsuiteAlan Modra10-116/+50
* testsuite/ld-checks/checks.exp: Use is_xcoff_format. * testsuite/ld-powerpc/powerpc.exp: Likewise. * testsuite/ld-scripts/print-memory-usage.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-undefined/require-defined.exp: Likewise. * testsuite/ld-scripts/expr2.d: Likewise. * testsuite/ld-scripts/section-match-1.d: Only run for ELF. * testsuite/ld-elfvers/vers.exp: Delete dead code. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise.
2020-07-07sh vxworks testsAlan Modra2-2/+2
These tests were failing only due to not being updated for readelf output changes. * testsuite/ld-sh/vxworks1-lib.rd: Update expected output. * testsuite/ld-sh/vxworks4.d: Likewise.
2020-07-03Re: Change readelf's display of symbol namesAlan Modra8-60/+60
Fixes some fallout from git commit 0942c7ab94e5. PR 26028 gas/ * testsuite/gas/ia64/unwind-ilp32.d: Add -T to readelf options. gold/ * testsuite/Makefile.am (file_in_many_sections.stdout): Add -W to readelf options. * testsuite/Makefile.in: Regenerate. ld/ * testsuite/ld-arm/arm-elf.exp (vxworks1): Pass --wide to readelf when dumping relocs. * testsuite/ld-i386/i386.exp (vxworks1): Likewise. * testsuite/ld-sh/sh-vxworks.exp (vxworks1): Likewise. * testsuite/ld-sparc/sparc.exp (vxworks1): Likewise. * testsuite/ld-arm/vxworks1.rd: Adjust to suit. * testsuite/ld-i386/vxworks1.rd: Adjust. * testsuite/ld-sh/vxworks1.rd: Adjust. * testsuite/ld-sparc/vxworks1.rd: Adjust.
2020-07-02Change readelf's display of symbol names (when not in --wide mode) so that ↵Nick Clifton7-12/+12
if they are going to be truncated then "[...]" is displayed at the end. Add a comment line option to disable this enhancement and restore the old behaviour. PR 26028 binutils* readelf.c (print_symbol): Handle truncation of symbol names. (options): Add -T/--silent-truncation option. (parse_args): Handle the option. (print_dynamic_symbol): Correct calculation of width available to display symbol name. * doc/binutils.texi: Document the -T option to readelf. * NEWS: Mention the new feature. gas * testsuite/gas/ia64/group-2.d: Add -T option to readelf command line. * testsuite/gas/ia64/unwind.d: Likewise. * testsuite/gas/mmix/bspec-1.d: Likewise. * testsuite/gas/mmix/bspec-2.d: Likewise. * testsuite/gas/mmix/comment-1.d: Likewise. * testsuite/gas/tic6x/scomm-directive-4.d: Likewise. ld * testsuite/ld-powerpc/powerpc.exp: Add -T option to readelf command line when running some tests. * testsuite/ld-arm/arm-elf.exp: Likewise. * testsuite/ld-mips-elf/mips-elf.exp: Likewise. * testsuite/ld-mmix/local1.d: Likewise. * testsuite/ld-mmix/local3.d: Likewise. * testsuite/ld-mmix/local5.d: Likewise. * testsuite/ld-mmix/local7.d: Likewise. * testsuite/ld-powerpc/powerpc.exp: Likewise.
2020-06-30Remove x86 NaCl target supportH.J. Lu172-3470/+52
NaCl has been deprecated: https://developer.chrome.com/native-client/migration and NaCl will completely disappear in 2021: https://lists.llvm.org/pipermail/llvm-dev/2020-April/141107.html Remove x86 NaCl target support from bfd, binutils, gas and ld. bfd/ * archures.c (bfd_mach_i386_nacl): Removed. (bfd_mach_i386_i386_nacl): Likewise. (bfd_mach_x86_64_nacl): Likewise. (bfd_mach_x64_32_nacl): Likewise. * config.bfd: Remove *-*-nacl* targets. * configure.ac: Remove x86 NaCl target vectors. * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed. (bfd_x64_32_nacl_arch): Likewise. (bfd_x86_64_nacl_arch): Likewise. (bfd_i386_nacl_arch): Likewise. (bfd_x64_32_arch_intel_syntax): Updated. * elf32-i386.c: Don't include "elf-nacl.h". (elf_i386_nacl_plt): Removed. (elf_i386_nacl_plt0_entry): Likewise. (elf_i386_nacl_plt_entry): Likewise. (elf_i386_nacl_pic_plt0_entry): Likewise. (elf_i386_nacl_pic_plt_entry): Likewise. (elf_i386_nacl_eh_frame_plt): Likewise. (elf_i386_nacl_plt): Likewise. (elf32_i386_nacl_elf_object_p): Likewise. (elf_i386_get_synthetic_symtab): Updated. (elf_i386_link_setup_gnu_properties): Likewise. * elf64-x86-64.c: Don't include "elf-nacl.h". (elf_x86_64_nacl_plt): Removed. (elf64_x86_64_nacl_elf_object_p): Likewise. (elf_x86_64_nacl_plt0_entry): Likewise. (elf_x86_64_nacl_plt_entry): Likewise. (elf_x86_64_nacl_eh_frame_plt): Likewise. (elf_x86_64_nacl_plt): Likewise. (elf32_x86_64_nacl_elf_object_p): Likewise. (elf_x86_64_get_synthetic_symtab): Updated. (elf_x86_64_link_setup_gnu_properties): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise. * targets.c: Remove x86 NaCl target vectors. * bfd-in2.h: Regenerated. * configure: Likewise. binutils/ * NEWS: Mention x86 NaCl target support removal. * dwarf.c (init_dwarf_regnames_by_bfd_arch_and_mach): Remove x86 NaCl target support. * testsuite/binutils-all/elfedit-1.d: Likewise. * testsuite/binutils-all/i386/i386.exp: Likewise. * testsuite/binutils-all/x86-64/objects.exp: Likewise. * testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494a.d: Likewise. * testsuite/binutils-all/x86-64/pr23494b-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494b.d: Likewise. * testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494c.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d.d: Likewise. * testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494e.d: Likewise. * testsuite/binutils-all/x86-64/x86-64.exp: Likewise. gas/ * NEWS: Mention x86 NaCl target support removal. * config/tc-i386.c: Remove x86 NaCl target support. * config/tc-i386.h: Likewise. * configure.tgt: Likewise. * testsuite/gas/i386/i386.exp: Likewise. * testsuite/gas/i386/iamcu-1.d: Likewise. * testsuite/gas/i386/iamcu-2.d: Likewise. * testsuite/gas/i386/iamcu-3.d: Likewise. * testsuite/gas/i386/iamcu-4.d: Likewise. * testsuite/gas/i386/iamcu-5.d: Likewise. * testsuite/gas/i386/k1om.d: Likewise. * testsuite/gas/i386/l1om.d: Likewise. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Remove eelf_i386_nacl.c, eelf32_x86_64_nacl.c, eelf_x86_64_nacl.c. Remove x86 NaCl dep files. * NEWS: Mention x86 NaCl target support removal. * configure.tgt: Remove x86 NaCl target support. * testsuite/ld-elf/binutils.exp: Likewise. * testsuite/ld-elf/elf.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-i386/align-branch-1.d: Likewise. * testsuite/ld-i386/export-class.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-i386/load1.d: Likewise. * testsuite/ld-i386/pie1.d: Likewise. * testsuite/ld-i386/pr12570a.d: Likewise. * testsuite/ld-i386/pr12570b.d: Likewise. * testsuite/ld-i386/pr19636-1d.d: Likewise. * testsuite/ld-i386/pr19636-1l.d: Likewise. * testsuite/ld-i386/pr19636-2c.d: Likewise. * testsuite/ld-i386/pr19636-2d.d: Likewise. * testsuite/ld-i386/pr19636-2e.d: Likewise. * testsuite/ld-i386/pr20244-1a.d: Likewise. * testsuite/ld-i386/pr20244-1b.d: Likewise. * testsuite/ld-i386/pr20244-2a.d: Likewise. * testsuite/ld-i386/pr20244-2b.d: Likewise. * testsuite/ld-i386/pr20244-2c.d: Likewise. * testsuite/ld-i386/pr20244-4a.d: Likewise. * testsuite/ld-i386/pr20244-4b.d: Likewise. * testsuite/ld-i386/pr21884.d: Likewise. * testsuite/ld-ifunc/binutils.exp: Likewise. * testsuite/ld-ifunc/ifunc-10-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-10-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-11-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-11-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-12-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-12-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-13-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-13-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14c-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14c-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14d-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14d-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14e-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14e-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14f-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14f-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-15-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-15-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-16-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-16-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-16-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-16-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-17a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-17a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-17b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-17b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-18a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-18a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-19a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-19a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-19b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-19b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-20-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-20-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-21-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-22-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5r-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5r-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-6a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-6a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-6b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-6b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-7a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-7a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-7b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-7b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-8-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-8-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-9-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-9-x86-64.d: Likewise. * testsuite/ld-ifunc/pr17154-i386-now.d: Likewise. * testsuite/ld-ifunc/pr17154-i386.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64.d: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-x86-64/align-branch-1.d: Likewise. * testsuite/ld-x86-64/dwarfreloc.exp: Likewise. * testsuite/ld-x86-64/line.exp: Likewise. * testsuite/ld-x86-64/load1a.d: Likewise. * testsuite/ld-x86-64/load1b.d: Likewise. * testsuite/ld-x86-64/load1c.d: Likewise. * testsuite/ld-x86-64/load1d.d: Likewise. * testsuite/ld-x86-64/pie3.d: Likewise. * testsuite/ld-x86-64/pr18160.d: Likewise. * testsuite/ld-x86-64/pr19013-x32.d: Likewise. * testsuite/ld-x86-64/pr19013.d: Likewise. * testsuite/ld-x86-64/pr19636-2d.d: Likewise. * testsuite/ld-x86-64/pr19636-2l.d: Likewise. * testsuite/ld-x86-64/pr20253-1b.d: Likewise. * testsuite/ld-x86-64/pr20253-1d.d: Likewise. * testsuite/ld-x86-64/pr20253-1f.d: Likewise. * testsuite/ld-x86-64/pr20253-1h.d: Likewise. * testsuite/ld-x86-64/pr20253-1j.d: Likewise. * testsuite/ld-x86-64/pr20253-1l.d: Likewise. * testsuite/ld-x86-64/pr21884.d: Likewise. * testsuite/ld-x86-64/pr22393-3a.rd: Likewise. * testsuite/ld-x86-64/pr22393-3b.rd: Likewise. * testsuite/ld-x86-64/tlsgd10.dd: Likewise. * testsuite/ld-x86-64/tlsgd5.dd: Likewise. * testsuite/ld-x86-64/tlsgd8.dd: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * emulparams/elf32_x86_64_nacl.sh: Removed. * emulparams/elf_i386_nacl.sh: Likewise. * emulparams/elf_x86_64_nacl.sh: Likewise. * testsuite/ld-i386/emit-relocs-nacl.rd: Likewise. * testsuite/ld-i386/load1-nacl.d: Likewise. * testsuite/ld-i386/pie1-nacl.d: Likewise. * testsuite/ld-i386/plt-nacl.pd: Likewise. * testsuite/ld-i386/plt-pic-nacl.pd: Likewise. * testsuite/ld-i386/pr17709-nacl.rd: Likewise. * testsuite/ld-i386/pr19636-1d-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2c-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2d-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2e-nacl.d: Likewise. * testsuite/ld-i386/pr19827-nacl.rd: Likewise. * testsuite/ld-i386/pr21884-nacl.d: Likewise. * testsuite/ld-i386/pr21884-nacl.t: Likewise. * testsuite/ld-i386/tlsbin-nacl.rd: Likewise. * testsuite/ld-i386/tlsbin2-nacl.rd: Likewise. * testsuite/ld-i386/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsnopic-nacl.rd: Likewise. * testsuite/ld-i386/tlspic-nacl.rd: Likewise. * testsuite/ld-i386/tlspic2-nacl.rd: Likewise. * testsuite/ld-x86-64/ilp32-4-nacl.d: Likewise. * testsuite/ld-x86-64/load1a-nacl.d: Likewise. * testsuite/ld-x86-64/load1b-nacl.d: Likewise. * testsuite/ld-x86-64/load1c-nacl.d: Likewise. * testsuite/ld-x86-64/load1d-nacl.d: Likewise. * testsuite/ld-x86-64/pie3-nacl.d: Likewise. * testsuite/ld-x86-64/plt-nacl.pd: Likewise. * testsuite/ld-x86-64/pr17709-nacl.rd: Likewise. * testsuite/ld-x86-64/pr19013-nacl.d: Likewise. * testsuite/ld-x86-64/pr19636-2d-nacl.d: Likewise. * testsuite/ld-x86-64/pr19827-nacl.rd: Likewise. * testsuite/ld-x86-64/pr21884-nacl.d: Likewise. * testsuite/ld-x86-64/pr21884-nacl.t: Likewise. * testsuite/ld-x86-64/split-by-file-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin2-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsdesc-nacl.pd: Likewise. * testsuite/ld-x86-64/tlsdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic2-nacl.rd: Likewise. * Makefile.in: Regenerated. * po/BLD-POTFILES.in: Likewise.
2020-06-30solaris XPASS ld-elf/group1Alan Modra1-1/+1
* testsuite/ld-elf/group1.d: Don't xfail all solaris targets, just ix86 and x86_64.
2020-06-30Don't xfail nds32 for ld-elf/reloc-discard testAlan Modra1-1/+1
* testsuite/ld-elf/reloc-discard.d: Don't xfail nds32.
2020-06-30microblaze-linux XPASS ld-elf/var1Alan Modra1-1/+1
microblaze-linux uses the standard ELF script, microblaze-elf its own script lacking an input section pattern needed to make this test pass. Add the missing pattern for .data, in line with most other sections that do have .* patterns. * scripttempl/elfmicroblaze.sc (.data): Add .data.* entry. * testsuite/ld-elf/var1.d: Don't xfail microblaze.
2020-06-29tic6x: Call _bfd_elf_add_dynamic_tagsH.J. Lu13-39/+39
Update tic6x linker tests to expect C6000_DSBT_BASE, C6000_DSBT_SIZE and C6000_DSBT_INDEX dynamic tags immediately before NULL dynamic tag. bfd/ * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. ld/ * testsuite/ld-tic6x/shlib-1.rd: Move C6000_DSBT_BASE, C6000_DSBT_SIZE and C6000_DSBT_INDEX dynamic tags to the last. * testsuite/ld-tic6x/shlib-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-noindex.rd: Likewise. * testsuite/ld-tic6x/static-app-1.rd: Likewise. * testsuite/ld-tic6x/static-app-1b.rd: Likewise. * testsuite/ld-tic6x/static-app-1r.rd: Likewise. * testsuite/ld-tic6x/static-app-1rb.rd: Likewise.
2020-06-29x86_64 k1om testsAlan Modra3-0/+3
On x86_64-nacl we currently see FAIL: Absolute non-overflowing relocs FAIL: ld-x86-64/protected2-k1om FAIL: ld-x86-64/protected3-k1om This limits the tests as per the l1om variants. * testsuite/ld-x86-64/abs-k1om.d: Run only on x86_64-*-linux*. * testsuite/ld-x86-64/protected2-k1om.d: Likewise. * testsuite/ld-x86-64/protected3-k1om.d: Likewise.
2020-06-26ld/x86: actually invoke k1om testsJan Beulich1-0/+3
Unlike claimed by the ChangeLog entries added by 7a9068fe1646 ("Add initial Intel K1OM support") these tests did never get enabled.
2020-06-26m68k: tag floating-point ABI usedPat Bernardi13-0/+73
This patch adds GNU attribute support to m68k and utilises it to tag the floating-point calling convention used (hard-float or soft-float). It enables the linker to ensure linked objects use a consistent floating-point ABI and allows tools like GDB to infer the ABI used from the ELF file. It is based on similar work done for PowerPC. bfd/ * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function. (elf32_m68k_merge_private_bfd_data): Merge GNU attributes. binutils/ * readelf.c (display_m68k_gnu_attribute): New function. (process_arch_specific): Call display_m68k_gnu_attribute for EM_68K. gas/ * config/tc-m68k.c (m68k_elf_gnu_attribute): New function. (md_pseudo_table): Handle "gnu_attribute". * doc/as.texi: Document GNU attribute for M68K. include/ * elf/m68k.h: Add enum for GNU object attribute with floating point tag name and values. ld/ * testsuite/ld-m68k/attr-gnu-4-0.s: New file. * testsuite/ld-m68k/attr-gnu-4-1.s: Likewise. * testsuite/ld-m68k/attr-gnu-4-2.s: Likewise. * testsuite/ld-m68k/attr-gnu-4-00.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-01.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-02.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-10.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-11.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-12.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-20.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-21.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-22.d: Likewise. * testsuite/ld-m68k/m68k.exp: Run the new tests.
2020-06-24csky: Don't generate unnecessary dynamic tagsH.J. Lu2-8/+2
Dynamic tags, DT_JMPREL, PLTREL and PLTRELSZ, are needed only if there are relocation entries for PLT. Don't generate them if there are no relocation entries for PLT. bfd/ PR ld/26083 * elf32-csky.c (csky_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. ld/ PR ld/26083 * testsuite/ld-csky/tls-ie-v1.d: Updated. * testsuite/ld-csky/tls-ie.d: Likewise.
2020-06-24cris: Don't generate unnecessary dynamic tagsH.J. Lu4-11/+33
Dynamic tags, DT_JMPREL, PLTREL and PLTRELSZ, are needed only if there are relocation entries for PLT. Don't generate them if there are no relocation entries for PLT. bfd/ PR ld/26083 * elf32-cris.c (elf_cris_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. ld/ PR ld/26083 * testsuite/ld-cris/libdso-15b.d: Updated. * testsuite/ld-cris/libdso-1c.d: Likewise. * testsuite/ld-cris/libdso-1d.d: Likewise. * testsuite/ld-cris/libdso-15c.d: New file.
2020-06-24ld: Set non_ir_ref_regular on source for assignmentH.J. Lu3-0/+36
We need to set non_ir_ref_regular on the source for assignment to get the correct LTO resolution: 190 a27be7f4ad90c5ce PREVAILING_DEF real_g instead of 190 30c3b2d8f967f5ea PREVAILING_DEF_IRONLY real_g PR ld/26163 * ldexp.c (exp_fold_tree_1): Set non_ir_ref_regular on the source for assignment. * testsuite/ld-plugin/lto.exp: Run ld/26163 test. * testsuite/ld-plugin/pr26163a.c: New file. * testsuite/ld-plugin/pr26163b.c: Likewise.
2020-06-23Correct bfin XPASSesAlan Modra1-17/+15
bfin-elf and bfin-linux differ. This patch fixes these: bfin-linux-uclibc -XPASS: PR ld/14170 bfin-linux-uclibc -XPASS: pr17068 link --as-needed lib in group bfin-linux-uclibc -XPASS: -Bsymbolic-functions bfin-linux-uclibc -XPASS: pr22374 function pointer initialization * testsuite/ld-elf/shared.exp (pr14170): Clear xfail for bfin-*-linux*. (pr17068, symbolic-func.so, pr22374): Likewise.
2020-06-22RISC-V: Report warning when linking the objects with different priv specs.Nelson Chu6-6/+54
We do know some conflicts among different privileged specs. For linker, the safest approach is that don't allow the object linked with others which may cause conflicts. But this may cause inconvenience since not all objects with conflicting priv specs are linked will cause problems. But it is hard to know the detailed conflict cases for linker, so we probably need a option to tell linker that we do know there are no conflicts, or we are willing to take risks to link the objects with conflicted priv specs. But the option is still under discussion. Therefore, we can report warnings rather than errors when linking the objects with conflicted priv specs. This not only makes the linker more flexible, but also warns people that the conflicts may happen. We also need to update the output priv spec version once the input priv spec is newer. bfd/ * elfxx-riscv.c (struct priv_spec_t priv_specs[]): Move them from opcodes/riscv-opc.c to bfd/elfxx-riscv.c, since we need it in linker. (riscv_get_priv_spec_class): Likewise. (riscv_get_priv_spec_name): Likewise. (riscv_get_priv_spec_class_from_numbers): New function, convert the version numbers into string, then call riscv_get_priv_spec_class to get the priv spec class. * elfxx-riscv.h (riscv_get_priv_spec_class): Move forward declaration from include/opcode/riscv.h to bfd/elfxx-riscv.h. (riscv_get_priv_spec_name): Likewise. (riscv_get_priv_spec_class_from_numbers): New forward declaration. (opcode/riscv.h): Include it in the header rather than elfxx-riscv.c. * elfnn-riscv.c (riscv_merge_attributes): Get the priv spec classes of input and output objects form their priv spec attributes by riscv_get_priv_spec_class_from_numbers. Report warning rather than errors when linking objects with differnet priv spec versions. We do know v1.9.1 may have conflicts to other versions, so report the warning, too. After that, update the output priv spec version to the newest one so far. gas/ * config/tc-riscv.c (buf_size, buf): Remove the unused variables. (riscv_set_default_priv_spec): Get the priv spec version from the priv spec attributes by riscv_get_priv_spec_class_from_numbers. include/ * opcode/riscv.h (riscv_get_priv_spec_class): Move the function forward declarations to bfd/elfxx-riscv.h. (riscv_get_priv_spec_name): Likewise. opcodes/ * riscv-opc.c: Move the structures and functions to bfd/elfxx-riscv.c. * riscv-dis.c: Include elfxx-riscv.h. ld/ * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Updated. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Updated. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Updated. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Updated. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Updated. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Updated.
2020-06-20Remove perror from ld_assemble, ld_compile and ld_nmAlan Modra20-76/+66
ERROR should really be reserved for errors in the testsuite framework, not just normal errors from the tools under test. Removing use of perror has been suggested before but without action, over concerns that some test failures might be missed. This patch removes uses of perror in ld_assemble, ld_compile and ld_nm, and updates numerous places that ignored the result of these functions by inappropriately returning an "unresolved" test status. Net result over my large set of targets look good, in some cases improving the diagnostics, eg: i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos -ERROR: tmpdir/script: nm failed i386-msdos +FAIL: script i386-msdos +FAIL: MRI script i386-msdos +FAIL: MEMORY i386-msdos +FAIL: MEMORY with symbols * testsuite/lib/ld-lib.exp (default_ld_compile): Don't perror on a compiler error. (default_ld_assemble): Similarly for an assembler error. (default_ld_nm): Similarly for an nm error. (run_ld_link_tests): Report ld_assemble errors as a fail. (check_as_cfi): Remove now unnecessary perror substitution. * testsuite/ld-elf/exclude.exp: Report ld_nm error return as test fails rather then unresolved. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-scripts/alignof.exp: Likewise. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/script.exp: Likewise. * testsuite/ld-scripts/sizeof.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-scripts/extern.exp: Likewise. Return on ld_link failure. * testsuite/ld-elfweak/elfweak.exp: Report compiler errors as test unresolved. * testsuite/ld-fastcall/fastcall.exp: Report assember errors as test fails. * testsuite/ld-i386/i386.exp (iamcu_tests): Likewise. * testsuite/ld-ia64/line.exp: Likewise. * testsuite/ld-mep/mep.exp: Likewise. * testsuite/ld-mips-elf/mips-elf-flags.exp: Likewise. * testsuite/ld-nios2/nios2.exp: Likewise. * testsuite/ld-scripts/alignof.exp: Likewise. * testsuite/ld-x86-64/line.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-scripts/log2.exp: Formatting. * testsuite/ld-tic6x/tic6x.exp: Report ld_link errors as a test fail.
2020-06-20ecoff testsuite fixesAlan Modra5-25/+25
The aim of this change is to remove a whole lot of "assembly failed" errors for ecoff targets. * testsuite/ld-alpha/alpha.exp: Exclude *ecoff targets. * testsuite/ld-elf/binutils.exp: Likewise. * testsuite/ld-elf/tls.exp: Likewise. * testsuite/ld-elf/tls_common.exp: Likewise. * testsuite/ld-scripts/phdrs2.exp: Likewise.
2020-06-20SH gas configure and ld testsAlan Modra1-66/+66
All current SH gas targets use BFD. sh-coff was incorrectly reported as unsupported. gas/ * configure.tgt: Set bfd_gas for all SH targets. ld/ * testsuite/ld-sh/sh.exp: Don't run relax tests for non-ELF. Fail when ld_assemble fails. Use elseif to reduce indentation.
2020-06-19Re: ld testsuite fixes for alphaAlan Modra3-3/+3
I missed some. * testsuite/ld-plugin/pr22983.1.d: Accept st_other notations. * testsuite/ld-plugin/pr22983.2.d: Likewise. * testsuite/ld-plugin/pr22983.4.d: Likewise.
2020-06-19ld testsuite fixes for alphaAlan Modra8-11/+11
Some tests failed just due to st_other info, eg. [NOPV], being emitted by readelf or objdump. Fix that. Also since alpha doesn't support ifunc, don't run the ifunc tests for alpha. * testsuite/ld-elf/dynamic-1.rd: Accept st_other notations. * testsuite/ld-elf/rdynamic-1.rd: Likewise. * testsuite/ld-elf/pr9676.rd: Likewise. * testsuite/ld-elf/pr9679.rd: Likewise. * testsuite/ld-elfvers/vers30.dsym: Likewise. * testsuite/ld-elfvers/vers31.dsym: Likewise. * testsuite/ld-plugin/pr22983.3.d: Likewise. * testsuite/ld-ifunc/ifunc.exp: Exclude alpha.
2020-06-19Emit a warning when -z relro is unsupportedAlan Modra6-23/+17
ld silently accepts -z relro and -z norelro for targets that lack the necessary GNU_RELRO support. This patch makes those targets emit a warning instead, and adds testsuite infrastructure to detect when relro is unsupported. binutils/ * testsuite/config/default.exp (ld_elf_shared_opt): Don't set. * testsuite/lib/binutils-common.exp (check_relro_support): New proc. (run_dump_test): Use check_relro_support to decide whether to pass extra ld option "-z norelro". ld/ * emultempl/elf.em (gld${EMULATION_NAME}_handle_option): Omit -z relro and -z norelro when target support for GNU_RELRO is lacking. (gld${EMULATION_NAME}_before_parse): Ignore RELRO default too. * emultempl/aarch64elf.em (gld${EMULATION_NAME}_before_parse): Ignore RELRO default when target support for GNU_RELRO is lacking. * emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Likewise. * emultempl/linux.em (gld${EMULATION_NAME}_before_parse): Likewise. * emultempl/scoreelf.em (gld${EMULATION_NAME}_before_parse): Likewise. * testsuite/config/default.exp (ld_elf_shared_opt): Don't set. * testsuite/ld-elf/pr16322.d: xfail when no relro support. * testsuite/ld-elf/pr22393-1a.d: Likewise. * testsuite/ld-elf/pr22393-1b.d: Likewise. * testsuite/ld-elf/shared.exp (pr20995-2.so, pr20995-2): Likewise. * testsuite/lib/ld-lib.exp (run_ld_link_tests): Use check_relro_support to decide whether to pass extra ld option "-z norelro".
2020-06-17ld: Suppress warning for unsupported attribute from older GCCH.J. Lu1-0/+3
Suppress warning for unsupported attribute from older GCC: .../ld/testsuite/ld-elf/pr25754-1a.c:9: warning: 'noclone' attribute directive ignored .../ld/testsuite/ld-elf/pr25754-1a.c:9: warning: 'noclone' attribute directive ignored ERROR: .../ld/testsuite/ld-elf/pr25754-1a.c: compilation failed UNRESOLVED: Build pr25754-1a ( ) * testsuite/ld-elf/linux-x86.exp (check_pr25749a): Append "-w" to cflags.
2020-06-17ld: Require GCC 5 for Build pr25749-1b (-pie -fPIE)H.J. Lu1-1/+1
Before GCC 5, Build pr25749-1b (-pie -fPIE) won't trigger the expected linker error. * testsuite/ld-elf/linux-x86.exp: Require GCC 5 for Build pr25749-1b (-pie -fPIE).
2020-06-16Re: Use __asm__ rather than asm in ld testsuiteAlan Modra2-3/+3
* testsuite/ld-elf/pr19553c.c: Replace asm with __asm__. * testsuite/ld-elfvers/vers27b.c: Likewise.
2020-06-16Use __asm__ rather than asm in ld testsuiteAlan Modra28-72/+75
* testsuite/ld-elf/pr23428.c: Define _DEFAULT_SOURCE. * testsuite/ld-elf/indirect1b.c: Replace asm with __asm__. * testsuite/ld-elf/indirect2.c: Likewise. * testsuite/ld-elf/indirect3b.c: Likewise. * testsuite/ld-elf/indirect4b.c: Likewise. * testsuite/ld-elf/pr14323-2.c: Likewise. * testsuite/ld-elf/pr18720b.c: Likewise. * testsuite/ld-elf/pr23428.c: Likewise. * testsuite/ld-elfvsb/common.c: Likewise. * testsuite/ld-elfvsb/main.c: Likewise. * testsuite/ld-elfvsb/sh1.c: Likewise. * testsuite/ld-elfvsb/test.c: Likewise. * testsuite/ld-pe/aligncomm-1.c: Likewise. * testsuite/ld-pe/aligncomm-2.c: Likewise. * testsuite/ld-pe/aligncomm-3.c: Likewise. * testsuite/ld-pe/aligncomm-4.c: Likewise. * testsuite/ld-plugin/pr23958.c: Likewise. * testsuite/ld-size/size-1b.c: Likewise. * testsuite/ld-size/size-2b.c: Likewise. * testsuite/ld-size/size-3a.c: Likewise. * testsuite/ld-size/size-3b.c: Likewise. * testsuite/ld-size/size-3c.c: Likewise. * testsuite/ld-size/size-4b.c: Likewise. * testsuite/ld-size/size-5b.c: Likewise. * testsuite/ld-size/size-6a.c: Likewise. * testsuite/ld-size/size-7a.c: Likewise. * testsuite/ld-size/size-8a.c: Likewise. * testsuite/ld-size/size-9b.c: Likewise. * testsuite/ld-size/size-10b.c: Likewise.
2020-06-16Really remove tic30-aout supportAlan Modra2-3/+3
bfd/ * aout-tic30.c: Delete file. * Makefile.am (BFD32_BACKENDS): Remove aout-tic30.lo. (BFD32_BACKENDS_CFILES): Remove aout-tic30.c. * config.bfd (c30-*-*aout*, tic30-*-*aout*): Remove entry. (xc16x-*-elf): Sort properly. * configure.ac: Remove tic30_aout_vec. * targets.c: Likewise. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate. gas/ * config/tc-tic30.h: Remove OBJ_AOUT support. * configure.tgt: Delete tic30-*-*aout* entry. ld/ * emulparams/tic30aout.sh: Delete file. * scripttempl/tic30aout.sc: Delete file. * Makefile.am: Remove etic30aout.c from ALL_EMULATION_SOURCES and delete dependency. * configure.tgt: Delete tic30-*-*aout* entry. * testsuite/ld-scripts/sane1.d: Delete tic30-*-aout mention. * testsuite/ld-scripts/segment-start.d: Likewise. * Makefile.in: Regenerate. * po/BLD-POTFILES.in: Regenerate.
2020-06-15Unnecessary load_lib in ld testsuiteAlan Modra6-18/+1
ld-lib.exp is loaded in config/defaults.exp * testsuite/ld-scripts/include.exp: Don't load ld-lib.exp. * testsuite/ld-scripts/phdrs3.exp: Likewise. * testsuite/ld-scripts/rgn-at.exp: Likewise. * testsuite/ld-scripts/rgn-over.exp: Likewise. * testsuite/ld-scripts/sort.exp: Likewise. * testsuite/ld-discard/discard.exp: Likewise. Use is_elf_format.
2020-06-15PR26103 testcaseAlan Modra6-9/+50
PR 26103 * testsuite/ld-linkonce/ref1.s, * testsuite/ld-linkonce/ref2.s, * testsuite/ld-linkonce/sym1.s, * testsuite/ld-linkonce/sym2.s, * testsuite/ld-linkonce/sym3.s: New test files. * testsuite/ld-linkonce/linkonce.exp: Run tests for PE too. Add pr26103 test. Remove unnecessary load_lib.
2020-06-15ld-linkonce testAlan Modra3-10/+11
* testsuite/ld-linkonce/zeroeh_x.s: Rename from x.s. * testsuite/ld-linkonce/zeroeh_y.s: Rename from y.s. * testsuite/ld-linkonce/zeroehl32.d: Adjust for renaming. Support big-endian output. Run for powerpc.
2020-06-11Run certain ld-plugun lto tests only for ELFAlan Modra1-25/+25
lto-6.c refers to _etext, pr12760b.c has a .gnu.warning section, the pr23818 test uses readelf, and pr23958.c has a .symver directive. * testsuite/ld-plugin/lto.exp (lto_link_tests): Move lto-6, pr12760, pr23818 and pr23958 tests to.. (lto_link_elf_tests): ..here.
2020-06-11Fix a compile time warning in the linker testsuite when compiling using clang.Nick Clifton1-3/+3
* testsuite/ld-elf/pr26094-1b.c (main): Change return type to int.
2020-06-10Fix x86 ld testsuite fails with glibc < 2.28Alan Modra5-20/+30
* testsuite/ld-elf/linux-x86.exp: Build tests when non-native. (check_pr25749b): Add optional args. Set expected pass file from args. Run -1b and -2a tests with passall.out. * testsuite/ld-elf/passall.out: New file. * testsuite/ld-elf/pr25749-1.c: Adjust to pass with older glibc. * testsuite/ld-elf/pr25749-2.c: Likewise. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Use regexp_diff to compare expected output from running binary.
2020-06-10ELF: Properly handle section symbolsH.J. Lu7-0/+58
When defining the section symbol, __start_FOO, for the section FOO: 1. Treat the common symbol, __start_FOO, in input object file as definition. 2. Clear verinfo.verdef. bfd/ PR ld/26094 * elflink.c (bfd_elf_define_start_stop): Handle common symbols. Clear verinfo.verdef. ld/ PR ld/26094 * testsuite/ld-elf/pr26094-1.ver: New fike. * testsuite/ld-elf/pr26094-1a.c: Likewise. * testsuite/ld-elf/pr26094-1a.rd: Likewise. * testsuite/ld-elf/pr26094-1b.c: Likewise. * testsuite/ld-elf/pr26094-1b.rd: Likewise. * testsuite/ld-elf/pr26094-1c.c: Likewise. * testsuite/ld-elf/shared.exp: Run ld/26094 tests.
2020-06-09IFUNC: Update IFUNC resolver check with DT_TEXTRELH.J. Lu16-4/+116
Add ifunc_resolvers to elf_link_hash_table and use it for both x86 and ppc64. Before glibc commit b5c45e837, DT_TEXTREL is incompatible with IFUNC resolvers. Set ifunc_resolvers if there are IFUNC resolvers and issue a warning for IFUNC resolvers with DT_TEXTREL. bfd/ PR ld/18801 * elf-bfd.h (elf_link_hash_table): Add ifunc_resolvers. (_bfd_elf_allocate_ifunc_dyn_relocs): Remove the bfd_boolean * argument. Set ifunc_resolvers if there are IFUNC resolvers. * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated. Set ifunc_resolvers if there are FUNC resolvers. * elf64-ppc.c (ppc_link_hash_table): Remove local_ifunc_resolver. (build_global_entry_stubs_and_plt): Replace local_ifunc_resolver with elf.ifunc_resolvers. (write_plt_relocs_for_local_syms): Likewise. (ppc64_elf_relocate_section): Likewise. (ppc64_elf_finish_dynamic_sections): Likewise. * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs): Updated. * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise. (_bfd_x86_elf_size_dynamic_sections): Check elf.ifunc_resolvers instead of readonly_dynrelocs_against_ifunc. * elfxx-x86.h (elf_x86_link_hash_table): Remove readonly_dynrelocs_against_ifunc. ld/ PR ld/18801 * testsuite/ld-i386/i386.exp: Run ifunc-textrel-1a, ifunc-textrel-1b, ifunc-textrel-2a and ifunc-textrel-2b. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/ifunc-textrel-1a.d: Likewise. * testsuite/ld-i386/ifunc-textrel-1b.d: Likewise. * testsuite/ld-i386/ifunc-textrel-2a.d: Likewise. * testsuite/ld-i386/ifunc-textrel-2b.d: Likewise. * testsuite/ld-x86-64/ifunc-textrel-1.s: Likewise. * testsuite/ld-x86-64/ifunc-textrel-1a.d: Likewise. * testsuite/ld-x86-64/ifunc-textrel-1b.d: Likewise. * testsuite/ld-x86-64/ifunc-textrel-2.s: Likewise. * testsuite/ld-x86-64/ifunc-textrel-2a.d: Likewise. * testsuite/ld-x86-64/ifunc-textrel-2b.d: Likewise. * testsuite/ld-i386/pr18801a.d: Expect warning for IFUNC resolvers. * testsuite/ld-i386/pr18801b.d: Likewise. * estsuite/ld-x86-64/pr18801a.d: Likewise. * estsuite/ld-x86-64/pr18801b.d: Likewise.
2020-06-09PR26065, ld/testsuite/ld-elf symbolic tests dl4e and dl4f failAlan Modra2-12/+6
PR 26065 * testsuite/ld-elf/shared.exp: Compile dl4main.c -fPIC. (dl4e, dl4f): Expect dl4a.out. * testsuite/ld-elf/dl4e.out: Delete.
2020-06-07ld: Pass $LFLAGS to PR ld/21703 shared testH.J. Lu1-1/+1
$LFLAGS is needed for -shared test. This fixes FAIL: PR ld/21703 shared for tic6x-*-elf. * testsuite/ld-elf/shared.exp: Pass $LFLAGS to PR ld/21703 shared test.
2020-06-07ld: Xfail pr20995 and pr20995-2 for tic6x-*-*H.J. Lu1-2/+2
Xfail pr20995 and pr20995-2 for tic6x-*-* since GNU_RELRO is not supported. * testsuite/ld-elf/shared.exp: Xfail pr20995/pr20995-2 for tic6x-*-*.
2020-06-07pr11304.d: Skip tic6x-*-elfH.J. Lu1-0/+2
Since address 0x800000 overlaps with .heap section on tic6x-*-elf, skip pr11304.d on tic6x-*-elf. * testsuite/ld-elf/pr11304.d: Skip tic6x-*-elf.
2020-06-06Re: PR13802, referred common symbol not UNDefinedAlan Modra1-3/+2
It looks like this one was previously just swept under the rug. Prior to git commit c4b126b87a6c, the arm backend emitted an absolute dynamic symbol "foo" with value zero for what was originally a common symbol. That was just wrong. The patch also removes an xfail for bfin-linux-uclibc. PR 13802 * testsuite/ld-elf/comm-data.exp: Don't xfail arm or bfin-linux.
2020-06-06ld -plugin options when plugins are disabledAlan Modra1-1/+2
This patch makes ld accept and ignore -plugin options when configured with --disable-plugins. The idea is to allow using a linker built without plugin support with a gcc built with plugin support. Quite obviously such a combination won't work if using LTO, but gcc has a habit of passing a bunch of -plugin and -plugin-opt arguments to ld even when not generating or linking LTO objects. Why do I want to do this? Well, it lets me and other binutils developers answer the question as to whether plugin support breaks binutils in some areas. Which it does for some targets. * lexsup.c (ld_options): Accept -plugin and -plugin-opt when !ENABLE_PLUGINS. * testsuite/lib/ld-lib.exp (check_plugin_api_available): Adjust.
2020-06-05RISC-V: The object without priv spec attributes can be linked with any object.Nelson Chu12-1/+70
bfd/ * elfnn-riscv.c (riscv_merge_attributes): Add new boolean priv_may_conflict, in_priv_zero and out_priv_zero to decide whether the object can be linked according to it's priv attributes. The object without any priv spec attributes can be linked with others. If the first input object doesn't contain any priv attributes, then we need to copy the setting from the next input one. Also report more detailed error messages to user. ld/ * testsuite/ld-riscv-elf/attr-merge-priv-spec.d: Rename to attr-merge-priv-spec-01.d. * testsuite/ld-riscv-elf/attr-merge-priv-spec-c.s: Set priv spec to 1.11. * testsuite/ld-riscv-elf/attr-merge-priv-spec-d.s: Empty priv spec setting. * testsuite/ld-riscv-elf/attr-merge-priv-spec-02.d: New testcase. * testsuite/ld-riscv-elf/attr-merge-priv-spec-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
2020-06-05RISC-V: Don't generate the ELF privilege attributes when no CSR are used.Nelson Chu10-27/+1
gas/ * config/tc-riscv.c (explicit_csr): New static boolean. Used to indicate CSR are explictly used. (riscv_ip): Set explicit_csr to TRUE if any CSR is used. (riscv_write_out_attrs): If we already have set elf priv attributes, then generate them. Otherwise, don't generate them when no CSR are used. * testsuite/gas/riscv/attribute-01.d: Remove the priv attributes. * testsuite/gas/riscv/attribute-02.d: Likewise. * testsuite/gas/riscv/attribute-03.d: Likewise. * testsuite/gas/riscv/attribute-04.d: Likewise. * testsuite/gas/riscv/attribute-05.d: Likewise. * testsuite/gas/riscv/attribute-06.d: Likewise. * testsuite/gas/riscv/attribute-07.d: Likewise. * testsuite/gas/riscv/attribute-08.d: Likewise. * testsuite/gas/riscv/attribute-09.d: Likewise. * testsuite/gas/riscv/attribute-10.d: Likewise. * testsuite/gas/riscv/attribute-unknown.d: Likewise. * testsuite/gas/riscv/attribute-11.s: New testcase. * testsuite/gas/riscv/attribute-11.d: New testcase. The CSR is used, so we should output the ELF priv attributes. * testsuite/gas/riscv/attribute-12.d: New testcase. The CSR is used, so output the priv attributes according to the -mpriv-spec. * testsuite/gas/riscv/attribute-13.d: New testcase. The CSR isn't used, so ignore the -mpriv-spec setting. ld/ * testsuite/ld-riscv-elf/attr-merge-arch-01.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-stack-align.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-01.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-04.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-strict-align-05.d: Likewise. * testsuite/ld-riscv-elf/call-relax.d: Add -mno-arch-attr.
2020-06-04ELF: Don't check relocations in non-loaded, non-alloced sectionsH.J. Lu4-27/+3
Don't do anything special with non-loaded, non-alloced sections. In particular, any relocs in such sections should not affect GOT and PLT reference counting (ie. we don't allow them to create GOT or PLT entries), there's no possibility or desire to optimize TLS relocs, and there's not much point in propagating relocs to shared libs that the dynamic linker won't relocate. Since check_relocs is no longer called on non-loaded, non-alloced sections, remove SEC_ALLOC check. Resolve relocation in debug section against symbol defined in shared library to 0. bfd/ PR ld/26080 * elf-m10300.c (mn10300_elf_relocate_section): Resolve relocation in debug section against symbol defined in shared library to 0. * elf32-i386.c (elf_i386_check_relocs): Remove SEC_ALLOC check. * elf32-lm32.c (lm32_elf_check_relocs): Likewise. * elf32-m32r.c (m32r_elf_check_relocs): Likewise. * elf32-nds32.c (nds32_elf_check_relocs): Likewise. * elf32-nios2.c (nios2_elf32_check_relocs): Likewise. * elf32-or1k.c (or1k_elf_check_relocs): Likewise. * elf32-ppc.c (ppc_elf_check_relocs): Likewise. * elf32-sh.c (sh_elf_check_relocs): Likewise. * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise. * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. * elf32-vax.c (elf_vax_check_relocs): Set non_got_ref for non-GOT reference. (elf_vax_adjust_dynamic_symbol): Generate a copy reloc only if there is non-GOT reference. * elflink.c (_bfd_elf_link_check_relocs): Skip non-loaded, non-alloced sections. ld/ PR ld/26080 * testsuite/ld-elf/comm-data.exp: Remove copy_reloc. * testsuite/ld-elf/comm-data2r.rd: Removed. * testsuite/ld-elf/comm-data2r.sd: Likewise. * testsuite/ld-elf/comm-data2r.xd: Likewise.
2020-06-04tcl global directive outside proc body does nothing (ld)Alan Modra37-111/+0
* testsuite/config/default.exp: Remove global directive outside proc body. * testsuite/ld-bootstrap/bootstrap.exp: Likewise. * testsuite/ld-elf/compress.exp: Likewise. * testsuite/ld-elf/elf.exp: Likewise. * testsuite/ld-elf/exclude.exp: Likewise. * testsuite/ld-elf/frame.exp: Likewise. * testsuite/ld-elf/indirect.exp: Likewise. * testsuite/ld-elf/linux-x86.exp: Likewise. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-elf/tls.exp: Likewise. * testsuite/ld-elf/tls_common.exp: Likewise. * testsuite/ld-elfcomm/elfcomm.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-frv/fdpic.exp: Likewise. * testsuite/ld-frv/tls.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-i386/no-plt.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-mips-elf/mips-elf-flags.exp: Likewise. * testsuite/ld-nios2/nios2.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-powerpc/export-class.exp: Likewise. * testsuite/ld-scripts/align.exp: Likewise. * testsuite/ld-scripts/crossref.exp: Likewise. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/overlay-size.exp: Likewise. * testsuite/ld-scripts/provide.exp: Likewise. * testsuite/ld-scripts/weak.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-sh/rd-sh.exp: Likewise. * testsuite/ld-size/size.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-x86-64/mpx.exp: Likewise. * testsuite/ld-x86-64/no-plt.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise.
2020-06-04ld-dynamic test fixesAlan Modra5-8/+21
* testsuite/ld-dynamic/export-dynamic-symbol-2.d: Match output for mips-sgi-irix6. * testsuite/ld-dynamic/export-dynamic-symbol-glob.d: Likewise. * testsuite/ld-dynamic/export-dynamic-symbol-list-2.d: Likewise. * testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d: Likewise. * testsuite/ld-dynamic/export-dynamic-symbol.exp: Exclude targets with poor PIE support.
2020-06-04ld testsuite fails with default-PIE compilerAlan Modra2-3/+3
* testsuite/ld-plugin/lto.exp (pr12758.exe): Add NOPIE_LDFLAGS. * testsuite/ld-unique/unique.exp: Add NOPIE_LDFLAGS to unique executable and dynamic executable tests.
2020-06-03ld: Pass -fno-sanitize=all to tests with linkerH.J. Lu13-32/+96
When binutils is compiled with -fsanitize=undefined, many tests with linker, instead of $CC, fail with undefined symbol references to sanitize library. Define NOSANTIZE_CFLAGS to -fno-sanitize=all if target compiler supports it and compile such tests with $NOSANTIZE_CFLAGS. * testsuite/config/default.exp (NOSANTIZE_CFLAGS): New. * testsuite/ld-elf/linux-x86.exp: Add $NOSANTIZE_CFLAGS to tests with run_ld_link_exec_tests. * testsuite/ld-elf/shared.exp: Add $NOSANTIZE_CFLAGS to tests with run_ld_link_tests. * testsuite/ld-elf/tls.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Add $NOSANTIZE_CFLAGS to tests with ld_link. * testsuite/ld-gc/gc.exp: Add $NOSANTIZE_CFLAGS to cflags. * testsuite/ld-plugin/lto.exp: Add $NOSANTIZE_CFLAGS to tests with run_ld_link_tests.a * testsuite/ld-plugin/plugin.exp: Append $NOSANTIZE_CFLAGS to CFLAGS. * testsuite/ld-selective/selective.exp: Add $NOSANTIZE_CFLAGS to cflags and cxxflags. * testsuite/ld-srec/srec.exp: Append $NOSANTIZE_CFLAGS to CC and CXX. * testsuite/ld-x86-64/plt-main-ibt-x32.dd: Updated for -fsanitize=undefined. * testsuite/ld-x86-64/plt-main-ibt.dd: Likewise. * testsuite/ld-x86-64/x86-64.exp: Add $NOSANTIZE_CFLAGS to tests with run_cc_link_tests and run_ld_link_tests.