diff options
author | Joseph Myers <joseph@codesourcery.com> | 2009-04-30 00:01:11 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2009-04-30 00:01:11 +0000 |
commit | 96c23d596607cc7143e0ea1f4fee260977aec18b (patch) | |
tree | a6aaee3c724f2263c5716d07fd5aeee75d76c6f5 /ld | |
parent | 00ee36855d9d2c2258f983e3ada347ed978a0552 (diff) | |
download | gdb-96c23d596607cc7143e0ea1f4fee260977aec18b.zip gdb-96c23d596607cc7143e0ea1f4fee260977aec18b.tar.gz gdb-96c23d596607cc7143e0ea1f4fee260977aec18b.tar.bz2 |
bfd:
* elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
MOVW and MOVT relocations in a shared library link.
ld/testsuite:
* ld-arm/movw-shared-1.d, ld-arm/movw-shared-1.s,
ld-arm/movw-shared-2.d, ld-arm/movw-shared-2.s,
ld-arm/movw-shared-3.d, ld-arm/movw-shared-3.s,
ld-arm/movw-shared-4.d, ld-arm/movw-shared-4.s: New tests.
* ld-arm/arm-elf.exp: Run these new tests.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/arm-elf.exp | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-1.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-1.s | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-2.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-2.s | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-3.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-3.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-4.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/movw-shared-4.s | 6 |
10 files changed, 50 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index dec4cbb..4542a24 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2009-04-30 Joseph Myers <joseph@codesourcery.com> + + * ld-arm/movw-shared-1.d, ld-arm/movw-shared-1.s, + ld-arm/movw-shared-2.d, ld-arm/movw-shared-2.s, + ld-arm/movw-shared-3.d, ld-arm/movw-shared-3.s, + ld-arm/movw-shared-4.d, ld-arm/movw-shared-4.s: New tests. + * ld-arm/arm-elf.exp: Run these new tests. + 2009-04-29 Chris Demetriou <cgd@google.com> * ld-elfvers/vers.exp (vers4b): New test to verify that diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index b524cce..04bbcf2 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -187,6 +187,10 @@ run_dump_test "group-relocs-ldc-bad" run_dump_test "thumb2-bl-undefweak" run_dump_test "thumb2-bl-undefweak1" run_dump_test "emit-relocs1" +run_dump_test "movw-shared-1" +run_dump_test "movw-shared-2" +run_dump_test "movw-shared-3" +run_dump_test "movw-shared-4" # Exclude non-ARM-EABI targets. diff --git a/ld/testsuite/ld-arm/movw-shared-1.d b/ld/testsuite/ld-arm/movw-shared-1.d new file mode 100644 index 0000000..5a05818 --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-1.d @@ -0,0 +1,4 @@ +#name: MOVW/MOVT shared libraries test 1 +#source: movw-shared-1.s +#ld: -shared +#error: .*: relocation R_ARM_MOVW_ABS_NC against `a' can not be used when making a shared object; recompile with -fPIC diff --git a/ld/testsuite/ld-arm/movw-shared-1.s b/ld/testsuite/ld-arm/movw-shared-1.s new file mode 100644 index 0000000..512946a --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-1.s @@ -0,0 +1,5 @@ +.arch armv7-a +.text +.syntax unified +f: +movw r0, #:lower16:a diff --git a/ld/testsuite/ld-arm/movw-shared-2.d b/ld/testsuite/ld-arm/movw-shared-2.d new file mode 100644 index 0000000..08ceaf0 --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-2.d @@ -0,0 +1,4 @@ +#name: MOVW/MOVT shared libraries test 2 +#source: movw-shared-2.s +#ld: -shared +#error: .*: relocation R_ARM_MOVT_ABS against `b' can not be used when making a shared object; recompile with -fPIC diff --git a/ld/testsuite/ld-arm/movw-shared-2.s b/ld/testsuite/ld-arm/movw-shared-2.s new file mode 100644 index 0000000..bd70b76 --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-2.s @@ -0,0 +1,5 @@ +.arch armv7-a +.text +.syntax unified +f: +movt r0, #:upper16:b diff --git a/ld/testsuite/ld-arm/movw-shared-3.d b/ld/testsuite/ld-arm/movw-shared-3.d new file mode 100644 index 0000000..90b9cf1 --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-3.d @@ -0,0 +1,4 @@ +#name: MOVW/MOVT shared libraries test 3 +#source: movw-shared-3.s +#ld: -shared +#error: .*: relocation R_ARM_THM_MOVW_ABS_NC against `c' can not be used when making a shared object; recompile with -fPIC diff --git a/ld/testsuite/ld-arm/movw-shared-3.s b/ld/testsuite/ld-arm/movw-shared-3.s new file mode 100644 index 0000000..a4db9a9 --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-3.s @@ -0,0 +1,6 @@ +.arch armv7-a +.text +.syntax unified +f: +.thumb +movw r0, #:lower16:c diff --git a/ld/testsuite/ld-arm/movw-shared-4.d b/ld/testsuite/ld-arm/movw-shared-4.d new file mode 100644 index 0000000..cc7a418 --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-4.d @@ -0,0 +1,4 @@ +#name: MOVW/MOVT shared libraries test 4 +#source: movw-shared-4.s +#ld: -shared +#error: .*: relocation R_ARM_THM_MOVT_ABS against `d' can not be used when making a shared object; recompile with -fPIC diff --git a/ld/testsuite/ld-arm/movw-shared-4.s b/ld/testsuite/ld-arm/movw-shared-4.s new file mode 100644 index 0000000..09f2952 --- /dev/null +++ b/ld/testsuite/ld-arm/movw-shared-4.s @@ -0,0 +1,6 @@ +.arch armv7-a +.text +.syntax unified +f: +.thumb +movt r0, #:upper16:d |