aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorStephen Clarke <stephen.clarke@earthling.net>2002-08-16 18:47:31 +0000
committerStephen Clarke <stephen.clarke@earthling.net>2002-08-16 18:47:31 +0000
commit0b65791f7d0a25a80883e54d0cc0121f6b0baa20 (patch)
treea0b8ce60daabd877c4c97349b5f7116abf7fba81 /ld
parent4972a8e93e2883384ab81158bd85c2d5f3e9ceb8 (diff)
downloadgdb-0b65791f7d0a25a80883e54d0cc0121f6b0baa20.zip
gdb-0b65791f7d0a25a80883e54d0cc0121f6b0baa20.tar.gz
gdb-0b65791f7d0a25a80883e54d0cc0121f6b0baa20.tar.bz2
* ld-sh/sh64/sh64.exp: Add dlsection.
* ld-sh/sh64/dlsection-1.s, ld-sh/sh64/dlsection.sd: New.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-sh/sh64/dlsection-1.s17
-rw-r--r--ld/testsuite/ld-sh/sh64/dlsection.sd13
-rw-r--r--ld/testsuite/ld-sh/sh64/sh64.exp6
4 files changed, 41 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 3aba5ad..9ec8ea2 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-16 Stephen Clarke <stephen.clarke@superh.com>
+
+ * ld-sh/sh64/sh64.exp: Add dlsection.
+ * ld-sh/sh64/dlsection-1.s, ld-sh/sh64/dlsection.sd: New.
+
2002-08-16 Alan Modra <amodra@bigpond.net.au>
* ld-discard/discard.exp: xfail targets using generic linker.
diff --git a/ld/testsuite/ld-sh/sh64/dlsection-1.s b/ld/testsuite/ld-sh/sh64/dlsection-1.s
new file mode 100644
index 0000000..d83e6e1
--- /dev/null
+++ b/ld/testsuite/ld-sh/sh64/dlsection-1.s
@@ -0,0 +1,17 @@
+! Test gc-sections and datalabel references.
+!
+! Datalabel reference to symbol in section .text2 should
+! prevent .text2 from being discarded.
+! Section .spurious can be discarded.
+ .mode SHmedia
+
+ .text
+ .global start
+ .global foo
+start: .long datalabel foo
+
+ .section .text2,"ax"
+foo: .long 23
+
+ .section .spurious,"ax"
+ .long 17
diff --git a/ld/testsuite/ld-sh/sh64/dlsection.sd b/ld/testsuite/ld-sh/sh64/dlsection.sd
new file mode 100644
index 0000000..3e470fb
--- /dev/null
+++ b/ld/testsuite/ld-sh/sh64/dlsection.sd
@@ -0,0 +1,13 @@
+
+.*: file format elf.*-sh64
+
+Contents of section \.text:
+ 1000 00001004 .*
+Contents of section \.text2:
+ 1004 00000017 .*
+Contents of section \.data:
+Contents of section \.ctors:
+Contents of section \.dtors:
+Contents of section \.sbss:
+Contents of section \.bss:
+Contents of section \.stack:
diff --git a/ld/testsuite/ld-sh/sh64/sh64.exp b/ld/testsuite/ld-sh/sh64/sh64.exp
index 555436e..f939441 100644
--- a/ld/testsuite/ld-sh/sh64/sh64.exp
+++ b/ld/testsuite/ld-sh/sh64/sh64.exp
@@ -73,6 +73,12 @@ set sh64tests {
{"SH64 inter-file datalabel references, 32-bit ABI" "-mshelf32"
"--abi=32" {shdl-1.s shdl-2.s}
{{objdump -sr shdl64.sd} {objdump -x shdl32.xd}}}
+ {"SH64 inter-file datalabel references and gc-sections, 32-bit ABI" "-mshelf32 --gc-sections"
+ "--abi=32" {dlsection-1.s }
+ {{objdump -sr dlsection.sd}}}
+ {"SH64 inter-file datalabel references and gc-sections, 64-bit ABI" "-mshelf64 --gc-sections"
+ "--abi=64" {dlsection-1.s }
+ {{objdump -sr dlsection.sd}}}
{"SH64 simple partial linking, 32-bit ABI" "-mshelf32 -r"
"--abi=32" {rel-1.s rel-2.s}
{{objdump -sx rel32.xd}}}