aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-04-30 00:01:11 +0000
committerJoseph Myers <joseph@codesourcery.com>2009-04-30 00:01:11 +0000
commit96c23d596607cc7143e0ea1f4fee260977aec18b (patch)
treea6aaee3c724f2263c5716d07fd5aeee75d76c6f5 /bfd
parent00ee36855d9d2c2258f983e3ada347ed978a0552 (diff)
downloadgdb-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 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arm.c19
2 files changed, 20 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 51f059b..25c21ef 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-30 Joseph Myers <joseph@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
+ MOVW and MOVT relocations in a shared library link.
+
2009-04-27 Anthony Green <green@moxielogic.com>
* verilog.c: New file.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index d94744a..831f458 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9808,16 +9808,27 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
needs_plt = 1;
goto normal_reloc;
+ case R_ARM_MOVW_ABS_NC:
+ case R_ARM_MOVT_ABS:
+ case R_ARM_THM_MOVW_ABS_NC:
+ case R_ARM_THM_MOVT_ABS:
+ if (info->shared)
+ {
+ (*_bfd_error_handler)
+ (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
+ abfd, elf32_arm_howto_table_1[r_type].name,
+ (h) ? h->root.root.string : "a local symbol");
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ /* Fall through. */
case R_ARM_ABS32:
case R_ARM_ABS32_NOI:
case R_ARM_REL32:
case R_ARM_REL32_NOI:
- case R_ARM_MOVW_ABS_NC:
- case R_ARM_MOVT_ABS:
case R_ARM_MOVW_PREL_NC:
case R_ARM_MOVT_PREL:
- case R_ARM_THM_MOVW_ABS_NC:
- case R_ARM_THM_MOVT_ABS:
case R_ARM_THM_MOVW_PREL_NC:
case R_ARM_THM_MOVT_PREL:
needs_plt = 0;