Skip to content

Commit

Permalink
Fix ARM IFUNC support
Browse files Browse the repository at this point in the history
In the original ARM IFUNC support, it appears a small chunk of code in the
arm_prelink_conflict_rela function was missed.  This commit adds the missing
code from the original work.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1009601

2015-10-29  Mark Hatle <[email protected]>
	    Kyle McMartin  <[email protected]>
	    Jakub Jelinek  <[email protected]>
	    Julian Brown   <[email protected]>

	* 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

Signed-off-by: Mark Hatle <[email protected]>
  • Loading branch information
Mark Hatle committed Oct 30, 2015
1 parent 9f5c82e commit 927979b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2015-10-29 Mark Hatle <[email protected]>
Kyle McMartin <[email protected]>
Jakub Jelinek <[email protected]>
Julian Brown <[email protected]>

* 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 <[email protected]>
* prelink.h: Define SHT_MIPS_ABIFLAGS if not set
* prelink.c: OK to skip SHT_MIPS_ABIFLAGS
Expand Down
15 changes: 6 additions & 9 deletions src/arch-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testsuite/ifunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ asm (".text\n" \
"\t.align 4\n" \
"2:\t.long " fn "@GOTOFF\n" \
"3:\t.long _GLOBAL_OFFSET_TABLE_-1b\n"
elif defined __arm__
#elif defined __arm__
# ifdef __thumb__
# define PIPE_OFFSET "4"
# else
Expand Down

0 comments on commit 927979b

Please sign in to comment.