aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-05-05 10:35:31 +0930
committerAlan Modra <amodra@gmail.com>2021-05-05 10:35:31 +0930
commit13ffdac36f589830863b10c760b79ab7809e1b12 (patch)
treee868b030a5eec654ac7a769a32c84f34059480ad /ld
parent3897046fe011890d839b59c4b8475d9d47e0fc18 (diff)
downloadgdb-13ffdac36f589830863b10c760b79ab7809e1b12.zip
gdb-13ffdac36f589830863b10c760b79ab7809e1b12.tar.gz
gdb-13ffdac36f589830863b10c760b79ab7809e1b12.tar.bz2
PowerPC undefweak testcase
Test for commit 4916030821bb and b293661219c3. * testsuite/ld-powerpc/empty.s: New file. * testsuite/ld-powerpc/undefweak.d, * testsuite/ld-powerpc/undefweak.s: New testcase. * testsuite/ld-powerpc/powerpc.exp: Run it.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/testsuite/ld-powerpc/empty.s0
-rw-r--r--ld/testsuite/ld-powerpc/powerpc.exp3
-rw-r--r--ld/testsuite/ld-powerpc/undefweak.d10
-rw-r--r--ld/testsuite/ld-powerpc/undefweak.s8
5 files changed, 28 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ebd7ac1..5262938 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2021-05-05 Alan Modra <amodra@gmail.com>
+
+ * testsuite/ld-powerpc/empty.s: New file.
+ * testsuite/ld-powerpc/undefweak.d,
+ * testsuite/ld-powerpc/undefweak.s: New testcase.
+ * testsuite/ld-powerpc/powerpc.exp: Run it.
+
2021-05-03 Alan Modra <amodra@gmail.com>
* testsuite/ld-s390/tlspic_64.rd: Adjust expected output for
diff --git a/ld/testsuite/ld-powerpc/empty.s b/ld/testsuite/ld-powerpc/empty.s
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/empty.s
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index 2ac02b1..f15f64e 100644
--- a/ld/testsuite/ld-powerpc/powerpc.exp
+++ b/ld/testsuite/ld-powerpc/powerpc.exp
@@ -172,6 +172,7 @@ set ppcelftests {
{"relocatable relaxing large" "-melf32ppc -r --relax" "" "-a32" "relax.s big.s"
{{objdump -dr relaxrl.d}}
"rrelax"}
+ {"build empty shared library" "-shared" "" "" "empty.s" {} "empty.so"}
}
set ppc64elftests {
@@ -487,3 +488,5 @@ run_dump_test "non-contiguous-powerpc"
run_dump_test "tprel32"
run_dump_test "tprelbad"
+
+run_dump_test "undefweak"
diff --git a/ld/testsuite/ld-powerpc/undefweak.d b/ld/testsuite/ld-powerpc/undefweak.d
new file mode 100644
index 0000000..3c4a18f
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/undefweak.d
@@ -0,0 +1,10 @@
+#ld: tmpdir/empty.so
+#readelf: --dyn-syms -r -W
+
+#...
+.* R_PPC(|64)_ADDR(32|64) .* a \+ 0
+#...
+.* R_PPC(|64)_JMP_SLOT .* b \+ 0
+#...
+.* WEAK +DEFAULT +UND b
+.* WEAK +DEFAULT +UND a
diff --git a/ld/testsuite/ld-powerpc/undefweak.s b/ld/testsuite/ld-powerpc/undefweak.s
new file mode 100644
index 0000000..e6eb1b4
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/undefweak.s
@@ -0,0 +1,8 @@
+ .weak a,b
+ .data
+ .dc.a a
+ .text
+ .global _start
+_start:
+ bl b
+ nop