aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-mn10300/i127740.d17
-rw-r--r--ld/testsuite/ld-mn10300/i127740.s12
-rw-r--r--ld/testsuite/ld-mn10300/i135409-3.d16
-rw-r--r--ld/testsuite/ld-mn10300/i135409-3.s16
-rw-r--r--ld/testsuite/ld-mn10300/mn10300.exp16
6 files changed, 85 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 0805299..83fce11 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-13 Nick Clifton <nickc@redhat.com>
+
+ * ld-mn10300/i127740.s: New test: Checks relaxation and alignment.
+ * ld-mn10300/i127740.d: New file: Expected disassembly.
+ * ld-mn10300/i135409-3.s: New test: Check symbols inside a relaxed region.
+ * ld-mn10300/i135409-3.d: New file: Expected disassembly.
+ * ld-mn10300/mn10300.exp: Run new tests.
+
2007-11-08 Nathan Sidwell <nathan@codesourcery.com>
* ld-vxworks/tls-2.d: New.
diff --git a/ld/testsuite/ld-mn10300/i127740.d b/ld/testsuite/ld-mn10300/i127740.d
new file mode 100644
index 0000000..456a75b
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i127740.d
@@ -0,0 +1,17 @@
+
+tmpdir/i127740.x: file format elf32-.*
+
+Disassembly of section .text:
+
+0+0100 <_main>:
+ 100: 2d 00 03[ ]+mov 768,d1
+ 103: cb[ ]+nop
+ 104: cb[ ]+nop
+ 105: cb[ ]+nop
+ ...
+
+0+0200 <_dummy>:
+ 200: 00[ ]+clr d0
+ 201: 02 00 00[ ]+movbu d0,\(0 <_main-0x100>\)
+ 204: df 00 00[ ]+ret \[\],0
+ ...
diff --git a/ld/testsuite/ld-mn10300/i127740.s b/ld/testsuite/ld-mn10300/i127740.s
new file mode 100644
index 0000000..358266b
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i127740.s
@@ -0,0 +1,12 @@
+ .section .text
+ .global _main
+ .global _dummy
+_main:
+ mov _g_label,d1 # instruction is changed by relaxations
+
+ .balign 0x100
+_dummy:
+ .long _dummy
+ ret [],0
+ .size _main, .-_main
+ .comm _g_label,4,4
diff --git a/ld/testsuite/ld-mn10300/i135409-3.d b/ld/testsuite/ld-mn10300/i135409-3.d
new file mode 100644
index 0000000..1ea91ba
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i135409-3.d
@@ -0,0 +1,16 @@
+
+tmpdir/i135409-3.x: file format elf32-.*
+
+Disassembly of section .text:
+
+0+0 <_func>:
+ 0: 25 1f 00[ ]+mov 31,a1
+ 3: cb[ ]+nop
+
+0+04 <A>:
+ 4: 25 1f 00[ ]+mov 31,a1
+ 7: cb[ ]+nop
+
+0+08 <BOTTOM>:
+ 8: e1[ ]+add d0,d1
+#pass
diff --git a/ld/testsuite/ld-mn10300/i135409-3.s b/ld/testsuite/ld-mn10300/i135409-3.s
new file mode 100644
index 0000000..e83ad96
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i135409-3.s
@@ -0,0 +1,16 @@
+ .text
+ .global _start
+_start:
+ .type _func, @function
+_func:
+ mov L001,A1
+ nop
+A:
+ mov L001,A1
+BOTTOM:
+ .balign 0x8
+ add D0,D1
+ .size _func, .-func
+
+ .data
+L001:
diff --git a/ld/testsuite/ld-mn10300/mn10300.exp b/ld/testsuite/ld-mn10300/mn10300.exp
index 18bbad3..232a5fb 100644
--- a/ld/testsuite/ld-mn10300/mn10300.exp
+++ b/ld/testsuite/ld-mn10300/mn10300.exp
@@ -48,6 +48,14 @@ set mn10300_tests {
"i112045-3.x"
}
{
+ "relaxation and alignment directives"
+ "-relax -Ttext 100"
+ ""
+ { "i127740.s" }
+ { {objdump -d i127740.d} }
+ "i127740.x"
+ }
+ {
"adjustment of symbols due to relaxation"
"-Tdata 1f -Ttext 0 -relax"
""
@@ -63,6 +71,14 @@ set mn10300_tests {
{ {readelf --syms i135409-2.d} }
"i135409-2.x"
}
+ {
+ "adjustment of symbols due to relaxation (with a symbol in the deleted region)"
+ "-Tdata 1f -Ttext 0 -relax"
+ ""
+ { "i135409-3.s" }
+ { {objdump -d i135409-3.d} }
+ "i135409-3.x"
+ }
}
run_ld_link_tests $mn10300_tests