summaryrefslogtreecommitdiffstats
path: root/binutils-2.21/ld/testsuite/ld-m68k
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.21/ld/testsuite/ld-m68k')
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-1.d19
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-1.s18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-multigot-12-13-14-34-35-ok.d18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-multigot-14-ok.d18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-multigot-15-er.d3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-34-ok.d18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-35-er.d3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-negative-14-ok.d18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-negative-15-er.d3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-single-12-ok.d18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-single-13-er.d3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-xgot-12-13-14-15-34-35-ok.d18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/got-xgot-15-ok.d18
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.d7
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isaa-nodiv.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isaa.d7
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isaa.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isaaplus.d7
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isaaplus.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isab-float.d7
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isab-float.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isab-nousp.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isab.d7
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/isab.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/m68k-got.exp250
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/m68k.exp93
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.d4
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.s1
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.d4
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.s1
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-error-1c.d4
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-error-1d.d4
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-error-1e.d4
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1a.d6
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1b.d6
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1c.d6
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/merge.ld9
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/plt1-68020.d35
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/plt1-cpu32.d43
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/plt1-empty.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/plt1-isab.d44
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/plt1-isac.d44
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/plt1.ld23
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/plt1.s3
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.d4
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.s9
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d21
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d25
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d313
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.s16
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.d24
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.s24
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.d25
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.s23
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.d22
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.s20
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.d22
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.s21
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.d15
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.s19
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-le-1.s20
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.d15
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.s19
-rw-r--r--binutils-2.21/ld/testsuite/ld-m68k/tls-no-1.s18
65 files changed, 1173 insertions, 0 deletions
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-1.d b/binutils-2.21/ld/testsuite/ld-m68k/got-1.d
new file mode 100644
index 0000000..e8070e9
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-1.d
@@ -0,0 +1,19 @@
+#source: got-1.s
+#ld: -shared
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 12 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+[0-9a-f]+ [0-9a-f]+ R_68K_GLOB_DAT 00000000 a \+ 0
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-1.s b/binutils-2.21/ld/testsuite/ld-m68k/got-1.s
new file mode 100644
index 0000000..0cf3692
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-1.s
@@ -0,0 +1,18 @@
+#NO_APP
+ .file "got-1.c"
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
+ move.l a@GOT(%a5),%d0
+ move.l %d0,%a0
+ move.l (%a0),%d0
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-12-13-14-34-35-ok.d b/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-12-13-14-34-35-ok.d
new file mode 100644
index 0000000..176961b
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-12-13-14-34-35-ok.d
@@ -0,0 +1,18 @@
+#as: -mcpu=5206
+#ld: -shared --got=multigot
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 294936 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 24578 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-14-ok.d b/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-14-ok.d
new file mode 100644
index 0000000..7ebc589
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-14-ok.d
@@ -0,0 +1,18 @@
+#as: -mcpu=5206
+#ld: -shared --got=multigot
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 196584 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 16382 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-15-er.d b/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-15-er.d
new file mode 100644
index 0000000..58381ae
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-multigot-15-er.d
@@ -0,0 +1,3 @@
+#as: -mcpu=5206
+#ld: -shared --got=multigot
+#error: .*GOT overflow.*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-34-ok.d b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-34-ok.d
new file mode 100644
index 0000000..451df80
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-34-ok.d
@@ -0,0 +1,18 @@
+#as: -mcpu=5206
+#ld: -shared --got=negative
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 196584 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 16382 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-35-er.d b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-35-er.d
new file mode 100644
index 0000000..4487a8c
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-12-13-14-35-er.d
@@ -0,0 +1,3 @@
+#as: -mcpu=5206
+#ld: -shared --got=negative
+#error: .*relocation truncated to fit.*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-negative-14-ok.d b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-14-ok.d
new file mode 100644
index 0000000..451df80
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-14-ok.d
@@ -0,0 +1,18 @@
+#as: -mcpu=5206
+#ld: -shared --got=negative
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 196584 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 16382 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-negative-15-er.d b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-15-er.d
new file mode 100644
index 0000000..c1b7409
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-negative-15-er.d
@@ -0,0 +1,3 @@
+#as: -mcpu=5206
+#ld: -shared --got=negative
+#error: .*GOT overflow.*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-single-12-ok.d b/binutils-2.21/ld/testsuite/ld-m68k/got-single-12-ok.d
new file mode 100644
index 0000000..a7fdeb9
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-single-12-ok.d
@@ -0,0 +1,18 @@
+#as: -mcpu=5206
+#ld: -shared --got=single
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 98268 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 8189 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-single-13-er.d b/binutils-2.21/ld/testsuite/ld-m68k/got-single-13-er.d
new file mode 100644
index 0000000..bfca9f8
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-single-13-er.d
@@ -0,0 +1,3 @@
+#as: -mcpu=5206
+#ld: -shared --got=single
+#error: .*relocation truncated to fit.*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-xgot-12-13-14-15-34-35-ok.d b/binutils-2.21/ld/testsuite/ld-m68k/got-xgot-12-13-14-15-34-35-ok.d
new file mode 100644
index 0000000..dd2c21d
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-xgot-12-13-14-15-34-35-ok.d
@@ -0,0 +1,18 @@
+#as: -mcpu=5206
+#ld: -shared --got=multigot
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 294972 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 24581 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/got-xgot-15-ok.d b/binutils-2.21/ld/testsuite/ld-m68k/got-xgot-15-ok.d
new file mode 100644
index 0000000..bc11849
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/got-xgot-15-ok.d
@@ -0,0 +1,18 @@
+#as: -mcpu=5206
+#ld: -shared --got=multigot
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 196620 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 16385 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.d b/binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.d
new file mode 100644
index 0000000..79b809a
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.d
@@ -0,0 +1,7 @@
+
+.*: file format elf32-m68k
+
+Program Header:
+#...
+private flags = 12: \[isa A\] \[mac\]
+
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.s b/binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.s
new file mode 100644
index 0000000..e3ec277
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isaa-mac.s
@@ -0,0 +1,3 @@
+ .arch isaa,mac
+
+ nop
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isaa-nodiv.s b/binutils-2.21/ld/testsuite/ld-m68k/isaa-nodiv.s
new file mode 100644
index 0000000..de327f1
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isaa-nodiv.s
@@ -0,0 +1,3 @@
+ .arch isaa,no-div
+
+ nop
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isaa.d b/binutils-2.21/ld/testsuite/ld-m68k/isaa.d
new file mode 100644
index 0000000..48e4fa2
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isaa.d
@@ -0,0 +1,7 @@
+
+.*: file format elf32-m68k
+
+Program Header:
+#...
+private flags = 2: \[isa A\]
+
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isaa.s b/binutils-2.21/ld/testsuite/ld-m68k/isaa.s
new file mode 100644
index 0000000..f4675c1
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isaa.s
@@ -0,0 +1,3 @@
+ .arch isaa
+
+ nop
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isaaplus.d b/binutils-2.21/ld/testsuite/ld-m68k/isaaplus.d
new file mode 100644
index 0000000..88623ce
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isaaplus.d
@@ -0,0 +1,7 @@
+
+.*: file format elf32-m68k
+
+Program Header:
+#...
+private flags = 3: \[isa A\+\]
+
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isaaplus.s b/binutils-2.21/ld/testsuite/ld-m68k/isaaplus.s
new file mode 100644
index 0000000..5b0a0b8
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isaaplus.s
@@ -0,0 +1,3 @@
+ .arch isaaplus
+
+ nop
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isab-float.d b/binutils-2.21/ld/testsuite/ld-m68k/isab-float.d
new file mode 100644
index 0000000..3547ea7
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isab-float.d
@@ -0,0 +1,7 @@
+
+.*: file format elf32-m68k
+
+Program Header:
+#...
+private flags = 8045: \[cfv4e\] \[isa B\] \[float\]
+
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isab-float.s b/binutils-2.21/ld/testsuite/ld-m68k/isab-float.s
new file mode 100644
index 0000000..3889d0d
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isab-float.s
@@ -0,0 +1,3 @@
+ .arch isab,float
+
+ nop
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isab-nousp.s b/binutils-2.21/ld/testsuite/ld-m68k/isab-nousp.s
new file mode 100644
index 0000000..1e52357
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isab-nousp.s
@@ -0,0 +1,3 @@
+ .arch isab,no-usp
+
+ nop
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isab.d b/binutils-2.21/ld/testsuite/ld-m68k/isab.d
new file mode 100644
index 0000000..c5b0134
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isab.d
@@ -0,0 +1,7 @@
+
+.*: file format elf32-m68k
+
+Program Header:
+#...
+private flags = 5: \[isa B\]
+
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/isab.s b/binutils-2.21/ld/testsuite/ld-m68k/isab.s
new file mode 100644
index 0000000..3f93db7
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/isab.s
@@ -0,0 +1,3 @@
+ .arch isab
+
+ nop
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/m68k-got.exp b/binutils-2.21/ld/testsuite/ld-m68k/m68k-got.exp
new file mode 100644
index 0000000..fbd98bc
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/m68k-got.exp
@@ -0,0 +1,250 @@
+# Expect script for run_dump_test based ld-m68k GOT tests.
+# Copyright 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+
+if { ![is_elf_format] || ![istarget m68k-*-*] } {
+ return
+}
+
+# 1 - 1
+# 2 - 8189
+# 3 - 8190
+# 4 - 16382
+# 5 - 16385
+
+proc gen_got_test { testname } {
+ global srcdir
+ global subdir
+
+ if [catch { set ofd [open "tmpdir/$testname.s" w] } msg] {
+ perror "$msg"
+ unresolved $testname
+ return
+ }
+
+ switch -- $testname {
+ "got-12" {
+ set start 1
+ set count 8189
+ set xgot 0
+ }
+ "got-13" {
+ set start 1
+ set count 8190
+ set xgot 0
+ }
+ "got-14" {
+ set start 1
+ set count 16382
+ set xgot 0
+ }
+ "got-15" {
+ set start 1
+ set count 16385
+ set xgot 0
+ }
+ "got-34" {
+ set start 8190
+ set count 16382
+ set xgot 0
+ }
+ "got-35" {
+ set start 8190
+ set count 16385
+ set xgot 0
+ }
+ "xgot-15" {
+ set start 1
+ set count 16385
+ set xgot 1
+ }
+ }
+
+ set func [format "sum_%05d_%05d" $start $count]
+ puts $ofd "\t.text"
+ puts $ofd "\t.align 2"
+ puts $ofd "\t.globl $func"
+ puts $ofd "\t.type $func,@function"
+ puts $ofd "$func:"
+ puts $ofd "\tlink.w %fp,#0"
+ puts $ofd "\tmove.l %a5,-(%sp)"
+ puts $ofd "\tmove.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5"
+ puts $ofd "\tlea (-6, %pc, %a5), %a5"
+
+ if { $xgot == 1 } {
+ set symbol [format "a%05d" $start]
+ incr start
+ puts $ofd "\tlea $symbol@GOT,%a0"
+ puts $ofd "\tadd.l %a5,%a0"
+ puts $ofd "\tmove.l (%a0),%a0"
+ puts $ofd "\tmove.l (%a0),%d1"
+ for { set i $start } { $i < $count } { incr i } {
+ set symbol [format "a%05d" $i]
+ puts $ofd "\tlea $symbol@GOT,%a0"
+ puts $ofd "\tadd.l %a5,%a0"
+ puts $ofd "\tmove.l (%a0),%a0"
+ puts $ofd "\tmove.l (%a0),%d0"
+ puts $ofd "\tadd.l %d0,%d1"
+ }
+ set symbol [format "a%05d" $count]
+ puts $ofd "\tlea $symbol@GOT,%a0"
+ puts $ofd "\tadd.l %a5,%a0"
+ puts $ofd "\tmove.l (%a0),%a0"
+ puts $ofd "\tmove.l (%a0),%d0"
+ puts $ofd "\tadd.l %d1,%d0"
+ } else {
+ set symbol [format "a%05d" $start]
+ incr start
+ puts $ofd "\tmove.l $symbol@GOT(%a5),%d0"
+ puts $ofd "\tmove.l %d0,%a0"
+ puts $ofd "\tmove.l (%a0),%d1"
+ for { set i $start } { $i < $count } { incr i } {
+ set symbol [format "a%05d" $i]
+ puts $ofd "\tmove.l $symbol@GOT(%a5),%d0"
+ puts $ofd "\tmove.l %d0,%a0"
+ puts $ofd "\tmove.l (%a0),%d0"
+ puts $ofd "\tadd.l %d0,%d1"
+ }
+ set symbol [format "a%05d" $count]
+ puts $ofd "\tmove.l $symbol@GOT(%a5),%d0"
+ puts $ofd "\tmove.l %d0,%a0"
+ puts $ofd "\tmove.l (%a0),%d0"
+ puts $ofd "\tadd.l %d1,%d0"
+ }
+
+ puts $ofd "\tmove.l (%sp)+,%a5"
+ puts $ofd "\tunlk %fp"
+ puts $ofd "\trts"
+ puts $ofd "\t.size $func, .-$func"
+
+ close $ofd
+}
+
+proc got_test { testname } {
+ global srcdir
+ global subdir
+ global objdir
+
+ if [catch { set ifd [open "$srcdir/$subdir/$testname.d" r] } msg] {
+ perror "$msg"
+ unresolved $testname
+ return
+ }
+ if [catch { set ofd [open "tmpdir/$testname.d" w] } msg] {
+ perror "$msg"
+ unresolved $testname
+ return
+ }
+
+ switch -- $testname {
+ "got-single-12-ok" {
+ puts $ofd "#source: $objdir/tmpdir/got-12.s"
+ set count 8189
+ }
+ "got-single-13-er" {
+ puts $ofd "#source: $objdir/tmpdir/got-13.s"
+ set count 0
+ }
+ "got-negative-14-ok" {
+ puts $ofd "#source: $objdir/tmpdir/got-14.s"
+ set count 16382
+ }
+ "got-negative-15-er" {
+ puts $ofd "#source: $objdir/tmpdir/got-15.s"
+ set count 0
+ }
+ "got-negative-12-13-14-34-ok" {
+ puts $ofd "#source: $objdir/tmpdir/got-12.s"
+ puts $ofd "#source: $objdir/tmpdir/got-13.s"
+ puts $ofd "#source: $objdir/tmpdir/got-14.s"
+ puts $ofd "#source: $objdir/tmpdir/got-34.s"
+ set count 16382
+ }
+ "got-negative-12-13-14-35-er" {
+ puts $ofd "#source: $objdir/tmpdir/got-12.s"
+ puts $ofd "#source: $objdir/tmpdir/got-13.s"
+ puts $ofd "#source: $objdir/tmpdir/got-14.s"
+ puts $ofd "#source: $objdir/tmpdir/got-35.s"
+ set count 0
+ }
+ "got-multigot-14-ok" {
+ puts $ofd "#source: $objdir/tmpdir/got-14.s"
+ set count 16382
+ }
+ "got-multigot-15-er" {
+ puts $ofd "#source: $objdir/tmpdir/got-15.s"
+ set count 0
+ }
+ "got-multigot-12-13-14-34-35-ok" {
+ puts $ofd "#source: $objdir/tmpdir/got-12.s"
+ puts $ofd "#source: $objdir/tmpdir/got-13.s"
+ puts $ofd "#source: $objdir/tmpdir/got-14.s"
+ puts $ofd "#source: $objdir/tmpdir/got-34.s"
+ puts $ofd "#source: $objdir/tmpdir/got-35.s"
+ set count 24578
+ }
+ "got-xgot-15-ok" {
+ puts $ofd "#source: $objdir/tmpdir/xgot-15.s"
+ set count 16385
+ }
+ "got-xgot-12-13-14-15-34-35-ok" {
+ puts $ofd "#source: $objdir/tmpdir/got-12.s"
+ puts $ofd "#source: $objdir/tmpdir/got-13.s"
+ puts $ofd "#source: $objdir/tmpdir/got-14.s"
+ puts $ofd "#source: $objdir/tmpdir/xgot-15.s"
+ puts $ofd "#source: $objdir/tmpdir/got-34.s"
+ puts $ofd "#source: $objdir/tmpdir/got-35.s"
+ set count 24581
+ }
+ }
+
+ while { [gets $ifd line] != -1 } {
+ puts $ofd $line
+ }
+
+ for { set i 0 } { $i < $count } { incr i } {
+ puts $ofd "^\[0-9a-f\]+ \[0-9a-f\]+ R_68K_GLOB_DAT 00000000 a\[0-9\]+ \\\+ 0"
+ }
+
+ close $ifd
+ close $ofd
+ run_dump_test "tmpdir/$testname"
+}
+
+gen_got_test got-12
+gen_got_test got-13
+gen_got_test got-14
+gen_got_test got-15
+gen_got_test got-34
+gen_got_test got-35
+gen_got_test xgot-15
+
+run_dump_test "got-1"
+got_test "got-single-12-ok"
+got_test "got-single-13-er"
+got_test "got-negative-14-ok"
+got_test "got-negative-15-er"
+got_test "got-negative-12-13-14-34-ok"
+got_test "got-negative-12-13-14-35-er"
+got_test "got-multigot-14-ok"
+got_test "got-multigot-15-er"
+got_test "got-multigot-12-13-14-34-35-ok"
+got_test "got-xgot-15-ok"
+got_test "got-xgot-12-13-14-15-34-35-ok"
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/m68k.exp b/binutils-2.21/ld/testsuite/ld-m68k/m68k.exp
new file mode 100644
index 0000000..198a5e2
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/m68k.exp
@@ -0,0 +1,93 @@
+# Expect script for run_dump_test based ld-m68k tests.
+# Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+# Test m68k object merging
+
+if { ![is_elf_format] || ![istarget m68k-*-*] } {
+ return
+}
+
+# List contains test-items with 3 items followed by 2 lists:
+# 0:name 1:ld options 2:assembler options
+# 3:filenames of assembler files 4: action and options. 5: name of output file
+
+# Actions:
+# objdump: Apply objdump options on result. Compare with regex (last arg).
+# nm: Apply nm options on result. Compare with regex (last arg).
+# readelf: Apply readelf options on result. Compare with regex (last arg).
+
+set m68k_mergeok_tests {
+ {"merge isa-a isa-a:nodiv" "-T merge.ld" ""
+ {isaa.s isaa-nodiv.s} {{objdump -p isaa.d}} "isaa-nodiv"}
+ {"merge isa-a isa-b" "-T merge.ld" ""
+ {isaa.s isab.s} {{objdump -p isab.d}} "isab"}
+ {"merge isa-a isa-aplus" "-T merge.ld" ""
+ {isaa.s isaaplus.s} {{objdump -p isaaplus.d}} "isaplus"}
+ {"merge isa-b isa-b:nousp" "-T merge.ld" ""
+ {isab.s isab-nousp.s} {{objdump -p isab.d}} "isab"}
+ {"merge isa-a isa-a:mac" "-T merge.ld" ""
+ {isaa.s isaa-mac.s} {{objdump -p isaa-mac.d}} "isaa-mac"}
+ {"merge isa-b isa-b:float" "-T merge.ld" ""
+ {isab.s isab-float.s} {{objdump -p isab-float.d}} "isab-float"}}
+
+run_ld_link_tests $m68k_mergeok_tests
+
+run_dump_test "merge-error-1a"
+run_dump_test "merge-error-1b"
+run_dump_test "merge-error-1c"
+run_dump_test "merge-error-1d"
+run_dump_test "merge-error-1e"
+run_dump_test "merge-ok-1a"
+run_dump_test "merge-ok-1b"
+run_dump_test "merge-ok-1c"
+
+foreach { id sources } { a { plt1.s } b { plt1-empty.s plt1.s } } {
+ foreach arch { 68020 cpu32 isab isac } {
+ run_ld_link_tests [list \
+ [list "PLT 1$id ($arch)" "-shared -T plt1.ld" "-m$arch" \
+ $sources [list [list objdump -dr plt1-$arch.d]] \
+ plt1-${id}-${arch}.so]]
+ }
+}
+
+if { [istarget m68k-*-linux*] } then {
+ run_dump_test "tls-gd-1"
+ run_dump_test "tls-gd-2"
+ run_dump_test "tls-gd-ie-1"
+ run_dump_test "tls-ie-1"
+ run_dump_test "tls-ld-1"
+ run_dump_test "tls-ld-2"
+
+ set m68k_tls_tests {
+ {"TLS definition"
+ "-shared" "" {tls-def-1.s}
+ {{nm -ngD tls-def-1.d}}
+ "tls-def-1.so"}
+ {"TLS direct symbol use"
+ "-shared tmpdir/tls-def-1.so" "" {tls-gd-1.s}
+ {{nm -ngD tls-gd-1.d2} {readelf -d tls-gd-1.d3}}
+ "tls-gd-1.so"}
+ {"TLS indirect symbol use"
+ "tmpdir/tls-gd-1.so -rpath-link ./" "" {tls-main-1.s}
+ {{readelf -d tls-main-1.d}}
+ "tls-main-1"}}
+
+ run_ld_link_tests $m68k_tls_tests
+}
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.d
new file mode 100644
index 0000000..3629f39
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -mcpu=cpu32
+#source: merge-error-1b.s -mcpu=68000
+#ld: -r
+#error: ^[^\n]* m68k:68000 [^\n]* incompatible with m68k:cpu32 [^\n]*$
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.s b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.s
new file mode 100644
index 0000000..ee48942
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1a.s
@@ -0,0 +1 @@
+ rts
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.d
new file mode 100644
index 0000000..bedd3d6
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -mcpu=cpu32
+#source: merge-error-1b.s -mcpu=5207
+#ld: -r
+#error: ^[^\n]* m68k:isa-aplus:emac [^\n]* incompatible with m68k:cpu32 [^\n]*$
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.s b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.s
new file mode 100644
index 0000000..ee48942
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1b.s
@@ -0,0 +1 @@
+ rts
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1c.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1c.d
new file mode 100644
index 0000000..9538e77
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1c.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -march=isaaplus
+#source: merge-error-1b.s -march=isab
+#ld: -r
+#error: ^[^\n]* m68k:isa-b [^\n]* incompatible with m68k:isa-aplus [^\n]*$
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1d.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1d.d
new file mode 100644
index 0000000..4d86771
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1d.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -march=isaa -mmac
+#source: merge-error-1b.s -march=isaa -memac
+#ld: -r
+#error: ^[^\n]* m68k:isa-a:emac [^\n]* incompatible with m68k:isa-a:mac [^\n]*$
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1e.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1e.d
new file mode 100644
index 0000000..969f844
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-error-1e.d
@@ -0,0 +1,4 @@
+#source: merge-error-1a.s -march=isaa -mno-div -mmac
+#source: merge-error-1b.s -march=isaa -mno-div -memac
+#ld: -r
+#error: ^[^\n]* m68k:isa-a:emac [^\n]* is incompatible with m68k:isa-a:mac [^\n]*$
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1a.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1a.d
new file mode 100644
index 0000000..96da556
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1a.d
@@ -0,0 +1,6 @@
+#source: merge-error-1a.s -mcpu=5207
+#source: merge-error-1b.s -mcpu=528x
+#ld: -r
+#objdump: -p
+#...
+private flags = 23: \[isa A\+\] \[emac\]
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1b.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1b.d
new file mode 100644
index 0000000..03ae258
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1b.d
@@ -0,0 +1,6 @@
+#source: merge-error-1a.s -march=isaa -mno-div -mmac
+#source: merge-error-1b.s -march=isaa -mno-div -mfloat
+#ld: -r
+#objdump: -p
+#...
+private flags = 8051: \[cfv4e\] \[isa A\] \[nodiv\] \[float\] \[mac\]
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1c.d b/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1c.d
new file mode 100644
index 0000000..81cf5a6
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge-ok-1c.d
@@ -0,0 +1,6 @@
+#source: merge-error-1a.s -march=cpu32
+#source: merge-error-1b.s -march=cpu32
+#ld: -r
+#objdump: -p
+#...
+private flags = 810000: \[cpu32\]
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/merge.ld b/binutils-2.21/ld/testsuite/ld-m68k/merge.ld
new file mode 100644
index 0000000..ed2acfe
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/merge.ld
@@ -0,0 +1,9 @@
+OUTPUT_FORMAT("elf32-m68k", "elf32-m68k",
+ "elf32-m68k")
+OUTPUT_ARCH(m68k)
+ENTRY(_start)
+
+SECTIONS {
+
+ .text : {_start = .; *(.text)}
+}
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/plt1-68020.d b/binutils-2.21/ld/testsuite/ld-m68k/plt1-68020.d
new file mode 100644
index 0000000..54463b9
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/plt1-68020.d
@@ -0,0 +1,35 @@
+
+.*: file format elf32-m68k
+
+Disassembly of section \.plt:
+
+00020800 <f.@plt-0x14>:
+ 20800: 2f3b 0170 0000 movel %pc@\(30404 <_GLOBAL_OFFSET_TABLE_\+0x4>\),%sp@-
+ 20806: fc02
+ 20808: 4efb 0171 0000 jmp %pc@\(30408 <_GLOBAL_OFFSET_TABLE_\+0x8>\)@\(0*\)
+ 2080e: fbfe
+ 20810: 0000 0000 orib #0,%d0
+
+00020814 <f.@plt>:
+ 20814: 4efb 0171 0000 jmp %pc@\(3040c <_GLOBAL_OFFSET_TABLE_\+0xc>\)@\(0*\)
+ 2081a: fbf6
+ 2081c: 2f3c 0000 0000 movel #0,%sp@-
+ 20822: 60ff ffff ffdc bral 20800 <f.@plt-0x14>
+
+00020828 <f.@plt>:
+ 20828: 4efb 0171 0000 jmp %pc@\(30410 <_GLOBAL_OFFSET_TABLE_\+0x10>\)@\(0*\)
+ 2082e: fbe6
+ 20830: 2f3c 0000 000c movel #12,%sp@-
+ 20836: 60ff ffff ffc8 bral 20800 <f.@plt-0x14>
+
+0002083c <f.@plt>:
+ 2083c: 4efb 0171 0000 jmp %pc@\(30414 <_GLOBAL_OFFSET_TABLE_\+0x14>\)@\(0*\)
+ 20842: fbd6
+ 20844: 2f3c 0000 0018 movel #24,%sp@-
+ 2084a: 60ff ffff ffb4 bral 20800 <f.@plt-0x14>
+Disassembly of section \.text:
+
+00020c00 <.*>:
+ 20c00: 61ff ffff fc.. bsrl 208.. <f1@plt>
+ 20c06: 61ff ffff fc.. bsrl 208.. <f2@plt>
+ 20c0c: 61ff ffff fc.. bsrl 208.. <f3@plt>
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/plt1-cpu32.d b/binutils-2.21/ld/testsuite/ld-m68k/plt1-cpu32.d
new file mode 100644
index 0000000..a497740
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/plt1-cpu32.d
@@ -0,0 +1,43 @@
+
+.*: file format elf32-m68k
+
+Disassembly of section \.plt:
+
+00020800 <f.@plt-0x18>:
+ 20800: 2f3b 0170 0000 movel %pc@\(30404 <_GLOBAL_OFFSET_TABLE_\+0x4>\),%sp@-
+ 20806: fc02
+ 20808: 227b 0170 0000 moveal %pc@\(30408 <_GLOBAL_OFFSET_TABLE_\+0x8>\),%a1
+ 2080e: fbfe
+ 20810: 4ed1 jmp %a1@
+ 20812: 0000 0000 orib #0,%d0
+ \.\.\.
+
+00020818 <f.@plt>:
+ 20818: 227b 0170 0000 moveal %pc@\(3040c <_GLOBAL_OFFSET_TABLE_\+0xc>\),%a1
+ 2081e: fbf2
+ 20820: 4ed1 jmp %a1@
+ 20822: 2f3c 0000 0000 movel #0,%sp@-
+ 20828: 60ff ffff ffd6 bral 20800 <f.@plt-0x18>
+ \.\.\.
+
+00020830 <f.@plt>:
+ 20830: 227b 0170 0000 moveal %pc@\(30410 <_GLOBAL_OFFSET_TABLE_\+0x10>\),%a1
+ 20836: fbde
+ 20838: 4ed1 jmp %a1@
+ 2083a: 2f3c 0000 000c movel #12,%sp@-
+ 20840: 60ff ffff ffbe bral 20800 <f.@plt-0x18>
+ \.\.\.
+
+00020848 <f.@plt>:
+ 20848: 227b 0170 0000 moveal %pc@\(30414 <_GLOBAL_OFFSET_TABLE_\+0x14>\),%a1
+ 2084e: fbca
+ 20850: 4ed1 jmp %a1@
+ 20852: 2f3c 0000 0018 movel #24,%sp@-
+ 20858: 60ff ffff ffa6 bral 20800 <f.@plt-0x18>
+ \.\.\.
+Disassembly of section \.text:
+
+00020c00 <.*>:
+ 20c00: 61ff ffff fc.. bsrl 208.. <f1@plt>
+ 20c06: 61ff ffff fc.. bsrl 208.. <f2@plt>
+ 20c0c: 61ff ffff fc.. bsrl 208.. <f3@plt>
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/plt1-empty.s b/binutils-2.21/ld/testsuite/ld-m68k/plt1-empty.s
new file mode 100644
index 0000000..a59477d
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/plt1-empty.s
@@ -0,0 +1,3 @@
+ .text
+ .globl foo
+foo:
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/plt1-isab.d b/binutils-2.21/ld/testsuite/ld-m68k/plt1-isab.d
new file mode 100644
index 0000000..a9aeacb
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/plt1-isab.d
@@ -0,0 +1,44 @@
+
+.*: file format elf32-m68k
+
+Disassembly of section \.plt:
+
+00020800 <f.@plt-0x18>:
+# _GLOBAL_OFFSET_TABLE_ + 4 == 0x30404 == 0x20802 + 0xfc02
+ 20800: 203c 0000 fc02 movel #64514,%d0
+ 20806: 2f3b 08fa movel %pc@\(20802 <f.@plt-0x16>,%d0:l\),%sp@-
+# _GLOBAL_OFFSET_TABLE_ + 8 == 0x30408 == 0x2080c + 0xfbfc
+ 2080a: 203c 0000 fbfc movel #64508,%d0
+ 20810: 207b 08fa moveal %pc@\(2080c <f.@plt-0xc>,%d0:l\),%a0
+ 20814: 4ed0 jmp %a0@
+ 20816: 4e71 nop
+
+00020818 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 12 == 0x3040c == 0x2081a + 0xfbf2
+ 20818: 203c 0000 fbf2 movel #64498,%d0
+ 2081e: 207b 08fa moveal %pc@\(2081a <f.@plt\+0x2>,%d0:l\),%a0
+ 20822: 4ed0 jmp %a0@
+ 20824: 2f3c 0000 0000 movel #0,%sp@-
+ 2082a: 60ff ffff ffd4 bral 20800 <f.@plt-0x18>
+
+00020830 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 16 == 0x30410 == 0x20832 + 0xfbde
+ 20830: 203c 0000 fbde movel #64478,%d0
+ 20836: 207b 08fa moveal %pc@\(20832 <f.@plt\+0x2>,%d0:l\),%a0
+ 2083a: 4ed0 jmp %a0@
+ 2083c: 2f3c 0000 000c movel #12,%sp@-
+ 20842: 60ff ffff ffbc bral 20800 <f.@plt-0x18>
+
+00020848 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 20 == 0x30414 == 0x2084a + 0xfbca
+ 20848: 203c 0000 fbca movel #64458,%d0
+ 2084e: 207b 08fa moveal %pc@\(2084a <f.@plt\+0x2>,%d0:l\),%a0
+ 20852: 4ed0 jmp %a0@
+ 20854: 2f3c 0000 0018 movel #24,%sp@-
+ 2085a: 60ff ffff ffa4 bral 20800 <f.@plt-0x18>
+Disassembly of section \.text:
+
+00020c00 <.*>:
+ 20c00: 61ff ffff fc.. bsrl 208.. <f1@plt>
+ 20c06: 61ff ffff fc.. bsrl 208.. <f2@plt>
+ 20c0c: 61ff ffff fc.. bsrl 208.. <f3@plt>
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/plt1-isac.d b/binutils-2.21/ld/testsuite/ld-m68k/plt1-isac.d
new file mode 100644
index 0000000..ae299ce
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/plt1-isac.d
@@ -0,0 +1,44 @@
+
+.*: file format elf32-m68k
+
+Disassembly of section \.plt:
+
+00020800 <f.@plt-0x18>:
+# _GLOBAL_OFFSET_TABLE_ + 4 == 0x30404 == 0x20802 + 0xfc02
+ 20800: 203c 0000 fc02 movel #64514,%d0
+ 20806: 2ebb 08fa movel %pc@\(20802 <f.@plt-0x16>,%d0:l\),%sp@
+# _GLOBAL_OFFSET_TABLE_ + 8 == 0x30408 == 0x2080c + 0xfbfc
+ 2080a: 203c 0000 fbfc movel #64508,%d0
+ 20810: 207b 08fa moveal %pc@\(2080c <f.@plt-0xc>,%d0:l\),%a0
+ 20814: 4ed0 jmp %a0@
+ 20816: 4e71 nop
+
+00020818 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 12 == 0x3040c == 0x2081a + 0xfbf2
+ 20818: 203c 0000 fbf2 movel #64498,%d0
+ 2081e: 207b 08fa moveal %pc@\(2081a <f.@plt\+0x2>,%d0:l\),%a0
+ 20822: 4ed0 jmp %a0@
+ 20824: 2f3c 0000 0000 movel #0,%sp@-
+ 2082a: 61ff ffff ffd4 bsrl 20800 <f.@plt-0x18>
+
+00020830 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 16 == 0x30410 == 0x20832 + 0xfbde
+ 20830: 203c 0000 fbde movel #64478,%d0
+ 20836: 207b 08fa moveal %pc@\(20832 <f.@plt\+0x2>,%d0:l\),%a0
+ 2083a: 4ed0 jmp %a0@
+ 2083c: 2f3c 0000 000c movel #12,%sp@-
+ 20842: 61ff ffff ffbc bsrl 20800 <f.@plt-0x18>
+
+00020848 <f.@plt>:
+# _GLOBAL_OFFSET_TABLE_ + 20 == 0x30414 == 0x2084a + 0xfbca
+ 20848: 203c 0000 fbca movel #64458,%d0
+ 2084e: 207b 08fa moveal %pc@\(2084a <f.@plt\+0x2>,%d0:l\),%a0
+ 20852: 4ed0 jmp %a0@
+ 20854: 2f3c 0000 0018 movel #24,%sp@-
+ 2085a: 61ff ffff ffa4 bsrl 20800 <f.@plt-0x18>
+Disassembly of section \.text:
+
+00020c00 <.*>:
+ 20c00: 61ff ffff fc.. bsrl 208.. <f1@plt>
+ 20c06: 61ff ffff fc.. bsrl 208.. <f2@plt>
+ 20c0c: 61ff ffff fc.. bsrl 208.. <f3@plt>
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/plt1.ld b/binutils-2.21/ld/testsuite/ld-m68k/plt1.ld
new file mode 100644
index 0000000..718e2ad
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/plt1.ld
@@ -0,0 +1,23 @@
+SECTIONS
+{
+ . = 0x20000;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+
+ . = ALIGN (0x400);
+ .rela.plt : { *(.rela.plt) }
+
+ . = ALIGN (0x400);
+ .plt : { *(.plt) }
+
+ . = ALIGN (0x400);
+ .text : { *(.text) }
+
+ . = ALIGN (0x10000);
+ .dynamic : { *(.dynamic) }
+
+ . = ALIGN (0x400);
+ .got : { *(.got.plt) *(.got) }
+}
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/plt1.s b/binutils-2.21/ld/testsuite/ld-m68k/plt1.s
new file mode 100644
index 0000000..855fb19
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/plt1.s
@@ -0,0 +1,3 @@
+ bsr.l f1@PLTPC
+ bsr.l f2@PLTPC
+ bsr.l f3@PLTPC
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.d
new file mode 100644
index 0000000..59b4397
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.d
@@ -0,0 +1,4 @@
+00000000 B x
+.*
+.*
+.*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.s
new file mode 100644
index 0000000..3d758a9
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-def-1.s
@@ -0,0 +1,9 @@
+#NO_APP
+ .globl x
+ .section .tbss,"awT",@nobits
+ .align 2
+ .type x, @object
+ .size x, 4
+x:
+ .zero 4
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d
new file mode 100644
index 0000000..0cad6fc
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d
@@ -0,0 +1,21 @@
+#as: -mcpu=5206
+#source: tls-gd-1.s
+#ld: -shared
+#readelf: -d -r
+
+Dynamic section at offset .* contains 9 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 24 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_DTPMOD3 00000000 x \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_DTPREL3 00000000 x \+ 0
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d2 b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d2
new file mode 100644
index 0000000..b6167e3
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d2
@@ -0,0 +1,5 @@
+.* U x
+.*
+.*
+.*
+.*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d3 b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d3
new file mode 100644
index 0000000..4b835d3
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.d3
@@ -0,0 +1,13 @@
+
+Dynamic section at offset .* contains .*:
+ * Tag * Type * Name/Value
+ 0x00000001 \(NEEDED\) * Shared library: \[tmpdir/tls-def-1.so\]
+ 0x00000004 \(HASH\) .*
+ 0x00000005 \(STRTAB\) .*
+ 0x00000006 \(SYMTAB\) .*
+ 0x0000000a \(STRSZ\) .*
+ 0x0000000b \(SYMENT\) .*
+ 0x00000007 \(RELA\) .*
+ 0x00000008 \(RELASZ\) .*
+ 0x00000009 \(RELAENT\) .*
+ 0x00000000 \(NULL\) .*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.s
new file mode 100644
index 0000000..c79da2e
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-1.s
@@ -0,0 +1,16 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+
+ pea x@TLSGD(%a5)
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.d
new file mode 100644
index 0000000..28ba4f5
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.d
@@ -0,0 +1,24 @@
+#as: -mcpu=5206
+#source: tls-gd-2.s
+#ld: -shared
+#readelf: -d -r
+
+Dynamic section at offset .* contains 10 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 48 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000016 \(TEXTREL\) 0x0
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+[0-9a-f]+ [0-9a-f]+ R_68K_32 00000000 __tls_get_addr \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_32 00000000 __tls_get_addr \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_DTPMOD3 00000000 x \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_DTPREL3 00000000 x \+ 0
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.s
new file mode 100644
index 0000000..3bb58d4
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-2.s
@@ -0,0 +1,24 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+
+ pea x@TLSGD(%a5)
+ jbsr __tls_get_addr
+
+ move.l %a5,%a0
+ add.l x@TLSGD,%a0
+ pea (%a0)
+ jbsr __tls_get_addr
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.d
new file mode 100644
index 0000000..87de346
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.d
@@ -0,0 +1,25 @@
+#as: -mcpu=5206
+#source: tls-gd-ie-1.s
+#ld: -shared
+#readelf: -d -r
+
+Dynamic section at offset .* contains 10 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 60 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000016 \(TEXTREL\) 0x0
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 5 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+[0-9a-f]+ [0-9a-f]+ R_68K_32 00000000 __tls_get_addr \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_32 00000000 __m68k_read_tp \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_DTPMOD3 00000000 x \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_DTPREL3 00000000 x \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_TPREL32 00000000 x \+ 0
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.s
new file mode 100644
index 0000000..6536137
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-gd-ie-1.s
@@ -0,0 +1,23 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+
+ pea x@TLSGD(%a5)
+ jbsr __tls_get_addr
+
+ jbsr __m68k_read_tp
+ move.l x@TLSIE(%a5),%a1
+ add.l %a0,%a1
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.d
new file mode 100644
index 0000000..5574ad4
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.d
@@ -0,0 +1,22 @@
+#as: -mcpu=5206
+#source: tls-ie-1.s
+#ld: -shared
+#readelf: -d -r
+
+Dynamic section at offset .* contains 10 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 24 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000016 \(TEXTREL\) 0x0
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+[0-9a-f]+ [0-9a-f]+ R_68K_32 00000000 __m68k_read_tp \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_TPREL32 00000000 x \+ 0
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.s
new file mode 100644
index 0000000..29326a0
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-ie-1.s
@@ -0,0 +1,20 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+
+ jbsr __m68k_read_tp
+ move.l x@TLSIE(%a5),%a1
+ add.l %a0,%a1
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.d
new file mode 100644
index 0000000..01e8904
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.d
@@ -0,0 +1,22 @@
+#as: -mcpu=5206
+#source: tls-ld-1.s
+#ld: -shared
+#readelf: -d -r
+
+Dynamic section at offset .* contains 10 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000007 \(RELA\) 0x[0-9a-f]+
+ 0x00000008 \(RELASZ\) 24 \(bytes\)
+ 0x00000009 \(RELAENT\) 12 \(bytes\)
+ 0x00000016 \(TEXTREL\) 0x0
+ 0x00000000 \(NULL\) 0x0
+
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+[0-9a-f]+ [0-9a-f]+ R_68K_32 00000000 __tls_get_addr \+ 0
+[0-9a-f]+ [0-9a-f]+ R_68K_TLS_DTPMOD3 00000000
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.s
new file mode 100644
index 0000000..47bc6e1
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-1.s
@@ -0,0 +1,21 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+
+ pea x3@TLSLDM(%a5)
+ jbsr __tls_get_addr
+ move.l %d0,%a1
+ add.l x4@TLSLDO,%a1
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.d
new file mode 100644
index 0000000..ee1bac5
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.d
@@ -0,0 +1,15 @@
+#as: -mcpu=5206
+#source: tls-ld-2.s
+#ld: -shared
+#readelf: -d -r
+
+Dynamic section at offset .* contains 6 entries:
+ Tag Type Name/Value
+ 0x00000004 \(HASH\) 0x[0-9a-f]+
+ 0x00000005 \(STRTAB\) 0x[0-9a-f]+
+ 0x00000006 \(SYMTAB\) 0x[0-9a-f]+
+ 0x0000000a \(STRSZ\) [0-9]+ \(bytes\)
+ 0x0000000b \(SYMENT\) 16 \(bytes\)
+ 0x00000000 \(NULL\) 0x0
+
+There are no relocations in this file.
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.s
new file mode 100644
index 0000000..b1c447f
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-ld-2.s
@@ -0,0 +1,19 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+
+ move.l %d0,%a1
+ add.l x@TLSLDO,%a1
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-le-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-le-1.s
new file mode 100644
index 0000000..b1e9c13
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-le-1.s
@@ -0,0 +1,20 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+
+ jbsr __m68k_read_tp
+ move.l x@TLSLE(%a5),%a1
+ add.l %a0,%a1
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.d b/binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.d
new file mode 100644
index 0000000..7da24ab
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.d
@@ -0,0 +1,15 @@
+
+Dynamic section at offset .* contains .*:
+ * Tag * Type * Name/Value
+ 0x00000001 \(NEEDED\) * Shared library: \[tmpdir/tls-gd-1.so\]
+ 0x00000001 \(NEEDED\) * Shared library: \[tls-def-1.so\]
+ 0x00000004 \(HASH\) .*
+ 0x00000005 \(STRTAB\) .*
+ 0x00000006 \(SYMTAB\) .*
+ 0x0000000a \(STRSZ\) .*
+ 0x0000000b \(SYMENT\) .*
+ 0x00000015 \(DEBUG\) .*
+ 0x00000007 \(RELA\) .*
+ 0x00000008 \(RELASZ\) .*
+ 0x00000009 \(RELAENT\) .*
+ 0x00000000 \(NULL\) .*
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.s
new file mode 100644
index 0000000..75fb6d6
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-main-1.s
@@ -0,0 +1,19 @@
+#NO_APP
+ .text
+ .align 2
+ .globl main
+ .type main, @function
+ .globl _start
+ .type _start, @function
+main:
+_start:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+ move.l x@TLSIE(%a5),%a0
+ move.l -4(%fp),%a5
+ unlk %fp
+ rts
+ .size main, .-main
+ .section .note.GNU-stack,"",@progbits
diff --git a/binutils-2.21/ld/testsuite/ld-m68k/tls-no-1.s b/binutils-2.21/ld/testsuite/ld-m68k/tls-no-1.s
new file mode 100644
index 0000000..4e59919
--- /dev/null
+++ b/binutils-2.21/ld/testsuite/ld-m68k/tls-no-1.s
@@ -0,0 +1,18 @@
+#NO_APP
+ .text
+ .align 2
+ .globl foo
+ .type foo, @function
+foo:
+ link.w %fp,#0
+ move.l %a5,-(%sp)
+ move.l #_GLOBAL_OFFSET_TABLE_@GOTPC, %a5
+ lea (-6, %pc, %a5), %a5
+
+ move.l x@GOT(%a5),%d0
+
+ move.l (%sp)+,%a5
+ unlk %fp
+ rts
+ .size foo, .-foo
+ .section .note.GNU-stack,"",@progbits