diff options
author | Jiong Wang <jiong.wang@arm.com> | 2015-01-14 19:11:54 +0000 |
---|---|---|
committer | Jiong Wang <jiong.wang@arm.com> | 2015-01-14 19:11:54 +0000 |
commit | 52db4ec2d13f511ef3dfe5b9a159869da6e4c3eb (patch) | |
tree | cbef8491a91ce1b7751e669435ffe0269066b565 /bfd | |
parent | 3d0064a95d413e7d19ff9c7f6db53fefe44a697b (diff) | |
download | gdb-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')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c6aa966..0e83f2e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2015-01-14 Jiong Wang <jiong.wang@arm.com> + + * elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when + trying to defer them to runtime. + 2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com> * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND 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) |