aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-11-21 12:06:26 +0000
committerNick Clifton <nickc@redhat.com>2007-11-21 12:06:26 +0000
commitfc91707cc23bf4d1cd75cc754c28cc4ff6b8c5bd (patch)
tree621e934241b754dc7b872c4d45b4b54df447a19a /ld
parent031cd65fb243f8dc3bddfa4a4862a710ff1afde7 (diff)
downloadgdb-fc91707cc23bf4d1cd75cc754c28cc4ff6b8c5bd.zip
gdb-fc91707cc23bf4d1cd75cc754c28cc4ff6b8c5bd.tar.gz
gdb-fc91707cc23bf4d1cd75cc754c28cc4ff6b8c5bd.tar.bz2
* elf-m10300.c (mn10300_elf_relax_section): Allow for alignment relocs when
computing whether instructions can be relaxed. * ld-mn10300/i135409-4.s: New test case. Check for relaxation to a 16-bit jump instruction. * ld-mn10300/i135409-4.t: Linker script for the new test. * ld-mn10300/i135409-4.d: Expected disassembly of new test. * ld-mn10300/mn10300.exp: Run the new test.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-mn10300/i135409-4.d7
-rw-r--r--ld/testsuite/ld-mn10300/i135409-4.s8
-rw-r--r--ld/testsuite/ld-mn10300/i135409-4.t23
-rw-r--r--ld/testsuite/ld-mn10300/mn10300.exp8
5 files changed, 54 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index da6d9b0..7e8719a 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-21 Nick Clifton <nickc@redhat.com>
+
+ * ld-mn10300/i135409-4.s: New test case. Check for relaxation to
+ a 16-bit jump instruction.
+ * ld-mn10300/i135409-4.t: Linker script for the new test.
+ * ld-mn10300/i135409-4.d: Expected disassembly of new test.
+ * ld-mn10300/mn10300.exp: Run the new test.
+
2007-11-20 Nick Clifton <nickc@redhat.com>
* lib/ld-lib.exp (check_gc_sections_available): New proc, based
diff --git a/ld/testsuite/ld-mn10300/i135409-4.d b/ld/testsuite/ld-mn10300/i135409-4.d
new file mode 100644
index 0000000..f14ea7d
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i135409-4.d
@@ -0,0 +1,7 @@
+
+tmpdir/i135409-4.x: file format elf32-.*
+
+Disassembly of section .text:
+
+0+0 <_start>:
+ 0:[ ]+cc 00 07[ ]+jmp[ ]+700 \<L001\>
diff --git a/ld/testsuite/ld-mn10300/i135409-4.s b/ld/testsuite/ld-mn10300/i135409-4.s
new file mode 100644
index 0000000..90badde
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i135409-4.s
@@ -0,0 +1,8 @@
+ .text
+ .global _start
+_start:
+ jmp L001
+
+ .section .text1
+L001:
+ nop
diff --git a/ld/testsuite/ld-mn10300/i135409-4.t b/ld/testsuite/ld-mn10300/i135409-4.t
new file mode 100644
index 0000000..9d905cb
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i135409-4.t
@@ -0,0 +1,23 @@
+SECTIONS
+{
+ . = 0x0;
+ .text :
+ {
+ *(.text)
+ }
+
+ . = 0x700;
+ .text1 :
+ {
+ *(.text1)
+ }
+ . = 0x8100;
+ .bss :
+ {
+ *(.bss)
+ }
+ .data :
+ {
+ *(.data)
+ }
+}
diff --git a/ld/testsuite/ld-mn10300/mn10300.exp b/ld/testsuite/ld-mn10300/mn10300.exp
index a8128ed..f67881f 100644
--- a/ld/testsuite/ld-mn10300/mn10300.exp
+++ b/ld/testsuite/ld-mn10300/mn10300.exp
@@ -79,6 +79,14 @@ set mn10300_tests {
{ {objdump -d i135409-3.d} }
"i135409-3.x"
}
+ {
+ "adjusting a 16 bit branch"
+ "-Ti135409-4.t -relax"
+ ""
+ { "i135409-4.s" }
+ { {objdump -d i135409-4.d} }
+ "i135409-4.x"
+ }
}
run_ld_link_tests $mn10300_tests