aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2008-03-08 01:20:39 +0000
committerPaul Brook <paul@codesourcery.com>2008-03-08 01:20:39 +0000
commit39623e120c11861d80f4859ccf3e7b77b7c15fa3 (patch)
treec3b3b4d318c5eee2423edcdef40bf8b4b984769e /ld
parent460b2855087fab29ecd3b0546ec28ecb259e45ab (diff)
downloadgdb-39623e120c11861d80f4859ccf3e7b77b7c15fa3.zip
gdb-39623e120c11861d80f4859ccf3e7b77b7c15fa3.tar.gz
gdb-39623e120c11861d80f4859ccf3e7b77b7c15fa3.tar.bz2
2008-03-07 Paul Brook <paul@codesourcery.com>
bfd/ * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and MOVT relocations. (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign extension. (elf32_arm_relocate_section): Handle MOVW and MOVT relocations. Improve safety check for other weird relocations. (elf32_arm_check_relocs): Only set h->needs_plt for branch/call relocations. gas/ * config/tc-arm.c (md_apply_fix): Use correct offset range. ld/testsuite/ * ld-arm/arm-elf.exp (armelftests): Add movw-merge and arm-app-movw. * ld-arm/arm-app-movw.s: New test. * ld-arm/arm-app.r: Update expected output. * ld-arm/movw-merge.d: New test. * ld-arm/movw-merge.s: New test.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-arm/arm-app-movw.s11
-rw-r--r--ld/testsuite/ld-arm/arm-app.r2
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp6
-rw-r--r--ld/testsuite/ld-arm/movw-merge.d13
-rw-r--r--ld/testsuite/ld-arm/movw-merge.s20
6 files changed, 59 insertions, 1 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 91eb52f..a30eba9 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2008-03-07 Paul Brook <paul@codesourcery.com>
+
+ * ld-arm/arm-elf.exp (armelftests): Add movw-merge and arm-app-movw.
+ * ld-arm/arm-app-movw.s: New test.
+ * ld-arm/arm-app.r: Update expected output.
+ * ld-arm/movw-merge.d: New test.
+ * ld-arm/movw-merge.s: New test.
+
2008-03-01 Alan Modra <amodra@bigpond.net.au>
* ld-powerpc/relbrlt.d: Update. Also check .branch_lt section.
diff --git a/ld/testsuite/ld-arm/arm-app-movw.s b/ld/testsuite/ld-arm/arm-app-movw.s
new file mode 100644
index 0000000..55ced97
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-app-movw.s
@@ -0,0 +1,11 @@
+ .text
+ .globl _start
+_start:
+ movw r0, #:lower16:data_obj
+ movt r0, #:upper16:data_obj
+ movw r0, #:lower16:lib_func1
+ movt r0, #:upper16:lib_func1
+
+ .globl app_func2
+app_func2:
+ bx lr
diff --git a/ld/testsuite/ld-arm/arm-app.r b/ld/testsuite/ld-arm/arm-app.r
index a249392..4b25e70 100644
--- a/ld/testsuite/ld-arm/arm-app.r
+++ b/ld/testsuite/ld-arm/arm-app.r
@@ -1,5 +1,5 @@
-tmpdir/arm-app: file format elf32-(little|big)arm
+tmpdir/arm-app.*: file format elf32-(little|big)arm
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 3f2b69c..7c6ee21 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -176,6 +176,12 @@ set armelftests {
{"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "--fix-v4bx -meabi=4" {armv4-bx.s}
{{objdump -d armv4-bx.d}}
"armv4-bx"}
+ {"MOVW/MOVT and merged sections" "-T arm.ld" "" {movw-merge.s}
+ {{objdump -dw movw-merge.d}}
+ "movw-merge"}
+ {"MOVW/MOVT against shared libraries" "tmpdir/arm-lib.so" "" {arm-app-movw.s}
+ {{objdump -Rw arm-app.r}}
+ "arm-app-movw"}
}
run_ld_link_tests $armelftests
diff --git a/ld/testsuite/ld-arm/movw-merge.d b/ld/testsuite/ld-arm/movw-merge.d
new file mode 100644
index 0000000..2df4737
--- /dev/null
+++ b/ld/testsuite/ld-arm/movw-merge.d
@@ -0,0 +1,13 @@
+
+.*: file format.*
+
+Disassembly of section .text:
+
+00008000 <[^>]*>:
+ 8000: e3080013 movw r0, #32787 ; 0x8013
+ 8004: e3400000 movt r0, #0 ; 0x0
+
+00008008 <[^>]*>:
+ 8008: f248 0013 movw r0, #32787 ; 0x8013
+ 800c: f2c0 0000 movt r0, #0 ; 0x0
+
diff --git a/ld/testsuite/ld-arm/movw-merge.s b/ld/testsuite/ld-arm/movw-merge.s
new file mode 100644
index 0000000..17c70a5
--- /dev/null
+++ b/ld/testsuite/ld-arm/movw-merge.s
@@ -0,0 +1,20 @@
+ .arch armv7-a
+ .syntax unified
+ .text
+ .global _start
+ .type _start, %function
+_start:
+ movw r0, #:lower16:.LC0
+ movt r0, #:upper16:.LC0
+ .thumb
+ .global tfunc
+ .type tfunc, %function
+tfunc:
+ movw r0, #:lower16:.LC0
+ movt r0, #:upper16:.LC0
+
+ .section .rodata.str1.4,"aMS",%progbits,1
+ .align 2
+ .ascii "pad"
+.LC0:
+ .ascii "inner: cont \000"