aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp3
-rw-r--r--ld/testsuite/ld-arm/arm-movwt.d39
-rw-r--r--ld/testsuite/ld-arm/arm-movwt.s44
-rw-r--r--ld/testsuite/ld-arm/arm.ld2
5 files changed, 95 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 828dce1..efe7187 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-11 Paul Brook <paul@codesourcery.com>
+
+ * ld-arm/arm-elf.exp: Add arm-movwt.
+ * ld-arm/arm-movwt.d: New test.
+ * ld-arm/arm-movwt.s: New test.
+ * ld-arm/arm.ld: Add .far.
+
2006-05-11 Mike Bland <mbland@google.com>
* ld-elf/stab.d: New.
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 1a9fc00..04aa09c 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -122,6 +122,9 @@ set armelftests {
{"thumb-rel32" "-static -T arm.ld" "" {thumb-rel32.s}
{{objdump -s thumb-rel32.d}}
"thumb-rel32"}
+ {"MOVW/MOVT" "-static -T arm.ld" "" {arm-movwt.s}
+ {{objdump -dw arm-movwt.d}}
+ "arm-movwt"}
}
run_ld_link_tests $armelftests
diff --git a/ld/testsuite/ld-arm/arm-movwt.d b/ld/testsuite/ld-arm/arm-movwt.d
new file mode 100644
index 0000000..bf55164
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-movwt.d
@@ -0,0 +1,39 @@
+
+.*: file format.*
+
+Disassembly of section .text:
+
+00008000 <[^>]*>:
+ 8000: e3000000 movw r0, #0 ; 0x0
+ 8004: e3411234 movt r1, #4660 ; 0x1234
+ 8008: e3082000 movw r2, #32768 ; 0x8000
+ 800c: e3413233 movt r3, #4659 ; 0x1233
+ 8010: e3004011 movw r4, #17 ; 0x11
+ 8014: e3415234 movt r5, #4660 ; 0x1234
+ 8018: e3086011 movw r6, #32785 ; 0x8011
+ 801c: e3417233 movt r7, #4659 ; 0x1233
+
+00008020 <[^>]*>:
+ 8020: f240 0700 movw r7, #0 ; 0x0
+ 8024: f2c1 2634 movt r6, #4660 ; 0x1234
+ 8028: f248 0500 movw r5, #32768 ; 0x8000
+ 802c: f2c1 2433 movt r4, #4659 ; 0x1233
+ 8030: f240 0311 movw r3, #17 ; 0x11
+ 8034: f2c1 2234 movt r2, #4660 ; 0x1234
+ 8038: f248 0111 movw r1, #32785 ; 0x8011
+ 803c: f2c1 2033 movt r0, #4659 ; 0x1233
+
+Disassembly of section .far:
+
+12340000 <[^>]*>:
+12340000: e3080000 movw r0, #32768 ; 0x8000
+12340004: e34e0dcc movt r0, #60876 ; 0xedcc
+12340008: e3080021 movw r0, #32801 ; 0x8021
+1234000c: e34e0dcc movt r0, #60876 ; 0xedcc
+
+12340010 <[^>]*>:
+12340010: f248 0000 movw r0, #32768 ; 0x8000
+12340014: f6ce 50cc movt r0, #60876 ; 0xedcc
+12340018: f248 0021 movw r0, #32801 ; 0x8021
+1234001c: f6ce 50cc movt r0, #60876 ; 0xedcc
+
diff --git a/ld/testsuite/ld-arm/arm-movwt.s b/ld/testsuite/ld-arm/arm-movwt.s
new file mode 100644
index 0000000..ba8b1c5
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-movwt.s
@@ -0,0 +1,44 @@
+ .text
+ .arch armv6t2
+ .syntax unified
+ .global _start
+ .type _start, %function
+_start:
+base1:
+arm1:
+ movw r0, #:lower16:arm2
+ movt r1, #:upper16:arm2
+ movw r2, #:lower16:(arm2 - arm1)
+ movt r3, #:upper16:(arm2 - arm1)
+ movw r4, #:lower16:thumb2
+ movt r5, #:upper16:thumb2
+ movw r6, #:lower16:(thumb2 - arm1)
+ movt r7, #:upper16:(thumb2 - arm1)
+ .thumb
+ .type thumb1, %function
+ .thumb_func
+thumb1:
+ movw r7, #:lower16:arm2
+ movt r6, #:upper16:arm2
+ movw r5, #:lower16:(arm2 - arm1)
+ movt r4, #:upper16:(arm2 - arm1)
+ movw r3, #:lower16:thumb2
+ movt r2, #:upper16:thumb2
+ movw r1, #:lower16:(thumb2 - arm1)
+ movt r0, #:upper16:(thumb2 - arm1)
+
+ .section .far, "ax", %progbits
+ .arm
+arm2:
+ movw r0, #:lower16:(arm1 - arm2)
+ movt r0, #:upper16:(arm1 - arm2)
+ movw r0, #:lower16:(thumb1 - arm2)
+ movt r0, #:upper16:(thumb1 - arm2)
+ .thumb
+ .type thumb2, %function
+ .thumb_func
+thumb2:
+ movw r0, #:lower16:(arm1 - arm2)
+ movt r0, #:upper16:(arm1 - arm2)
+ movw r0, #:lower16:(thumb1 - arm2)
+ movt r0, #:upper16:(thumb1 - arm2)
diff --git a/ld/testsuite/ld-arm/arm.ld b/ld/testsuite/ld-arm/arm.ld
index 4ef7d82..c9e01e6 100644
--- a/ld/testsuite/ld-arm/arm.ld
+++ b/ld/testsuite/ld-arm/arm.ld
@@ -14,5 +14,7 @@ SECTIONS
} =0
. = 0x9000;
.got : { *(.got) *(.got.plt)}
+ . = 0x12340000;
+ .far : { *(.far) }
.ARM.attribues 0 : { *(.ARM.atttributes) }
}