summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mn10300
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-10-30 15:18:29 +0000
committerNick Clifton <nickc@redhat.com>2007-10-30 15:18:29 +0000
commit7987ef980554529fa54528939adb7ba63306897d (patch)
tree1e6aeb86cdfb994ba982f27a12e099684950faf9 /ld/testsuite/ld-mn10300
parent0da3e234553ae5878ee7b8cdcd26673a3bfc8c67 (diff)
downloadbinutils-redhat-7987ef980554529fa54528939adb7ba63306897d.tar.gz
* mn10300.h (R_MN10300_ALIGN): Define.
* reloc.c (BFD_RELOC_MN10300_ALIGN): Add. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf-m10300.h: Handle R_MN10300_ALIGN relocs. * mn10300_elf_relax_delete_bytes): Honour R_MN10300_ALIGN relocs. Re-fix off by one error in comparisons. * config/tc-mn10300.c (tc_gen_reloc): Fix test that decides when sym_diff relocs should be generated. (md_apply_fix): Skip R_MN10300_ALIGN relocs. (mn10300_fix_adjustable): Do not adjust R_MN10300_ALIGN relocs. (mn10300_handle_align): New function. Generate R_MN10300_ALIGN relocs to record alignment requests. * config/tc-mn10300.h (TC_FORCE_RELOCATION_SUB_SAME): Also force R_MN10300_ALIGN relocs. (HANDLE_ALIGN): Define. Call mn10300_handle_align. * gas/all/gas.exp: Do not run diff1.s test for mn10300. * ld-mn10300/mn10300.exp: Run new tests. Skip i126256 test if a compiler is not available. * ld-mn10300/i112045-3.s: New test. * ld-mn10300/i112045-3.d: Expected disassembly. * ld-mn10300/i135409.s: Rename to i135409-1.s. * ld-mn10300/i135409.d: Rename to i135409-1.d * ld-mn10300/i135409-2.s: New test. * ld-mn10300/i135409-2.d: Expected symbol table. * ld-mn10300/i36434.d: Adjust expected disassembly.
Diffstat (limited to 'ld/testsuite/ld-mn10300')
-rw-r--r--ld/testsuite/ld-mn10300/i112045-3.d17
-rw-r--r--ld/testsuite/ld-mn10300/i112045-3.s11
-rw-r--r--ld/testsuite/ld-mn10300/i135409-1.d (renamed from ld/testsuite/ld-mn10300/i135409.d)0
-rw-r--r--ld/testsuite/ld-mn10300/i135409-1.s (renamed from ld/testsuite/ld-mn10300/i135409.s)0
-rw-r--r--ld/testsuite/ld-mn10300/i135409-2.d11
-rw-r--r--ld/testsuite/ld-mn10300/i135409-2.s23
-rw-r--r--ld/testsuite/ld-mn10300/i36434.d20
-rw-r--r--ld/testsuite/ld-mn10300/mn10300.exp55
8 files changed, 114 insertions, 23 deletions
diff --git a/ld/testsuite/ld-mn10300/i112045-3.d b/ld/testsuite/ld-mn10300/i112045-3.d
new file mode 100644
index 0000000000..c4b2f4bf69
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i112045-3.d
@@ -0,0 +1,17 @@
+
+tmpdir/i112045-3.x: file format elf32-.*
+
+Disassembly of section .text:
+
+0+0100 <L001>:
+ 100:[ ]+24 00 01[ ]+mov[ ]+256,a0
+
+0+0103 <L002>:
+ 103:[ ]+24 00 01[ ]+mov[ ]+256,a0
+Disassembly of section .rodata:
+
+0+0106 <L004>:
+ 106:[ ]+06 00 00[ ]+movbu[ ]+d1,\(0 <L001-0x100>\)
+ 109:[ ]+00[ ]+clr[ ]+d0
+ 10a:[ ]+03 00 00[ ]+movhu[ ]+d0,\(0 <L001-0x100>\)
+[ ]+...
diff --git a/ld/testsuite/ld-mn10300/i112045-3.s b/ld/testsuite/ld-mn10300/i112045-3.s
new file mode 100644
index 0000000000..b372a77838
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i112045-3.s
@@ -0,0 +1,11 @@
+ .text
+L001:
+ mov L001,A0
+L002:
+ mov L001,A0
+L003:
+
+ .section .rodata
+L004:
+ .long L003-L001
+ .long L003-L002
diff --git a/ld/testsuite/ld-mn10300/i135409.d b/ld/testsuite/ld-mn10300/i135409-1.d
index 2d64a42ca3..2d64a42ca3 100644
--- a/ld/testsuite/ld-mn10300/i135409.d
+++ b/ld/testsuite/ld-mn10300/i135409-1.d
diff --git a/ld/testsuite/ld-mn10300/i135409.s b/ld/testsuite/ld-mn10300/i135409-1.s
index b9faaf4117..b9faaf4117 100644
--- a/ld/testsuite/ld-mn10300/i135409.s
+++ b/ld/testsuite/ld-mn10300/i135409-1.s
diff --git a/ld/testsuite/ld-mn10300/i135409-2.d b/ld/testsuite/ld-mn10300/i135409-2.d
new file mode 100644
index 0000000000..59c07e37c2
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i135409-2.d
@@ -0,0 +1,11 @@
+
+Symbol table '.symtab' contains .. entries:
+ Num: Value Size Type Bind Vis Ndx Name
+#...
+ ..: 0[0-9a-f]+02[ ]+0 NOTYPE LOCAL DEFAULT . _A
+ ..: 0[0-9a-f]+08[ ]+0 NOTYPE LOCAL DEFAULT . _B
+ ..: 0[0-9a-f]+08[ ]+0 NOTYPE LOCAL DEFAULT . _C
+ ..: 0[0-9a-f]+10[ ]+7 FUNC LOCAL DEFAULT . _func
+ ..: 0[0-9a-f]+14[ ]+0 NOTYPE LOCAL DEFAULT . _D
+ ..: 0[0-9a-f]+17[ ]+0 NOTYPE LOCAL DEFAULT . BOTTOM
+#pass
diff --git a/ld/testsuite/ld-mn10300/i135409-2.s b/ld/testsuite/ld-mn10300/i135409-2.s
new file mode 100644
index 0000000000..36448ed6ef
--- /dev/null
+++ b/ld/testsuite/ld-mn10300/i135409-2.s
@@ -0,0 +1,23 @@
+ .text
+ .global _start
+_start:
+ add A0, A1
+_A:
+ mov L001, A0
+_B:
+ .balign 0x8
+_C:
+ nop
+ .balign 0x10
+
+ .type _func, @function
+_func:
+ mov L001, A1
+ nop
+_D:
+ mov L001, A1
+BOTTOM:
+ .size _func, . - _func
+
+ .data
+L001:
diff --git a/ld/testsuite/ld-mn10300/i36434.d b/ld/testsuite/ld-mn10300/i36434.d
index 25cea45bf7..af37b3b0c4 100644
--- a/ld/testsuite/ld-mn10300/i36434.d
+++ b/ld/testsuite/ld-mn10300/i36434.d
@@ -3,14 +3,14 @@ tmpdir/i36434.x: file format elf32-.*
Disassembly of section .text:
-08000000 <_start>:
- 8000000: fc cd 18 80 mov 134250520,d1
- 8000004: 00 08
- 8000006: cb nop
+08000074 <_start>:
+ 8000074: fc cd 8c 80 mov 134250636,d1
+ 8000078: 00 08
+ 800007a: cb nop
-08000007 <_bar>:
- 8000007: fc cc 14 00 mov 134217748,d0
- 800000b: 00 08
- 800000d: fc cd 15 80 mov 134250517,d1
- 8000011: 00 08
- 8000013: cb nop
+0800007b <_bar>:
+ 800007b: fc cc 88 00 mov 134217864,d0
+ 800007f: 00 08
+ 8000081: fc cd 89 80 mov 134250633,d1
+ 8000085: 00 08
+ 8000087: cb nop
diff --git a/ld/testsuite/ld-mn10300/mn10300.exp b/ld/testsuite/ld-mn10300/mn10300.exp
index 14ba85b20a..18bbad3d8f 100644
--- a/ld/testsuite/ld-mn10300/mn10300.exp
+++ b/ld/testsuite/ld-mn10300/mn10300.exp
@@ -22,17 +22,17 @@ if {!([istarget "am3*-*-*"]) && !([istarget "mn10300*-*-*"]) } {
# Set up a list as described in ld-lib.exp
-set am33_tests {
+set mn10300_tests {
{
"am33 string merging"
- "--relax -Ttext 0x8000000"
+ "-relax -Ttext 0x8000074"
""
{ "i36434.s" "i36434-2.s" }
{ {objdump -dz i36434.d} }
"i36434.x"
}
{
- "difference of two symbols"
+ "difference of two same-section symbols"
"-Ttext 0"
""
{ "i112045-1.s" }
@@ -40,20 +40,45 @@ set am33_tests {
"i112045-1.x"
}
{
- "(shared) difference of two symbols"
- "-shared"
+ "difference of two same-section symbols where the difference is held in another section"
+ "-relax -Ttext 100"
""
- { "i112045-2.s" }
- { {objdump -R i112045-2.d} }
- "i112045-2.x"
+ { "i112045-3.s" }
+ { {objdump -D i112045-3.d} }
+ "i112045-3.x"
}
{
"adjustment of symbols due to relaxation"
- "-Tdata 1f -relax"
+ "-Tdata 1f -Ttext 0 -relax"
+ ""
+ { "i135409-1.s" }
+ { {readelf --syms i135409-1.d} }
+ "i135409-1.x"
+ }
+ {
+ "adjustment of symbols due to relaxation (with alignment directives)"
+ "-Tdata 1f -Ttext 0 -relax"
+ ""
+ { "i135409-2.s" }
+ { {readelf --syms i135409-2.d} }
+ "i135409-2.x"
+ }
+}
+
+run_ld_link_tests $mn10300_tests
+
+if {!([istarget "am3*-*-*"])} {
+ return
+}
+
+set am33_tests {
+ {
+ "difference of two same-section symbols (in a shared library)"
+ "-shared"
""
- { "i135409.s" }
- { {readelf --syms i135409.d } }
- "i135409.x"
+ { "i112045-2.s" }
+ { {objdump -R i112045-2.d} }
+ "i112045-2.x"
}
}
@@ -66,7 +91,11 @@ proc i126256-test { } {
global subdir
set tmpdir tmpdir
- set testname "Issue 126256 - seg fault whilst linking one shared library into another when relaxation is enabled."
+ set testname "Seg fault whilst linking one shared library into another when relaxation is enabled."
+
+ if {![is_remote host] && [which $CC] == 0} then {
+ return
+ }
if { ![ld_compile "$CC -mrelax -fPIC" $srcdir/$subdir/i126256-1.c $tmpdir/i126256-1.o] } {
unresolved $testname