summaryrefslogtreecommitdiffstats
path: root/contrib/binutils
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2015-12-30 23:04:08 +0000
committerian <ian@FreeBSD.org>2015-12-30 23:04:08 +0000
commit71b93c43ba5b4d196705cdfe8061b86047cc9bf9 (patch)
tree6bf54a01c8167efcf9cfca4691f5d8695cca1df7 /contrib/binutils
parent2502999acda612f4678ed5461267695dd4647fb8 (diff)
downloadFreeBSD-src-71b93c43ba5b4d196705cdfe8061b86047cc9bf9.zip
FreeBSD-src-71b93c43ba5b4d196705cdfe8061b86047cc9bf9.tar.gz
Add the MOVT/MOVW types to the list of relocs which do not generate .plt
entries. This fixes the segfaults in arm userland code compiled with -march= or -mcpu= values that allow the compiler to generate movw/movt sequences to load 32-bit constants.
Diffstat (limited to 'contrib/binutils')
-rw-r--r--contrib/binutils/bfd/elf32-arm.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/contrib/binutils/bfd/elf32-arm.c b/contrib/binutils/bfd/elf32-arm.c
index 753cdcc..e20ccca 100644
--- a/contrib/binutils/bfd/elf32-arm.c
+++ b/contrib/binutils/bfd/elf32-arm.c
@@ -7720,12 +7720,26 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
refers to is in a different object. We can't tell for
sure yet, because something later might force the
symbol local. */
- if (r_type != R_ARM_ABS32
- && r_type != R_ARM_REL32
- && r_type != R_ARM_ABS32_NOI
- && r_type != R_ARM_REL32_NOI
- && r_type != R_ARM_ABS12)
- h->needs_plt = 1;
+ switch (r_type)
+ {
+ case R_ARM_ABS12:
+ 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:
+ break;
+ default:
+ h->needs_plt = 1;
+ break;
+ }
/* If we create a PLT entry, this relocation will reference
it, even if it's an ABS32 relocation. */
OpenPOWER on IntegriCloud