+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.
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;
+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
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.
--- /dev/null
+#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
--- /dev/null
+.arch armv7-a
+.text
+.syntax unified
+f:
+movw r0, #:lower16:a
--- /dev/null
+#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
--- /dev/null
+.arch armv7-a
+.text
+.syntax unified
+f:
+movt r0, #:upper16:b
--- /dev/null
+#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
--- /dev/null
+.arch armv7-a
+.text
+.syntax unified
+f:
+.thumb
+movw r0, #:lower16:c
--- /dev/null
+#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
--- /dev/null
+.arch armv7-a
+.text
+.syntax unified
+f:
+.thumb
+movt r0, #:upper16:d