diff options
author | Alan Modra <amodra@gmail.com> | 2017-01-03 12:27:19 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-01-03 12:36:02 +1030 |
commit | 8cfc7cf8c273677b5c83290cd1b143f18eeeb9c4 (patch) | |
tree | 44385d19831c833ee20364a2459be6e7ffb8cb74 /ld | |
parent | 4ce6ca2c78c12931c31f46b9390e00a012eaa466 (diff) | |
download | gdb-8cfc7cf8c273677b5c83290cd1b143f18eeeb9c4.zip gdb-8cfc7cf8c273677b5c83290cd1b143f18eeeb9c4.tar.gz gdb-8cfc7cf8c273677b5c83290cd1b143f18eeeb9c4.tar.bz2 |
Add -rpath-link to various tests
Needed for cross-builds without --sysroot, where USE_LIBPATH isn't
set. See elf32.em after_open. Perhap ld ought to look at -rpath in
this case?
* testsuite/ld-elf/shared.exp: Add -rpath-link and -no-as-needed
to various tests.
* testsuite/ld-elfweak/elfweak.exp: Likewise.
* testsuite/ld-elfvers/vers.exp (vers19): Fix -rpath-link option.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/shared.exp | 18 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers.exp | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-elfweak/elfweak.exp | 4 |
4 files changed, 19 insertions, 12 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index d46deef..159b522 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,12 @@ 2017-01-03 Alan Modra <amodra@gmail.com> + * testsuite/ld-elf/shared.exp: Add -rpath-link and -no-as-needed + to various tests. + * testsuite/ld-elfweak/elfweak.exp: Likewise. + * testsuite/ld-elfvers/vers.exp (vers19): Fix -rpath-link option. + +2017-01-03 Alan Modra <amodra@gmail.com> + * testsuite/ld-elf/elf.exp: Check that $CC exists before C tests. * testsuite/ld-pie/pie.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 52baadd..aac3acc 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -190,16 +190,16 @@ set build_tests { "-r -nostdlib" "-fPIC" {needed1c.c} {} "libneeded1pic.o"} {"Build needed1a.so with --add-needed" - "-shared tmpdir/libneeded1pic.o -Wl,--add-needed,-rpath=tmpdir,-z,defs -Ltmpdir -lneeded1a" "" + "-shared tmpdir/libneeded1pic.o -Wl,--no-as-needed,--add-needed,-rpath=tmpdir,-rpath-link=tmpdir,-z,defs -Ltmpdir -lneeded1a" "" {dummy.c} {} "needed1a.so"} {"Build needed1b.so with --copy-dt-needed-entries" - "-shared tmpdir/libneeded1pic.o -Wl,--copy-dt-needed-entries,-rpath=tmpdir,-z,defs -Ltmpdir -lneeded1a" "" + "-shared tmpdir/libneeded1pic.o -Wl,--no-as-needed,--copy-dt-needed-entries,-rpath=tmpdir,-rpath-link=tmpdir,-z,defs -Ltmpdir -lneeded1a" "" {dummy.c} {} "needed1b.so"} {"Build needed1a.so with --no-add-needed" - "-shared tmpdir/libneeded1pic.o -Wl,--no-add-needed -Ltmpdir -lneeded1a" "" + "-shared tmpdir/libneeded1pic.o -Wl,--no-as-needed,--no-add-needed -Ltmpdir -lneeded1a" "" {dummy.c} {} "needed1c.so"} {"Build needed1b.so with --no-copy-dt-needed-entries" - "-shared tmpdir/libneeded1pic.o -Wl,--no-copy-dt-needed-entries -Ltmpdir -lneeded1a" "" + "-shared tmpdir/libneeded1pic.o -Wl,--no-as-needed,--no-copy-dt-needed-entries -Ltmpdir -lneeded1a" "" {dummy.c} {} "needed1d.so"} {"Build librel.so" "-shared" "-fPIC" @@ -247,7 +247,7 @@ set build_tests { "" "-fPIC" {pr16496b.c} {} "libpr16496b.a"} {"Build libpr16496b.so" - "-shared tmpdir/pr16496b.o tmpdir/libpr16496a.so" "" + "-shared -Wl,--no-as-needed tmpdir/pr16496b.o tmpdir/libpr16496a.so" "" {dummy.c} {{objdump {-R} pr16496b.od}} "libpr16496b.so"} {"Build libpr16452a.so" "-shared -Wl,-soname,libpr16452a.so,--version-script=pr16452.map" "-fPIC" @@ -256,10 +256,10 @@ set build_tests { "-shared -Wl,-soname,libpr16452b.so,--no-as-needed tmpdir/libpr16452a.so" "-fPIC" {dummy.c} {} "libpr16452b.so"} {"Build pr16452" - "tmpdir/libpr16452b.so -Wl,-rpath=tmpdir" "" + "-Wl,--no-as-needed,-rpath=tmpdir,-rpath-link=tmpdir tmpdir/libpr16452b.so" "" {pr16452b.c} {{objdump {-p} pr16452.od}} "pr16452"} {"Build pr16457" - "tmpdir/libpr16452b.so -Wl,-rpath=tmpdir" "" + "-Wl,--no-as-needed,-rpath=tmpdir,-rpath-link=tmpdir tmpdir/libpr16452b.so" "" {pr16452b.c} {{objdump {-p} pr16457.od}} "pr16457"} {"Build libpr18458a.so" "-shared -Wl,-z,now" "-fPIC" @@ -412,10 +412,10 @@ set run_tests [list \ "-Wl,--as-needed tmpdir/libpr14862-1.o tmpdir/libpr14862.so" "" \ {dummy.c} "pr14862" "pr14862.out" ] \ [list "Link with --add-needed" \ - "tmpdir/libneeded1c.o -Wl,--no-as-needed,--add-needed,-rpath=tmpdir -Ltmpdir -lneeded1a" "" \ + "tmpdir/libneeded1c.o -Wl,--no-as-needed,--add-needed,-rpath=tmpdir,-rpath-link=tmpdir -Ltmpdir -lneeded1a" "" \ {dummy.c} "needed1a" "needed1.out" ] \ [list "Link with --copy-dt-needed-entries" \ - "tmpdir/libneeded1c.o -Wl,--no-as-needed,--copy-dt-needed-entries,-rpath=tmpdir -Ltmpdir -lneeded1a" "" \ + "tmpdir/libneeded1c.o -Wl,--no-as-needed,--copy-dt-needed-entries,-rpath=tmpdir,-rpath-link=tmpdir -Ltmpdir -lneeded1a" "" \ {dummy.c} "needed1b" "needed1.out" ] \ [list "Run relmain" \ "-Wl,--no-as-needed,-rpath=tmpdir -Ltmpdir -lrel" "" \ diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index bd35ae2..5587591 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -909,7 +909,7 @@ build_exec "vers16" vers16.c vers16 "-Wl,--no-as-needed" vers16a.so "" vers16.ds # Test a weak versioned symbol. build_vers_lib_pic "vers17" vers17.c vers17 "" vers17.map vers17.ver vers17.dsym "" build_vers_lib_pic "vers18" vers18.c vers18 vers17.so vers18.map vers18.ver vers18.dsym vers18.sym -build_exec "vers19" vers19.c vers19 "-Wl,-rpath,. -Wl,-rpath-link,--no-as-needed" vers18.so vers19.ver vers19.dsym "" +build_exec "vers19" vers19.c vers19 "-Wl,--no-as-needed,-rpath,.,-rpath-link,." vers18.so vers19.ver vers19.dsym "" build_vers_lib_no_pic "vers20a" vers20.c vers20a "" vers20.map vers20a.ver vers20.dsym "" exec cp $tmpdir/vers20a.so $tmpdir/vers20b.so diff --git a/ld/testsuite/ld-elfweak/elfweak.exp b/ld/testsuite/ld-elfweak/elfweak.exp index e62291e..49b6c56 100644 --- a/ld/testsuite/ld-elfweak/elfweak.exp +++ b/ld/testsuite/ld-elfweak/elfweak.exp @@ -479,8 +479,8 @@ build_exec "ELF weak data first common" foo "main1.o bar1a.o foo1b.o" "" strongd build_exec "ELF weak data last common" foo "foo1b.o main1.o bar1a.o" "" strongdata "" strongcomm.sym build_exec "ELF weak data first DSO" foo "main1.o libbar1a.so libfoo1a.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym "" build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o libbar1a.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym "" -build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym "" -build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-Wl,-rpath,.,--no-as-needed" weakdata weakdata.dsym "" +build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-Wl,--no-as-needed,-rpath,.,-rpath-link,." weakdata weakdata.dsym "" +build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-Wl,--no-as-needed,-rpath,.,-rpath-link,." weakdata weakdata.dsym "" if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/size_foo.c $tmpdir/size_foo.o] { unresolved "ELF weak (size)" |