From: Andreas Tobler <andreast-list@fgznet.ch>
To: binutils@sourceware.org
Subject: [PATCH] LD testsuite, ld-elf/shared.exp
Date: Sun, 04 May 2014 20:53:00 -0000 [thread overview]
Message-ID: <5366A8B3.4070002@fgznet.ch> (raw)
[-- Attachment #1: Type: text/plain, Size: 476 bytes --]
Hello all,
the patch below introduces a mechanism to control if we have to link
against -ldl in ld-elf/shared.exp.
On FreeBSD we do not want to link against -ldl, not needed. Right now it
produces a warning which makes the tests fail who link against -ldl.
Ok?
Thanks,
Andreas
2014-05-04 Andreas Tobler <andreast@fgznet.ch>
* ld-elf/shared.exp: Introduce the extralibs variable to control
the libraries to be linked. Don't link -ldl on *-*-freebsd*.
[-- Attachment #2: shared.exp.diff --]
[-- Type: text/plain, Size: 3282 bytes --]
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 9a17953..0763cd4 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -37,6 +37,11 @@ if { [which $CC] == 0 } {
return
}
+# Add -ldl to extralibs if needed
+if { ![istarget *-*-freebsd*]} {
+ set extralibs "-ldl"
+}
+
set build_tests {
{"Build libfoo.so"
"-shared" "-fPIC"
@@ -275,10 +280,10 @@ set run_tests {
"tmpdir/libbarhfoov.so tmpdir/libfoov.so" ""
{main.c} "hidden" "hidden.out"}
{"Run dl1a with --dynamic-list=dl1.list and dlopen on libdl1.so"
- "--dynamic-list=dl1.list -ldl" ""
+ "--dynamic-list=dl1.list $extralibs" ""
{dl1main.c} "dl1a" "dl1.out"}
{"Run dl1b with --dynamic-list-data and dlopen on libdl1.so"
- "--dynamic-list-data -ldl" ""
+ "--dynamic-list-data $extralibs" ""
{dl1main.c} "dl1b" "dl1.out"}
{"Run with libdl2a.so"
"tmpdir/libdl2a.so" ""
@@ -308,37 +313,37 @@ set run_tests {
"tmpdir/libdl4f.so" ""
{dl4main.c} "dl4f" "dl4a.out"}
{"Run dl6a1 with --dynamic-list-data and dlopen on libdl6a.so"
- "--dynamic-list-data -ldl" ""
+ "--dynamic-list-data $extralibs" ""
{dl6amain.c} "dl6a1" "dl6a.out"}
{"Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so"
- "-Bsymbolic-functions -ldl" ""
+ "-Bsymbolic-functions $extralibs" ""
{dl6amain.c} "dl6a2" "dl6b.out"}
{"Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so"
- "-Bsymbolic -ldl" ""
+ "-Bsymbolic $extralibs" ""
{dl6amain.c} "dl6a3" "dl6b.out"}
{"Run dl6a4 with -Bsymbolic --dynamic-list-data and dlopen on libdl6a.so"
- "-Bsymbolic --dynamic-list-data -ldl" ""
+ "-Bsymbolic --dynamic-list-data $extralibs" ""
{dl6amain.c} "dl6a4" "dl6a.out"}
{"Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on libdl6a.so"
- "-Bsymbolic-functions --dynamic-list-cpp-new -ldl" ""
+ "-Bsymbolic-functions --dynamic-list-cpp-new $extralibs" ""
{dl6amain.c} "dl6a5" "dl6b.out"}
{"Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on libdl6a.so"
- "--dynamic-list-cpp-new -Bsymbolic-functions -ldl" ""
+ "--dynamic-list-cpp-new -Bsymbolic-functions $extralibs" ""
{dl6amain.c} "dl6a6" "dl6b.out"}
{"Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so"
- "--dynamic-list-data -Bsymbolic -ldl" ""
+ "--dynamic-list-data -Bsymbolic $extralibs" ""
{dl6amain.c} "dl6a7" "dl6a.out"}
{"Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so"
- "--dynamic-list-data -ldl" ""
+ "--dynamic-list-data $extralibs" ""
{dl6bmain.c} "dl6b1" "dl6a.out"}
{"Run dl6b2 with dlopen on libdl6b.so"
- "-ldl" ""
+ "$extralibs" ""
{dl6bmain.c} "dl6b2" "dl6b.out"}
{"Run dl6c1 with --dynamic-list-data and dlopen on libdl6c.so"
- "--dynamic-list-data -ldl" ""
+ "--dynamic-list-data $extralibs" ""
{dl6cmain.c} "dl6c1" "dl6b.out"}
{"Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so"
- "--dynamic-list-data -ldl" ""
+ "--dynamic-list-data $extralibs" ""
{dl6dmain.c} "dl6d1" "dl6b.out"}
{"Run with libdata1.so"
"tmpdir/libdata1.so" ""
next reply other threads:[~2014-05-04 20:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 20:53 Andreas Tobler [this message]
2014-05-16 14:53 ` Nicholas Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5366A8B3.4070002@fgznet.ch \
--to=andreast-list@fgznet.ch \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).