summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2008-12-20 00:30:39 +0000
committerHans-Peter Nilsson <hp@axis.com>2008-12-20 00:30:39 +0000
commitc40c6abaacd9433e76f1125e925f2d48aea4197c (patch)
treeaadce4fc922b616c28e33b6a9ae45f64845d5301
parentde00b9839a43108cdbc402e368176a0060e531d6 (diff)
downloadbinutils-redhat-c40c6abaacd9433e76f1125e925f2d48aea4197c.tar.gz
* ld-cris/tls-err-77.d, ld-cris/tls-gc-79.d, ld-cris/tls-ie-8e.s,
ld-cris/tls-ie-8e1.d: New tests.
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-cris/tls-err-77.d7
-rw-r--r--ld/testsuite/ld-cris/tls-gc-79.d34
-rw-r--r--ld/testsuite/ld-cris/tls-ie-8e.s8
-rw-r--r--ld/testsuite/ld-cris/tls-ie-8e1.d42
5 files changed, 96 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index daee5dc453..94215620e7 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-20 Hans-Peter Nilsson <hp@axis.com>
+
+ * ld-cris/tls-err-77.d, ld-cris/tls-gc-79.d, ld-cris/tls-ie-8e.s,
+ ld-cris/tls-ie-8e1.d: New tests.
+
2008-12-18 H.J. Lu <hongjiu.lu@intel.com>
* ld-i386/tlsld1.dd: Remove trailing white spaces after nop.
diff --git a/ld/testsuite/ld-cris/tls-err-77.d b/ld/testsuite/ld-cris/tls-err-77.d
new file mode 100644
index 0000000000..9c714bfb70
--- /dev/null
+++ b/ld/testsuite/ld-cris/tls-err-77.d
@@ -0,0 +1,7 @@
+#source: tls-ie-8e.s
+#source: tls-x.s
+#as: --no-underscore --em=criself
+#ld: --shared -m crislinux
+#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z
+
+# Check that a R_CRIS_32_IE in input to a DSO is flagged as an error.
diff --git a/ld/testsuite/ld-cris/tls-gc-79.d b/ld/testsuite/ld-cris/tls-gc-79.d
new file mode 100644
index 0000000000..37e8fce622
--- /dev/null
+++ b/ld/testsuite/ld-cris/tls-gc-79.d
@@ -0,0 +1,34 @@
+#source: start1.s
+#source: tls128.s
+#source: tls-ie-8e.s
+#source: tls-x.s
+#as: --no-underscore --em=criself
+#ld: -m crislinux --gc-sections
+#objdump: -s -t -r -p
+
+# An executable with a single R_CRIS_32_IE, with gc. Check that we
+# have nothing left but the start symbol and its code. Can't get rid
+# of the GOT just yet.
+
+.*: file format elf32-cris
+
+Program Header:
+ LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13
+ filesz 0x0+78 memsz 0x0+78 flags r-x
+ LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13
+ filesz 0x0+c memsz 0x0+c flags rw-
+private flags = 0:
+
+SYMBOL TABLE:
+0+80074 l d .text 0+ .text
+0+82078 l d .got 0+ .got
+0+82078 l O .got 0+ .hidden _GLOBAL_OFFSET_TABLE_
+0+80074 g .text 0+ _start
+0+82084 g \*ABS\* 0+ __bss_start
+0+82084 g \*ABS\* 0+ _edata
+0+820a0 g \*ABS\* 0+ _end
+
+Contents of section .text:
+ 80074 41b20+ .*
+Contents of section .got:
+ 82078 0+ 0+ 0+ .*
diff --git a/ld/testsuite/ld-cris/tls-ie-8e.s b/ld/testsuite/ld-cris/tls-ie-8e.s
new file mode 100644
index 0000000000..fc6e1215b4
--- /dev/null
+++ b/ld/testsuite/ld-cris/tls-ie-8e.s
@@ -0,0 +1,8 @@
+ .text
+ .global tlsfn
+ .type tlsfn,@function
+ .p2align 1
+tlsfn:
+ move.d x:IE,$r10
+.Lfe8:
+ .size tlsfn,.Lfe8-tlsfn
diff --git a/ld/testsuite/ld-cris/tls-ie-8e1.d b/ld/testsuite/ld-cris/tls-ie-8e1.d
new file mode 100644
index 0000000000..e2bcfd2b76
--- /dev/null
+++ b/ld/testsuite/ld-cris/tls-ie-8e1.d
@@ -0,0 +1,42 @@
+#as: --no-underscore --em=criself
+#ld: -m crislinux
+#source: start1.s
+#source: tls-ie-8e.s
+#source: tls128g.s
+#source: tls-x.s
+#objdump: -d -s -h -t -r -p
+
+# Executable with a single R_CRIS_32_IE, defined in the executable.
+# Check that we have proper NPTL/TLS markings and a constant GOT.
+
+.*: file format elf32-cris
+
+Program Header:
+#...
+ TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2
+ filesz 0x0+84 memsz 0x0+84 flags r--
+private flags = 0:
+
+Sections:
+#...
+ 2 .got[ ]+ 0+10 .*
+ CONTENTS, ALLOC, LOAD, DATA
+
+SYMBOL TABLE:
+#...
+0+80 g \.tdata 0+4 x
+#...
+Contents of section .text:
+ 80094 41b20000 6fae3021 08000000 .*
+#...
+Contents of section .got:
+ 82124 00000000 00000000 00000000 80000000 .*
+
+Disassembly of section .text:
+
+00080094 <_start>:
+ 80094: 41b2 moveq 1,\$r11
+#...
+00080098 <tlsfn>:
+ 80098: 6fae 3021 0800 move.d 82130 <_GLOBAL_OFFSET_TABLE_\+0xc>,\$r10
+#pass