aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/config
AgeCommit message (Collapse)AuthorFilesLines
2024-07-22Don't trim trailing newline in run_host_cmdAlan Modra1-2/+2
Testcases like ld-elf/pr19719a.c that printf ("PASS\n"); on success ought to see the whole output for "string match". Similarly, the ld-pe/ pdb*.d files shouldn't need to remove the last newline to match. For most of the testsuite it doesn't matter whether the trailing newline is present or not, and there are only a few cases where we need to remove it. * testsuite/lib/ld-lib.exp (run_host_cmd): Don't regsub away output trailing newline. Do string trim for gcc/ld version checks. * testsuite/config/default.exp (plug_so): Do string trim output of run_host_cmd. * testsuite/ld-elf/shared.exp (mix_pic_and_non_pic): Adjust string match to include trailing newline. * testsuite/ld-i386/i386.exp (undefined_weak): Likewise. * testsuite/ld-x86-64/x86-64.exp (undefined_weak): Likewise. * testsuite/ld-plugin/libdep.exp (run_test): Likewise. * testsuite/ld-plugin/lto.exp (PR ld/28138 run): Likewise. * testsuite/ld-pe/pdb-strings.d, * testsuite/ld-pe/pdb-syms1-globals.d, * testsuite/ld-pe/pdb-syms1-records.d, * testsuite/ld-pe/pdb-syms1-symbols1.d, * testsuite/ld-pe/pdb-syms1-symbols2.d, * testsuite/ld-pe/pdb-syms2-symbols1.d, * testsuite/ld-pe/pdb-types1-hashlist.d, * testsuite/ld-pe/pdb-types1-skiplist.d, * testsuite/ld-pe/pdb-types1-typelist.d, * testsuite/ld-pe/pdb-types2-hashlist.d, * testsuite/ld-pe/pdb-types2-skiplist.d, * testsuite/ld-pe/pdb-types2-typelist.d, * testsuite/ld-pe/pdb-types3-hashlist.d, * testsuite/ld-pe/pdb-types3-skiplist.d, * testsuite/ld-pe/pdb-types3-typelist.d, * testsuite/ld-pe/pdb1-publics.d, * testsuite/ld-pe/pdb1-sym-record.d, * testsuite/ld-pe/pdb2-section-contrib.d, * testsuite/ld-pe/pdb3-c13-info1.d, * testsuite/ld-pe/pdb3-c13-info2.d, * testsuite/ld-pe/pdb3-source-info.d: Add trailing newline.
2024-07-13Revert "MIPS: Use N64 by default for mips*64*-*-linux-gnuabi64"Maciej W. Rozycki1-7/+2
This reverts commit d49f2dd78b08efa4e1ee51f5df5058846c2eb4fa. It was applied unapproved.
2024-07-12MIPS: Use N64 by default for mips*64*-*-linux-gnuabi64YunQiang Su1-2/+7
the ABI section of the triple explicitly asks for N64, and in fact GCC also does so. It can fix the test failure: FAIL: libdep test: did not get expected output from the linker with Debian's mipsisa64r6el-linux-gnuabi64 toolchain.
2024-04-09ld testsuite: Append NOSANITIZE_CFLAGS to CFLAGS_FOR_TARGETAlan Modra1-0/+3
The idea here is build tests without sanitizer flags, so they don't fail due to many not using the compiler to link and thus result in undefined symbols, since libasan is not supplied. We definitely do not want a compiler to perform linking in most cases, and it's complicated to supply libasan (and would possibly disturb testcase output). * testsuite/config/default.exp (CFLAGS_FOR_TARGET), (CXXFLAGS_FOR_TARGET): Append NOSANITIZE_CFLAGS. * testsuite/ld-bootstrap/bootstrap.exp: Use CC_FOR_TARGET and CFLAGS_FOR_TARGET throughout.
2024-03-19ld: Support LD_UNDER_TEST environment variableH.J. Lu1-4/+26
Support LD_UNDER_TEST environment variable to test a different linker. Issue an error if LD_UNDER_TEST isn't an absolute full path. * testsuite/config/default.exp: If LD_UNDER_TEST environment variable exists, set ld and LD to it and set up tmpdir/ld/ld. Issue an error if LD_UNDER_TEST isn't an absolute full path.
2024-01-04Update year range in copyright notice of binutils filesAlan Modra1-1/+1
Adds two new external authors to etc/update-copyright.py to cover bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then updates copyright messages as follows: 1) Update cgen/utils.scm emitted copyrights. 2) Run "etc/update-copyright.py --this-year" with an extra external author I haven't committed, 'Kalray SA.', to cover gas testsuite files (which should have their copyright message removed). 3) Build with --enable-maintainer-mode --enable-cgen-maint=yes. 4) Check out */po/*.pot which we don't update frequently.
2023-06-15Revert "MIPS: fix some ld testcases with compiler"Maciej W. Rozycki1-19/+1
This reverts commit a0631c1501c113c04891c9a24a9ff5276257f28d. It was applied unapproved.
2023-06-05MIPS: fix some ld testcases with compilerYunQiang Su1-1/+19
1. config/default.exp: use -mabi=32 not for -gnuabi64 xfail_from_runlist: remove an element and mark it xfail. 2. ld-elf/indirect.exp: xfail indirect5a indirect5b indirect6a indirect6b indirect5c indirect5d indirect6c indirect6d 3. ld-elf/pr23658-2: mips output is not common 4. ld-elf/shared.exp: non-run on mips: Build libpr16496b.so 5. ld-elfvers/vers.exp: xfail vers4, vers4b no-run on mips: vers24a, vers24b, vers24c 6. ld-gc/gc.exp: add -KPIC into asflags for pr13683, pr14265, pr19161 7. ld-mips-elf/mips-elf.exp: use noarch for mips16-local-stubs-1, since it use -mips4 8. ld-plugin/lto.exp: no-run on mips/linux: PR ld/12982 add -KPIC into asflags for lto-3r, lto-5r, PR ld/19317 (2) xfail PR ld/15323 (4), PR ld/19317 (3) 9. ld-plugin/plugin.exp: xfail plugin claimfile lost symbol plugin claimfile replace symbol plugin claimfile replace symbol plugin claimfile lost symbol with source plugin claimfile replace symbol with source plugin claimfile resolve symbol with source plugin 2 with source lib load plugin 2 with source plugin 3 with source lib load plugin 3 with source 11. ld-selective/selective.exp: add -fno-PIC, which is needed for -mno-abicalls 12. ld-shared/shared.exp: xfail shared (non PIC), shared (PIC main, non PIC so)
2023-02-21ld/testsuite: don't output to /dev/nullClément Chigot1-1/+3
Mingw doesn't have /dev/null and thus "-o /dev/null" will fail. Currently, all the options are checked using this "-o /dev/null", resulting in them being disabled on mingw hosts. Fix that by outputting to a real file for all targets. ld/ChangeLog: * testsuite/config/default.exp: Replace "-o /dev/null" by a file.
2023-02-21alpha-*-vms missing librariesAlan Modra1-1/+1
For this: ./ld-new: cannot find -limagelib: No such file or directory ./ld-new: cannot find -lstarlet: No such file or directory ./ld-new: cannot find -lsys$public_vectors: No such file or directory the logs showed creating dummy tmpdir/libimagelib: creating dummy No creating dummy such etc. So rubbish instead of tmpdir/libimagelib.a and the other required libs. * testsuite/config/default.exp: Correct regex detecting missing libraries automatically searched by alpha-dec-vms-ld.
2023-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The newer update-copyright.py fixes file encoding too, removing cr/lf on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2022-09-22ld/testsuite: allow to force another directory for gcc linkerClément Chigot1-8/+15
Add a new variable "ld_testsuite_tmpdir" to enable manual configuration of the -B flag added to gcc calls. This flag ensure that gcc is invoking the linker and the assembler we want to test. When launching the testsuite outside of the build tree, the links made by the testsuite in tmpdir/ld will point to nothing. Thus, even with the PATH correctly setup towards the linker directory, gcc might end up falling back to its default linker. Hence this variable to ensure that gcc, whatever happens, is using the linker we want. ld/ChangeLog: * testsuite/config/default.exp: Allow to change -B flag with ld_testsuite_bindir variable.
2022-02-05Enable "size" as a dumpprog in ldAlan Modra1-0/+8
binutils/ * testsuite/lib/binutils-common.exp (run_dump_test): Reference global SIZE and SIZEFLAGS. ld/ * testsuite/config/default.exp: Define SIZE and SIZEFLAGS.
2022-01-13testsuite supports_dt_relrAlan Modra1-12/+4
Tidy, and fix "FAIL: Build dt-relr-glibc-1b.so" on all non-x86 linux targets. binutils/ * binutils-common.exp (supports_dt_relr): New proc. ld/ * testsuite/config/default.exp (DT_RELR_LDFLAGS, NO_DT_RELR_LDFLAGS), (DT_RELR_CC_LDFLAGS, NO_DT_RELR_CC_LDFLAGS): Use supports_dt_relr. * testsuite/ld-elf/dt-relr.exp: Don't run unless supports_dt_relr. * testsuite/ld-elf/dt-relr-1a.d: Likewise. * testsuite/ld-elf/dt-relr-1b.d: Likewise. * testsuite/ld-elf/dt-relr-1c.d: Likewise. * testsuite/ld-elf/dt-relr-2a.d: Likewise. * testsuite/ld-elf/dt-relr-2b.d: Likewise. * testsuite/ld-elf/dt-relr-2c.d: Likewise. * testsuite/ld-elf/dt-relr-2d.d: Likewise. * testsuite/ld-elf/dt-relr-2e.d: Likewise. * testsuite/ld-elf/dt-relr-2f.d: Likewise. * testsuite/ld-elf/dt-relr-2g.d: Likewise. * testsuite/ld-elf/dt-relr-2h.d: Likewise. * testsuite/ld-elf/dt-relr-3a.d: Likewise. * testsuite/ld-elf/dt-relr-3b.d: Likewise.
2022-01-12elf: Support DT_RELR in linker testsH.J. Lu1-0/+40
Allow eabling and disabling DT_RELR in linker tests. Disable DT_RELR in linker tests which don't expect DT_RELR in linker outputs. binutils/ * testsuite/lib/binutils-common.exp (run_dump_test): Make DT_RELR_LDFLAGS and NO_DT_RELR_LDFLAGS global. ld/ * testsuite/config/default.exp (DT_RELR_LDFLAGS): New. (DT_RELR_CC_LDFLAGS): Likewise. (NO_DT_RELR_LDFLAGS): Likewise. (NO_DT_RELR_CC_LDFLAGS): Likewise. * testsuite/ld-elf/shared.exp: Pass $NO_DT_RELR_LDFLAGS to linker for some tests. * testsuite/ld-i386/export-class.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-i386/ibt-plt-2a.d: Pass $NO_DT_RELR_LDFLAGS to linker. * testsuite/ld-i386/ibt-plt-3a.d: Likewise. * testsuite/ld-i386/ibt-plt-3c.d: Likewise. * testsuite/ld-i386/pr26869.d: Likewise. * testsuite/ld-i386/report-reloc-1.d: Likewise. * testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64.d: Likewise. * testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a.d: Likewise. * testsuite/ld-x86-64/ilp32-4.d: Likewise. * testsuite/ld-x86-64/load1c.d: Likewise. * testsuite/ld-x86-64/load1d.d: Likewise. * testsuite/ld-x86-64/pr13082-2b.d: Likewise. * testsuite/ld-x86-64/pr14207.d: Likewise. * testsuite/ld-x86-64/pr18176.d: Likewise. * testsuite/ld-x86-64/pr19162.d: Likewise. * testsuite/ld-x86-64/pr19636-2d.d: Likewise. * testsuite/ld-x86-64/pr19636-2l.d: Likewise. * testsuite/ld-x86-64/pr20253-1d.d: Likewise. * testsuite/ld-x86-64/pr20253-1f.d: Likewise. * testsuite/ld-x86-64/pr20253-1j.d: Likewise. * testsuite/ld-x86-64/pr20253-1l.d: Likewise. * testsuite/ld-x86-64/report-reloc-1-x32.d: Likewise. * testsuite/ld-x86-64/report-reloc-1.d: Likewise. * testsuite/ld-x86-64/export-class.exp (x86_64_export_class_test): Pass $NO_DT_RELR_LDFLAGS to linker. * testsuite/ld-x86-64/x86-64.exp: Pass $NO_DT_RELR_LDFLAGS to linker for some tests.
2022-01-02Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
2021-09-03CC_FOR_TARGET et alAlan Modra1-12/+15
The top level Makefile, the ld Makefile and others, define CC_FOR_TARGET to be a compiler for the binutils target machine. This is the compiler that should be used for almost all tests with C source. There are _FOR_TARGET versions of CFLAGS, CXX, and CXXFLAGS too. This was all supposed to work with the testsuite .exp files using CC for the target compiler, and CC_FOR_HOST for the host compiler, with the makefiles passing CC=$CC_FOR_TARGET and CC_FOR_HOST=$CC to the runtest invocation. One exception to the rule of using CC_FOR_TARGET is the native-only ld bootstrap test, which uses the newly built ld to link a copy of itself. Since the files being linked were created with the host compiler, the boostrap test should use CC and CFLAGS, in case some host compiler option provides needed libraries automatically. However, bootstrap.exp used CC where it should have used CC_FOR_HOST. I set about fixing that problem, then decided that playing games in the makefiles with CC was a bad idea. Not only is it confusing, but other dejagnu code knows about CC_FOR_TARGET. See dejagnu/target.exp. So this patch gets rid of the makefile variable renaming and changes all the .exp files to use the correct _FOR_TARGET variables. CC_FOR_HOST and CFLAGS_FOR_HOST disappear. A followup patch will correct bootstrap.exp to use CFLAGS, and a number of other things I noticed. binutils/ * testsuite/lib/binutils-common.exp (run_dump_test): Use CC_FOR_TARGET and CFLAGS_FOR_TARGET rather than CC and CFLAGS. ld/ * Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET and similar. Pass variables with unchanged names. Don't set CC_FOR_HOST or CFLAGS_FOR_HOST. * Makefile.in: Regenerate. * testsuite/config/default.exp: Update default CC and similar. (compiler_supports, plug_opt): Use CC_FOR_TARGET. * testsuite/ld-cdtest/cdtest.exp: Replace all uses of CC with CC_FOR_TARGET, and similarly for CFLAGS, CXX and CXXFLAGS. * testsuite/ld-auto-import/auto-import.exp: Likewise. * testsuite/ld-cygwin/exe-export.exp: Likewise. * testsuite/ld-elf/dwarf.exp: Likewise. * testsuite/ld-elf/indirect.exp: Likewise. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-elfcomm/elfcomm.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-mn10300/mn10300.exp: Likewise. * testsuite/ld-pe/pe-compile.exp: Likewise. * testsuite/ld-pe/pe-run.exp: Likewise. * testsuite/ld-pe/pe-run2.exp: Likewise. * testsuite/ld-pie/pie.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-scripts/crossref.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-sh/sh.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-undefined/undefined.exp: Likewise. * testsuite/ld-unique/unique.exp: Likewise. * testsuite/ld-x86-64/tls.exp: Likewise. * testsuite/lib/ld-lib.exp: Likewise. libctf/ * Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET. Pass CC and CC_FOR_TARGET. Don't set CC_FOR_HOST. * Makefile.in: Regenerate. * testsuite/config/default.exp: Update default CC and similar. * testsuite/lib/ctf-lib.exp (run_native_host_cmd): Use CC rather than CC_FOR_HOST. (run_lookup_test): Use CC_FOR_TARGET and CFLAGS_FOR_TARGET.
2021-07-05ld: Cache and reuse the IR archive file descriptorH.J. Lu1-0/+4
Linker plugin_object_p opens the IR archive for each IR archive member. For GCC plugin, plugin_object_p closes the archive file descriptor. But for LLVM plugin, the archive file descriptor remains open. If there are 3000 IR archive members, there are 3000 file descriptors for them. We can run out of file descriptors petty easily. 1. Add archive_plugin_fd and archive_plugin_fd_open_count to bfd so that we can cache and reuse the IR archive file descriptor for all IR archive members in the archive. 2. Add bfd_plugin_close_file_descriptor to properly close the IR archive file descriptor. bfd/ PR ld/28040 * archive.c (_bfd_archive_close_and_cleanup): Close the archive plugin file descriptor if needed. * bfd.c (bfd): Add archive_plugin_fd and archive_plugin_fd_open_count. * opncls.c (_bfd_new_bfd): Initialize to -1. * plugin.c (bfd_plugin_open_input): Cache and reuse the archive plugin file descriptor. (bfd_plugin_close_file_descriptor): New function. (try_claim): Call bfd_plugin_close_file_descriptor. * plugin.h (bfd_plugin_close_file_descriptor): New. * bfd-in2.h: Regenerated. ld/ PR ld/28040 * plugin.c (plugin_input_file): Add ibfd. (release_plugin_file_descriptor): New function. (release_input_file): Call release_plugin_file_descriptor to close input->fd. (plugin_object_p): Call release_plugin_file_descriptor to close input->fd. Also call release_plugin_file_descriptor if not claimed. * testsuite/config/default.exp (RANLIB): New. * testsuite/ld-plugin/lto.exp: Run ranlib test.
2021-01-14ld: tests: add -msim when testing bfin targetsMike Frysinger1-0/+5
The Blackfin ELF compiler requires the user to explicitly select a CPU target else it will fail: bfin-elf-gcc: error: no processor type specified for linking Select the sim target for these tests since we should (hopefully) have access to the simulator. At least, it's more likely than having access to a real development board. This makes the pass/fail numbers increase by a lot: -# of expected passes 398 -# of unexpected failures 6 +# of expected passes 587 +# of unexpected failures 109 It looks like the vast majority of new failures are due to our omission of COPY relocations: /* Bfin does not currently have a COPY reloc. */ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) { _bfd_error_handler (_("the bfin target does not currently support the generation of copy relocations")); return FALSE; } There doesn't seem to be a way to easily disable tests that cause copy relocations though, lets just take the hit for now. * testsuite/config/default.exp [bfin*-elf*] (gcc_B_opt): Append -msim.
2021-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2020-12-16ld: Skip libdep plugin if not all plugin hooks are availableH.J. Lu1-0/+8
Skip plugin if not all required plugin hooks are available. 2020-12-16 Howard Chu <hyc@symas.com> H.J. Lu <hongjiu.lu@intel.com> PR ld/27081 * libdep_plugin.c (onload): Skip if not all required plugin hooks are available. * testsuite/config/default.exp (dep_plug_opt): New. * testsuite/ld-elf/elf.exp: Pass $dep_plug_opt to nm. * testsuite/ld-elf/pr26391.fd: New file.
2020-10-23ld: Set plug_opt only if compiler is availableH.J. Lu1-12/+14
* testsuite/config/default.exp (plug_opt): Set only if compiler is available.
2020-10-22ld: Skip bootstrap tests for -fprofile-generate=H.J. Lu1-0/+17
Make plug_opt available to all linker tests. Skip bootstrap tests when linker is compiled with -fprofile-generate=. * testsuite/ld-plugin/lto.exp (plug_opt): Moved to ... * testsuite/config/default.exp (plug_opt): Here. New. * testsuite/ld-bootstrap/bootstrap.exp: Skip when linker is compiled with -fprofile-generate=.
2020-10-22ld: Pass -fno-lto to non LTO testsH.J. Lu1-0/+7
* testsuite/config/default.exp (NOLTO_CFLAGS): New. * ld/testsuite/ld-elfcomm/elfcomm.exp: Add $NOLTO_CFLAGS to CC. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-scripts/crossref.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-undefined/undefined.exp: Likewise. * testsuite/ld-srec/srec.exp: Add $NOLTO_CFLAGS to CC. Override CXXFLAGS. * testsuite/lib/ld-lib.exp (run_ld_link_tests): Prepend -fno-lto to cflags.
2020-10-19Provide dummy libraries for alpha-vmsAlan Modra1-259/+63
alpha-dec-vms always loads a number of libraries, -limagelib, -lstarlet, and -lsys$public_vectors. When running the ld testsuite without a full cross-build environment, those libraries are missing and cause fails. This patch provides dummies, and tidies default.exp a little. * testsuite/config/default.exp: Provide dummy libraries for alpha-dec-vms. (compiler_supports): New proc. Use it for compiler tests. * testsuite/lib/ld-lib.exp (default_ld_assemble): Don't die if subdir not set. (run_ld_link_tests): Pass LDFLAGS to ld. * testsuite/ld-checks/checks.exp (section_check): Likewise. * testsuite/ld-scripts/assert.exp: Likewise. * testsuite/ld-scripts/extern.exp: Likewise. * testsuite/ld-scripts/log2.exp: Likewise. * testsuite/ld-scripts/map-address.exp: Likewise. * testsuite/ld-scripts/script.exp: Likewise. * testsuite/ld-scripts/sizeof.exp: Likewise.
2020-09-03ld: Change NOSANTIZE_CFLAGS to NOSANITIZE_CFLAGSH.J. Lu1-5/+5
* testsuite/config/default.exp: Change NOSANTIZE_CFLAGS to NOSANITIZE_CFLAGS. * testsuite/ld-elf/dwarf.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-elfcomm/elfcomm.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-scripts/crossref.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-size/size.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise.
2020-06-19Emit a warning when -z relro is unsupportedAlan Modra1-3/+0
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-04tcl global directive outside proc body does nothing (ld)Alan Modra1-1/+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-03ld: Pass -fno-sanitize=all to tests with linkerH.J. Lu1-0/+38
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.
2020-04-17 Commit: Running the linker testsuite with clangNick Clifton1-0/+50
* testsuite/config/default.exp: If not already set then create the CCC_OVERRIDE_OPTIONS environment variable to help when running the testsuite with clang. * testsuite/ld-elf/pr22269-1.c: Add a missing return statement. * testsuite/ld-elfvers/vers.exp: Add checks to detect if files were built before attempting to copy them.
2020-04-02NOCF_PROTECTION_CFLAGS: Replace nopie with availableH.J. Lu1-3/+3
* testsuite/config/default.exp (NOCF_PROTECTION_CFLAGS): Replace nopie with available.
2020-04-02ld: Add NOCF_PROTECTION_CFLAGS to turn off -fcf-protectionH.J. Lu1-0/+38
GCC in Ubuntu 20.04 enables -fcf-protection by default, which leads to FAIL: S-records FAIL: S-records with constructors FAIL: Build plt-main with -z bndplt FAIL: Build plt-main with PIE and -z bndplt FAIL: Build plt-main with -z bndplt -z now FAIL: Build plt-main with PIE and -z bndplt -z now on x86-64. Add NOCF_PROTECTION_CFLAGS to pass -fcf-protection=none on these tests. * testsuite/config/default.exp (NOCF_PROTECTION_CFLAGS): New. Set to "-fcf-protection=none" if target compiler supports it. * testsuite/ld-srec/srec.exp: Add $NOCF_PROTECTION_CFLAGS to CC and CXX. * testsuite/ld-x86-64/x86-64.exp: Add $NOCF_PROTECTION_CFLAGS to PLT BND tests.
2020-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2019-04-24Use better test for usable compiler in ld testsuite.Sandra Loosemore1-6/+6
The ld testsuite includes numerous tests that depend on being able to compile and link programs with the C compiler. Some of these tests use [which $CC] to check for the presence of the compiler before proceeding with the test, but run_ld_link_exec_tests and run_cc_link_tests give ERRORs if compilation fails. Also, even if $CC is defined and present, it may not be usable due to missing libraries, etc. This patch adds a new procedure check_compiler_available that attempts to build an empty program and caches the result. Uses of [which $CC] are replaced with calls to this procedure, and run_ld_link_exec_tests and run_cc_link_tests now also guard attempts to use $CC. 2019-04-24 Sandra Loosemore <sandra@codesourcery.com> ld/ * testsuite/config/default.exp: Use [check_compiler_available] instead of [which $CC]. * testsuite/ld-auto-import/auto-import.exp: Likewise. * testsuite/ld-cygwin/exe-export.exp: Likewise. * testsuite/ld-elf/audit.exp: Likewise. * testsuite/ld-elf/compress.exp: Likewise. * testsuite/ld-elf/dwarf.exp: Likewise. * testsuite/ld-elf/elf.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/wrap.exp: Likewise. * testsuite/ld-elfcomm/elfcomm.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-i386/no-plt.exp: Likewise. * testsuite/ld-i386/tls.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-mn10300/mn10300.exp: Likewise. * testsuite/ld-pe/pe-compile.exp: Likewise. * testsuite/ld-pe/pe-run.exp: Likewise. * testsuite/ld-pe/pe-run2.exp: Likewise. * testsuite/ld-pie/pie.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-scripts/crossref.exp: Likewise. * testsuite/ld-sh/sh.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-size/size.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-undefined/undefined.exp: Likewise. * testsuite/ld-unique/unique.exp: Likewise. * testsuite/ld-x86-64/mpx.exp: Likewise. * testsuite/ld-x86-64/no-plt.exp: Likewise. * testsuite/ld-x86-64/tls.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Call check_compiler_available before trying to use the compiler. (run_cc_link_tests): Likewise. (check_compiler_available): New. Use it instead of [which $CC].
2019-04-11ld: Add -static-pie testsH.J. Lu1-0/+37
Add -static-pie tests for DT_INIT_ARRAY, DT_FINI_ARRAY, DT_PREINIT_ARRAY and IFUNC. * testsuite/config/default.exp (STATIC_PIE_LDFLAGS): New. Set to "-static-pie" if target compiler supports it. * testsuite/ld-elf/elf.exp: Run -static-pie tests if $STATIC_PIE_LDFLAGS isn't empty. * testsuite/ld-ifunc/ifunc.exp: Likewise.
2019-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2018-11-06elfedit: Add --enable-x86-feature/--disable-x86-featureH.J. Lu1-0/+4
Add --enable-x86-feature and --disable-x86-feature options to elfedit to set and clear the IBT and SHSTK bits in program property in ELF executables and shared objects. binutils/ * doc/binutils.texi: Document --enable-x86-feature and --disable-x86-feature options for elfedit. * elfedit.c: Include "config.h" and <sys/mman.h>. (enable_x86_features): New. (disable_x86_features): Likewise. (update_gnu_property): Likewise. (elf_x86_feature): Likewise. (process_file): Call update_gnu_property on ET_EXEC or ET_DYN file. (command_line_switch): Add OPTION_ENABLE_X86_FEATURE and OPTION_DISABLE_X86_FEATURE. (options): Add--enable-x86-feature and --disable-x86-feature. (usage): Likewise. (main): Handle OPTION_ENABLE_X86_FEATURE and OPTION_DISABLE_X86_FEATURE. ld/ * testsuite/config/default.exp (ELFEDIT): New. * testsuite/ld-elf/linux-x86.exp (elfedit_test): New proc. Run elfedit tests. * testsuite/ld-elf/x86-feature-1a.rd: New file. * testsuite/ld-elf/x86-feature-1b.rd: Likewise. * testsuite/ld-elf/x86-feature-1c.rd: Likewise. * testsuite/ld-elf/x86-feature-1d.rd: Likewise. * testsuite/ld-elf/x86-feature-1e.rd: Likewise.
2018-01-29ld: Skip unsupported static executable testsH.J. Lu1-0/+37
Skip static executable tests if static executable is unsupported. Tested on Linux/x86 without libc.a. PR ld/22732 * testsuite/config/default.exp (STATIC_LDFLAGS): New. Set to "-static" if target compiler supports it. * testsuite/ld-bootstrap/bootstrap.exp: Skip static executable tests if target compiler doesn't support it. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Likewise. (run_cc_link_tests): Likewise.
2018-01-27Add a testcase for PR ld/22751H.J. Lu1-0/+37
Since dummy.o must be placed before -Wl,--whole-archive tmpdir/pr22751.a -Wl,--no-whole-archive to trigger the bug, this patch adds an optional trailing ld options to run_ld_link_exec_tests. PR ld/22751 * testsuite/config/default.exp (INT128_CFLAGS): New. * testsuite/ld-plugin/lto.exp (INT128_CFLAGS): New. Run ld/22751 tests. * testsuite/ld-plugin/pr22751.c: New file. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Add ld trailing options.
2018-01-03Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2017-11-20Fix handling of GNU Property notes that are not in a GNU NOTE PROPERTY section.Nick Clifton1-1/+1
PR 22450 gas * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip objects without a GNU_PROPERTY note section when looking for a bfd onto which notes can be accumulated. ld * testsuite/ld-elf/elf.exp: Add --defsym ALIGN=2|3 to assembler command line depending upon the size of the target address space. * testsuite/ld-elf/pr22450.s: New test file. * testsuite/ld-elf/pr22450.d: New test driver. * testsuite/config/default.exp: Add note that LD_CLASS refers to the size of the host linker not the size of the target linker.
2017-08-09LD_CLASS: Check .libs/ld-new for linker firstH.J. Lu1-1/+2
When --enable-shared is used, ./ld-new may be a shell script and the real linker is .libs/ld-new. We should check .libs/ld-new first. * testsuite/config/default.exp (LD_CLASS): Check .libs/ld-new for linker first.
2017-08-09Run PR ld/17618 test only with 64-bit ELF linkerH.J. Lu1-0/+10
PR ld/17618 test requires 64-bit linker to run. Set LD_CLASS to "64bit" for 64-bit ELF linker and run PR ld/17618 test only if $LD_CLASS is "64bit". More checks can be added to support 64-bit linkers in non-ELF format. * testsuite/config/default.exp (LD_CLASS): New. Set to "64bit" for 64-bit ELF linker. * testsuite/ld-x86-64/pr17618.d (#notarget): Removed. * testsuite/ld-x86-64/x86-64.exp: Run pr17618 only for 64-bit linker.
2017-04-28x86: Add run-time tests for -mtls-dialect=gnu2H.J. Lu1-0/+37
* testsuite/config/default.exp (GNU2_CFLAGS): New. Set to -mtls-dialect=gnu2 if target compiler supports it. * testsuite/ld-i386/tls.exp: Run -mtls-dialect=gnu2 tests. * testsuite/ld-x86-64/tls.exp: Likewise. * testsuite/ld-i386/tlsdesc1a.c: New file. * testsuite/ld-i386/tlsdesc1b.c: Likewise. * testsuite/ld-x86-64/tlsdesc1a.c: Likewise. * testsuite/ld-x86-64/tlsdesc1b.c: Likewise.
2017-01-02Run more ld tests when not nativeAlan Modra1-35/+0
Many of the ld tests are not run for cross builds, in some cases because the test needs to run a newly linked executable, and in others simply because it was easier to write the test for native only. Even when a test needs to run, it's good to compile and link to exercise the linker. So that's what this patch does. I've also rid us of the old ld_link procedure with all the HOSTING_CRT0 etc. setup. It's much simpler to just link with $CC. This does mean that a cross build with cross-compiler installed but no cross C-library will give lots of failures. If that turns out to be too annoying, I guess we can write a tcl procedure to detect it and not run all the extra tests. * Makefile.am (bootstrap): Delete rule. (ld-partial, ld1, ld1-full, ld2, ld3): Likewise. (HOSTING_CRT0, HOSTING_SCRT0): Don't define. (HOSTING_LIBS, HOSTING_SLIBS, HOSTING_EMU): Likewise. * configure.ac (HOSTING_CRT0, HOSTING_SCRT0): Don't define. (HOSTING_LIBS, HOSTING_SLIBS): Likewise. * configure.host (HOSTING_CRT0, HOSTING_LIBS): Don't define. * Makefile.in: Regenerate. * configure: Regenerate. * testsuite/config/default.exp (get_link_files): Delete. (HOSTING_CRT0, HOSTING_SCRT0, HOSTING_LIBS, HOSTING_SLIBS): Don't define. (ld_simple_link): Delete. * testsuite/lib/ld-lib.exp (default_ld_link): Delete (default_ld_simple_link): Rename to default_ld_link. (ld_simple_link_defsyms): Rename to ld_link_defsyms. (run_ld_link_tests): Use ld_link, not ld_simple_link. (run_cc_link_tests): Likewise. (run_ld_link_exec_tests): Use $CC or $CXX to link, not $ld. Don't run exe when not native, and return unsupported. * testsuite/ld-bootstrap/bootstrap.exp: Create gccld1 etc. dirs. Link ld1 etc. using $CC. * testsuite/ld-cdtest/cdtest.exp: Link cdtest using $CC. * testsuite/ld-checks/checks.exp: Use ld_link, not ld_simple_link. * testsuite/ld-cygwin/exe-export.exp: Likewise. * testsuite/ld-elf/binutils.exp: Likewise. * testsuite/ld-elf/eh-group.exp: Likewise. * testsuite/ld-elf/exclude.exp: Likewise. * testsuite/ld-elf/frame.exp: Likewise. * testsuite/ld-elf/sec-to-seg.exp: Likewise. * testsuite/ld-elf/tls_common.exp: Likewise. * testsuite/ld-elfcomm/elfcomm.exp: Likewise. * testsuite/ld-fastcall/fastcall.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-ifunc/binutils.exp: Likewise. * testsuite/ld-mep/mep.exp: Likewise. * testsuite/ld-mips-elf/mips-elf-flags.exp: Likewise. * testsuite/ld-mn10300/mn10300.exp: Likewise. * testsuite/ld-nios2/nios2.exp: Likewise. * testsuite/ld-pe/pe-compile.exp: Likewise. * testsuite/ld-pe/pe-run.exp: Likewise. * testsuite/ld-pe/pe-run2.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-scripts/align.exp: Likewise. * testsuite/ld-scripts/alignof.exp: Likewise. * testsuite/ld-scripts/assert.exp: Likewise. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/extern.exp: Likewise. * testsuite/ld-scripts/log2.exp: Likewise. * testsuite/ld-scripts/map-address.exp: Likewise. * testsuite/ld-scripts/phdrs.exp: Likewise. * testsuite/ld-scripts/phdrs2.exp: Likewise. * testsuite/ld-scripts/script.exp: Likewise. * testsuite/ld-scripts/section-flags.exp: Likewise. * testsuite/ld-scripts/sizeof.exp: Likewise. * testsuite/ld-scripts/sysroot-prefix.exp: Likewise. * testsuite/ld-scripts/weak.exp: Likewise. * testsuite/ld-selective/selective.exp: Likewise. * testsuite/ld-sh/sh.exp: Likewise. * testsuite/ld-sh/sh64/relax.exp: Likewise. * testsuite/ld-sh/sh64/relfail.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-tic6x/tic6x.exp: Likewise. * testsuite/ld-undefined/weak-undef.exp: Likewise. * testsuite/ld-versados/versados.exp: Likewise. * testsuite/ld-x86-64/dwarfreloc.exp: Likewise. * testsuite/ld-xtensa/coalesce.exp: Likewise. * testsuite/ld-xtensa/diff_overflow.exp: Likewise. * testsuite/ld-xtensa/lcall.exp: Likewise. * testsuite/ld-elf/audit.exp: Run non-native too. * testsuite/ld-elf/compress.exp: Likewise. Replace ld options with gcc -Wl, options. * testsuite/ld-elf/dwarf.exp: Run non-native too. Use ld_link, not ld_simple_link. Add -Wl,--no-as-needed to some tests. * testsuite/ld-elf/elf.exp: Run non-native too. Formatting. * testsuite/ld-elf/indirect.exp: Run non-native too. Add -Wl,--no-as-needed to most tests. * testsuite/ld-elf/shared.exp: Run non-native too. Use braces to simplify quoting. Set run_tests using [list] rather than brace assignment to expand $extralibs. Add -Wl,--no-as-needed to many test. Prefix ld options with -Wl,. (mix_pic_and_non_pic): Don't run exe if not native. * testsuite/ld-elf/wrap.exp: Run non-native too. Add -Wl,--no-as-needed and prefix ld options with -Wl,. * testsuite/ld-elfvers/vers.exp: Run non-native too. Use ld_link, not ld_simple_link. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. (visibility_test): Don't run exe if not native. * testsuite/ld-elfweak/elfweak.exp: Run non-native too. Use ld_link, not ld_simple_link. (build_exec): Don't run exe if not native. * testsuite/ld-ifunc/ifunc.exp: Run non-native too. Use ld_link, not ld_simple_link. Link using $CC. Add -Wl,--no-as-needed to some tests and prefix ld options with -Wl,. Expect GNU for hppa-linux even when no ifuncs. Delete cleanup. * testsuite/ld-pie/pie.exp: Run non-native too. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. Use ld_link, not ld_simple_link. (shared_test): Don't run exe if not native. * testsuite/ld-size/size.exp: Run non-native too. Add -Wl,--no-as-needed to some tests. Prefix ld options with -Wl,. * testsuite/ld-unique/unique.exp: Run non-native too. Use ld_link, not ld_simple_link. Link using $CC. Add -Wl,--no-as-needed to some tests and prefix ld options with -Wl,. Expect GNU for hppa-linux even when no unique syms. Delete cleanup. * testsuite/ld-x86-64/tls.exp: Add -Wl,--no-as-needed to some tests and prefix ld options with -Wl,. * testsuite/ld-x86-64/x86-64.exp: Use ld_link, not ld_simple_link. Add -Wl,--no-as-needed to some tests. Prefix ld options with -Wl,.
2017-01-02Update year range in copyright notice of all files.Alan Modra1-1/+1
2016-06-22ld: Add a linker configure option --enable-relroH.J. Lu1-0/+3
Add a configure option --enable-relro to decide whether -z relro should be enabled in ELF linker by default. Default to yes for all Linux targets, except FRV, HPPA, IA64 and MIPS, since many relro tests fail on these targets. PR ld/20283 * NEWS: Mention --enable-relro. * configure.ac: Add --enable-relro. (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro. * configure.tgt (ac_default_ld_z_relro): Default it to 1 for some Linux targets. * config.in: Regenerated. * configure: Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set link_info.relro to DEFAULT_LD_Z_RELRO. * testsuite/config/default.exp (ld_elf_shared_opt): New. * testsuite/lib/ld-lib.exp (run_dump_test): Pass $ld_elf_shared_opt to ld for ELF targets with shared object support. (run_ld_link_tests): Likewise.
2016-04-29Download source only on remote hostH.J. Lu1-2/+6
There is no need to download source if we aren't on remote host. Otherwise, each ld test run on local host leaves behind a couple test files. * config/default.exp (NOPIE_CFLAGS): Download source only on remote host. (NOPIE_LDFLAGS): Likewise. * testsuite/lib/ld-lib.exp (check_lto_available): Likewise. (check_lto_fat_available): Likewise. (check_lto_shared_available): Likewise. (check_ifunc_available): Likewise. (check_ifunc_attribute_available): Likewise.
2016-01-01Copyright update for binutilsAlan Modra1-1/+1
2015-10-15objcopy --extract-symbol testcaseAlan Modra1-0/+4
Run the test for more than just ELF. Shows that objcopy --extract-symbol isn't working on PE, mips, mmix and some aout targets. * config/default.exp (size): New global. * ld-elf/extract-symbol-1.s, * ld-elf/extract-symbol-1.ld, * ld-elf/extract-symbol-1sec.d, * ld-elf/extract-symbol-1sym.d: Delete. * ld-scripts/script.exp (extract_symbol_test): New.