aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--src/arch-arm.c15
-rw-r--r--testsuite/ifunc.h19
3 files changed, 36 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index cfd6375..9b3d86c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,15 @@
2015-10-29 Mark Hatle <mark.hatle@windriver.com>
+ Kyle McMartin <kmcmartin@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+ Julian Brown <julian@codesourcery.com>
+
+ * testsuite/ifunc.h: Fix missing #
+ * src/arch-arm.c (arm_prelink_conflict_rela): Add missing hunk
+ that implemented R_ARM_IRELATIVE, and ifunc conflicts.
+
+ See: https://bugzilla.redhat.com/show_bug.cgi?id=1009601
+
+2015-10-29 Mark Hatle <mark.hatle@windriver.com>
* prelink.h: Define SHT_MIPS_ABIFLAGS if not set
* prelink.c: OK to skip SHT_MIPS_ABIFLAGS
optimize the loop to stop on the first bad entry
diff --git a/src/arch-arm.c b/src/arch-arm.c
index c8febcd..eec7c57 100644
--- a/src/arch-arm.c
+++ b/src/arch-arm.c
@@ -536,15 +536,16 @@ arm_prelink_conflict_rela (DSO *dso, struct prelink_info *info,
if (conflict == NULL)
{
- if (info->curtls == NULL)
- return 0;
-
switch (GELF_R_TYPE (rela->r_info))
{
/* Even local DTPMOD and TPOFF relocs need conflicts. */
case R_ARM_TLS_DTPMOD32:
case R_ARM_TLS_TPOFF32:
+ if (info->curtls == NULL || info->dso == dso)
+ return 0;
break;
+ /* Similarly IRELATIVE relocations always need conflicts. */
+ case R_ARM_IRELATIVE:
/* Likewise TLS_DESC. */
case R_ARM_TLS_DESC:
break;
@@ -553,12 +554,8 @@ arm_prelink_conflict_rela (DSO *dso, struct prelink_info *info,
}
value = 0;
}
- else if (conflict->ifunc)
- {
- error (0, 0, "%s: STT_GNU_IFUNC not handled on ARM yet",
- dso->filename);
- return 1;
- }
+ else if (info->dso == dso && !conflict->ifunc)
+ return 0;
else
{
/* DTPOFF32 wants to see only real conflicts, not lookups
diff --git a/testsuite/ifunc.h b/testsuite/ifunc.h
index 44aaba3..78ad86b 100644
--- a/testsuite/ifunc.h
+++ b/testsuite/ifunc.h
@@ -51,6 +51,25 @@ asm (".text\n" \
"\t.align 4\n" \
"2:\t.long " fn "@GOTOFF\n" \
"3:\t.long _GLOBAL_OFFSET_TABLE_-1b\n"
+#elif defined __arm__
+# ifdef __thumb__
+# define PIPE_OFFSET "4"
+# else
+# define PIPE_OFFSET "8"
+# endif
+# define IFUNC_ASM(fn) \
+ "\tldr r0, .L" fn "\n" \
+ "1:\tadd r0, pc, r0\n" \
+ "\tmov pc, lr\n" \
+ ".L" fn ": .long " fn " - 1b - " PIPE_OFFSET "\n"
+# define IFUNC_DECL(name, hidden, fn1, fn2) \
+asm (".text\n" \
+ "\t.globl " #name "\n" \
+ "\t" hidden " " #name "\n" \
+ "\t.type " #name ", %gnu_indirect_function\n" \
+ #name ":\n" \
+ IFUNC_ASM (PICK (fn1, fn2)) \
+ "\t.size " #name ", .-" #name "\n")
#else
# error Architecture not supported
#endif