aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-01-06 16:24:23 +0000
committerNick Clifton <nickc@redhat.com>2020-01-06 16:24:23 +0000
commit0e1f1593bc441863d0e5dc586ca3dd8945d36782 (patch)
tree7e7af261d7e7a2d2da9c4271a8599b5d6b724c99 /ld
parent8b7fcda2744145f2380af01c9db8e11986f7af6d (diff)
downloadfsf-binutils-gdb-0e1f1593bc441863d0e5dc586ca3dd8945d36782.zip
fsf-binutils-gdb-0e1f1593bc441863d0e5dc586ca3dd8945d36782.tar.gz
fsf-binutils-gdb-0e1f1593bc441863d0e5dc586ca3dd8945d36782.tar.bz2
Add -fcommon compiler command line option to linker tests that need common symbols.
PR 25327 * testsuite/ld-elf/shared.exp: Add -fcommon option to compiler command line when building libcomm1.o and pr13250 tests. * testsuite/ld-plugin/lto.exp: Likewise for pr20267 tests.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/testsuite/ld-elf/shared.exp12
-rw-r--r--ld/testsuite/ld-plugin/lto.exp20
3 files changed, 23 insertions, 16 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index fa7534d..a987193 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,12 @@
2020-01-06 Nick Clifton <nickc@redhat.com>
+ PR 25327
+ * testsuite/ld-elf/shared.exp: Add -fcommon option to compiler
+ command line when building libcomm1.o and pr13250 tests.
+ * testsuite/ld-plugin/lto.exp: Likewise for pr20267 tests.
+
+2020-01-06 Nick Clifton <nickc@redhat.com>
+
PR 25326
* testsuite/ld-elf/shared.exp: Add -fcommon option to compiler
command line when building pr19579 binaries.
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 7852890..e03906a 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -603,7 +603,7 @@ set build_tests {
"-shared" "-fPIC"
{data2.c} {} "libdata2.so"}
{"Build libcomm1.o"
- "-r -nostdlib" ""
+ "-r -nostdlib" "-fcommon"
{comm1.c} {} "libcomm1.o"}
{"Build libfunc1.so"
"-shared" "-fPIC"
@@ -634,16 +634,16 @@ set build_tests {
"-r -nostdlib" ""
{pr11138-2.c} {} "libpr11138-2.o"}
{"Build pr13250-1.so"
- "-shared" "-fPIC"
+ "-shared" "-fPIC -fcommon"
{pr13250-1.c} {} "libpr13250-1.so"}
{"Build pr13250-2.so with libpr13250-1.so"
- "-shared -Wl,--no-as-needed tmpdir/libpr13250-1.so" "-fPIC"
+ "-shared -Wl,--no-as-needed tmpdir/libpr13250-1.so" "-fPIC -fcommon"
{pr13250-2.c} {} "libpr13250-2.so"}
{"Build libpr13250-3.o"
- "-r -nostdlib" ""
+ "-r -nostdlib" "-fcommon"
{pr13250-3.c} {} "libpr13250-3.o"}
{"Build libpr14323-2.so"
- "-shared" "-fPIC"
+ "-shared" "-fPIC -fcommon"
{pr14323-2.c} {} "libpr14323-2.so"}
{"Build pr14862-1.o"
"-r -nostdlib" ""
@@ -879,7 +879,7 @@ set run_tests [list \
"-Wl,--no-as-needed,--version-script=pr11138-2.map tmpdir/libpr11138-1.so tmpdir/pr11138-2.o" "" \
{dummy.c} "pr11138b" "pr11138.out" ] \
[list "Run with pr13250-3.c, libpr13250-1.so and libpr13250-2.so" \
- "-Wl,--as-needed tmpdir/pr13250-3.o tmpdir/libpr13250-1.so tmpdir/libpr13250-2.so" "" \
+ "-Wl,--as-needed tmpdir/pr13250-3.o tmpdir/libpr13250-1.so tmpdir/libpr13250-2.so" "-fcommon" \
{dummy.c} "pr13250" "pass.out" ] \
[list "Run with pr14323-1.c pr14323-2.so" \
"-Wl,--no-as-needed tmpdir/libpr14323-2.so" "" \
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index cf30ab5..9b03b7b3 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -192,19 +192,19 @@ set lto_link_tests [list \
"$plug_opt" "-flto $lto_no_fat" \
{pr19317.c} {} "libpr19317.a"] \
[list "Build pr20276a.o" \
- "" "-fno-lto" \
+ "" "-fno-lto -fcommon" \
{pr20276a.c}] \
[list "Build pr20276b.o" \
- "$plug_opt" "-flto $lto_no_fat" \
+ "$plug_opt" "-flto $lto_no_fat -fcommon" \
{pr20276b.c}] \
[list "Build pr20267a.o" \
- "" "" \
+ "" "-fcommon" \
{pr20267a.c}] \
[list "Build libpr20267a.a" \
- "$plug_opt" "-flto $lto_fat" \
+ "$plug_opt" "-flto $lto_fat -fcommon" \
{pr20267b.c} {} "libpr20267a.a"] \
[list "Build libpr20267b.a" \
- "$plug_opt" "-flto $lto_no_fat" \
+ "$plug_opt" "-flto $lto_no_fat -fcommon" \
{pr20267b.c} {} "libpr20267b.a"] \
[list "Build pr20321" \
"-flto -Wl,-plugin,$plug_so" "-flto" \
@@ -437,14 +437,14 @@ set lto_run_tests [list \
"-O2 -flto tmpdir/pr20276a.o tmpdir/pr20276b.o" "" \
{dummy.c} "pr20276" "pass.out" "-flto -O2" "c"] \
[list "Run pr20267a" \
- "-O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267a.a" "" \
- {dummy.c} "pr20267a" "pass.out" "-flto -O2" "c"] \
+ "-O2 -flto -fcommon tmpdir/pr20267a.o tmpdir/libpr20267a.a" "" \
+ {dummy.c} "pr20267a" "pass.out" "-flto -O2 -fcommon" "c"] \
[list "Run pr20267b" \
- "-O2 -flto tmpdir/pr20267a.o tmpdir/libpr20267b.a" "" \
- {dummy.c} "pr20267b" "pass.out" "-flto -O2" "c"] \
+ "-O2 -flto -fcommon tmpdir/pr20267a.o tmpdir/libpr20267b.a" "" \
+ {dummy.c} "pr20267b" "pass.out" "-flto -O2 -fcommon" "c"] \
[list "Run pr22502" \
"-O2 -flto tmpdir/pr22502a.o tmpdir/pr22502b.o" "" \
- {dummy.c} "pr20267" "pass.out" "-flto -O2" "c"] \
+ {dummy.c} "pr20267" "pass.out" "-flto -O2 -fcommon" "c"] \
[list "Run pr22751" \
"-O2 -flto" "" \
{dummy.c} "pr22751" "pass.out" "-flto -O2" "c" "" \