aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2015-01-14 19:11:54 +0000
committerJiong Wang <jiong.wang@arm.com>2015-01-14 19:11:54 +0000
commit52db4ec2d13f511ef3dfe5b9a159869da6e4c3eb (patch)
treecbef8491a91ce1b7751e669435ffe0269066b565 /bfd/elf32-arm.c
parent3d0064a95d413e7d19ff9c7f6db53fefe44a697b (diff)
downloadgdb-52db4ec2d13f511ef3dfe5b9a159869da6e4c3eb.zip
gdb-52db4ec2d13f511ef3dfe5b9a159869da6e4c3eb.tar.gz
gdb-52db4ec2d13f511ef3dfe5b9a159869da6e4c3eb.tar.bz2
[ARM] Reject R_ARM_REL32 when trying to defer it to runtime
bfd/ * elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when trying to defer them to runtime. ld/testsuite/ * ld-arm/elf32-reject.s: New testcase. * ld-arm/elf32-reject.d: Likewise. * ld-arm/elf32-reject-pie.s: Likewise. * ld-arm/elf32-reject-pie.d: Likewise. * ld-arm/arm-elf.exp: Run new testcases. * ld-arm/ifunc-7.s: Delete f2/f4 test items. * ld-arm/ifunc-7.rd: Likewise. * ld-arm/ifunc-7.gd: Likewise. * ld-arm/ifunc-7.dd: Likewise. * ld-arm/ifunc-8.s: Likewise. * ld-arm/ifunc-8.rd: Likewise. * ld-arm/ifunc-8.gd: Likewise. * ld-arm/ifunc-8.dd: Likewise.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 75ea1d4..d36a7a5 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -8416,6 +8416,21 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
Elf_Internal_Rela outrel;
bfd_boolean skip, relocate;
+ if ((r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI)
+ && !h->def_regular)
+ {
+ char *v = _("shared object");
+
+ if (info->executable)
+ v = _("PIE executable");
+
+ (*_bfd_error_handler)
+ (_("%B: relocation %s against external or undefined symbol `%s'"
+ " can not be used when making a %s; recompile with -fPIC"), input_bfd,
+ elf32_arm_howto_table_1[r_type].name, h->root.root.string, v);
+ return bfd_reloc_notsupported;
+ }
+
*unresolved_reloc_p = FALSE;
if (sreloc == NULL && globals->root.dynamic_sections_created)