aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-cris
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2004-09-07 18:32:27 +0000
committerHans-Peter Nilsson <hp@axis.com>2004-09-07 18:32:27 +0000
commite646467d714339cd17cbbbe71ae427ad865ab91b (patch)
tree6ecbab7242f41708def8e270f6a742ccd4be694d /ld/testsuite/ld-cris
parentd15b04bdfbf14d8fa399fac21baa5b1382e2a205 (diff)
downloadgdb-e646467d714339cd17cbbbe71ae427ad865ab91b.zip
gdb-e646467d714339cd17cbbbe71ae427ad865ab91b.tar.gz
gdb-e646467d714339cd17cbbbe71ae427ad865ab91b.tar.bz2
* ld-cris/hiddef1.d, ld-cris/hiddef1.d, ld-cris/hidrefgotplt1.s:
New test.
Diffstat (limited to 'ld/testsuite/ld-cris')
-rw-r--r--ld/testsuite/ld-cris/hiddef1.d28
-rw-r--r--ld/testsuite/ld-cris/hiddef1.s2
-rw-r--r--ld/testsuite/ld-cris/hidrefgotplt1.s2
3 files changed, 32 insertions, 0 deletions
diff --git a/ld/testsuite/ld-cris/hiddef1.d b/ld/testsuite/ld-cris/hiddef1.d
new file mode 100644
index 0000000..0d6c4a8
--- /dev/null
+++ b/ld/testsuite/ld-cris/hiddef1.d
@@ -0,0 +1,28 @@
+#source: gotrel1.s
+#source: hiddef1.s
+#source: hidrefgotplt1.s
+#ld: -shared -m crislinux
+#as: --pic --no-underscore -I$srcdir/$subdir
+#readelf: -S -s -r
+
+# Regression test for mishandling of GOTPLT relocs against a
+# hidden symbol, where the reloc is found after the symbol
+# definition. There should be no PLT, just a single GOT entry
+# from a GOTPLT reloc moved to the .got section. It's hard to
+# check for absence of a .plt section, so we just check the
+# number of symbols and sections. When the number of symbols
+# and sections change, make sure that there's no .plt and that
+# dsofn is hidden (not exported as a dynamic symbol).
+
+There are 13 section headers, starting at offset 0x[0-9a-f]+:
+#...
+ \[[ 0-9]+\] \.got PROGBITS [0-9a-f]+ [0-9a-f]+ 0+10 04 WA 0 0 4
+#...
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+#...
+[0-9a-f]+ 0+c R_CRIS_RELATIVE [0-9a-f]+
+#...
+Symbol table '\.dynsym' contains 10 entries:
+#...
+Symbol table '\.symtab' contains 21 entries:
+#pass
diff --git a/ld/testsuite/ld-cris/hiddef1.s b/ld/testsuite/ld-cris/hiddef1.s
new file mode 100644
index 0000000..ac24c81
--- /dev/null
+++ b/ld/testsuite/ld-cris/hiddef1.s
@@ -0,0 +1,2 @@
+ .include "dso-1.s"
+ .hidden dsofn
diff --git a/ld/testsuite/ld-cris/hidrefgotplt1.s b/ld/testsuite/ld-cris/hidrefgotplt1.s
new file mode 100644
index 0000000..020ff16
--- /dev/null
+++ b/ld/testsuite/ld-cris/hidrefgotplt1.s
@@ -0,0 +1,2 @@
+ .text
+ move.d [$r0+dsofn:GOTPLT],$r1