Skip to content

Commit

Permalink
* src/arch-s390.c (s390_prelink_conflict_rela): Fix handling of
Browse files Browse the repository at this point in the history
	R_390_IRELATIVE.
	* src/arch-s390x.c (s390x_prelink_conflict_rela): Likewise.


git-svn-id: http://sourceware.org/svn/prelink@207 94c539fb-cf18-0410-b60f-edeeb537fa16
  • Loading branch information
jakub committed Sep 30, 2013
1 parent 350536c commit 77003a3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
6 changes: 6 additions & 0 deletions trunk/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2013-09-30 Richard Sandiford <[email protected]>

* src/arch-s390.c (s390_prelink_conflict_rela): Fix handling of
R_390_IRELATIVE.
* src/arch-s390x.c (s390x_prelink_conflict_rela): Likewise.

2013-07-19 Marek Polacek <[email protected]>

* doc/prelink.8 (--usage): Document it.
Expand Down
10 changes: 6 additions & 4 deletions trunk/src/arch-s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,21 +300,21 @@ s390_prelink_conflict_rela (DSO *dso, struct prelink_info *info,
GElf_Rela *ret;

if (GELF_R_TYPE (rela->r_info) == R_390_RELATIVE
|| GELF_R_TYPE (rela->r_info) == R_390_NONE
|| info->dso == dso)
|| GELF_R_TYPE (rela->r_info) == R_390_NONE)
/* Fast path: nothing to do. */
return 0;
conflict = prelink_conflict (info, GELF_R_SYM (rela->r_info),
GELF_R_TYPE (rela->r_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_390_TLS_DTPMOD:
case R_390_TLS_TPOFF:
if (info->curtls == NULL || info->dso == dso)
return 0;
break;
/* IRELATIVE always need conflicts. */
case R_390_IRELATIVE:
break;
Expand All @@ -323,6 +323,8 @@ s390_prelink_conflict_rela (DSO *dso, struct prelink_info *info,
}
value = 0;
}
else if (info->dso == dso && !conflict->ifunc)
return 0;
else
{
/* DTPOFF wants to see only real conflicts, not lookups
Expand Down
13 changes: 7 additions & 6 deletions trunk/src/arch-s390x.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,21 +311,21 @@ s390x_prelink_conflict_rela (DSO *dso, struct prelink_info *info,
int r_type;

if (GELF_R_TYPE (rela->r_info) == R_390_RELATIVE
|| GELF_R_TYPE (rela->r_info) == R_390_NONE
|| info->dso == dso)
|| GELF_R_TYPE (rela->r_info) == R_390_NONE)
/* Fast path: nothing to do. */
return 0;
conflict = prelink_conflict (info, GELF_R_SYM (rela->r_info),
GELF_R_TYPE (rela->r_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_390_TLS_DTPMOD:
case R_390_TLS_TPOFF:
if (info->curtls == NULL || info->dso == dso)
return 0;
break;
/* IRELATIVE always need conflicts. */
case R_390_IRELATIVE:
break;
Expand All @@ -334,6 +334,8 @@ s390x_prelink_conflict_rela (DSO *dso, struct prelink_info *info,
}
value = 0;
}
else if (info->dso == dso && !conflict->ifunc)
return 0;
else
{
/* DTPOFF wants to see only real conflicts, not lookups
Expand All @@ -357,13 +359,12 @@ s390x_prelink_conflict_rela (DSO *dso, struct prelink_info *info,
value -= rela->r_offset;
case R_390_GLOB_DAT:
case R_390_JMP_SLOT:
r_type = R_390_64;
case R_390_64:
case R_390_IRELATIVE:
ret->r_addend = value;
if (conflict != NULL && conflict->ifunc)
r_type = R_390_IRELATIVE;
else
r_type = R_390_64;
break;
case R_390_PC32:
value -= rela->r_offset;
Expand Down

0 comments on commit 77003a3

Please sign in to comment.