aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakub <jakub@94c539fb-cf18-0410-b60f-edeeb537fa16>2006-10-27 12:33:31 +0000
committerjakub <jakub@94c539fb-cf18-0410-b60f-edeeb537fa16>2006-10-27 12:33:31 +0000
commit5247c2c00d95d1bacd3e5865593712ccc84784fd (patch)
tree8c3b500572f5897346debabb8c88da6f3e64f447
parentd341c252dd7570396a6c147ef2b557bfe99bc24e (diff)
downloadprelink-cross-5247c2c00d95d1bacd3e5865593712ccc84784fd.tar.gz
prelink-cross-5247c2c00d95d1bacd3e5865593712ccc84784fd.tar.bz2
prelink-cross-5247c2c00d95d1bacd3e5865593712ccc84784fd.zip
* src/prelink.h (PLArch): Make the arch_prelink callback take
a "struct prelink_info *" argument, not a "DSO *" argument. * src/prelink.c (prelink): Adjust call accordingly. * src/arch-alpha.c (alpha_arch_prelink): Adjust definition accordingly. * src/arch-arm.c (arm_arch_prelink): Likewise. * src/arch-cris.c (cris_arch_prelink): Likewise. * src/arch-i386.c (i386_arch_prelink): Likewise. * src/arch-ia64.c (ia64_arch_prelink): Likewise. * src/arch-ppc.c (ppc_arch_prelink): Likewise. * src/arch-s390.c (s390_arch_prelink): Likewise * src/arch-s390x.c (s390x_arch_prelink): Likewise * src/arch-sh.c (sh_arch_prelink): Likewise. * src/arch-sparc64.c (sparc64_arch_prelink): Likewise. * src/arch-sparc.c (sparc_arch_prelink): Likewise * src/arch-x86_64.c (x86_64_arch_prelink): Likewise. git-svn-id: http://sourceware.org/svn/prelink@140 94c539fb-cf18-0410-b60f-edeeb537fa16
-rw-r--r--trunk/ChangeLog16
-rw-r--r--trunk/src/arch-alpha.c5
-rw-r--r--trunk/src/arch-arm.c4
-rw-r--r--trunk/src/arch-cris.c4
-rw-r--r--trunk/src/arch-i386.c4
-rw-r--r--trunk/src/arch-ia64.c4
-rw-r--r--trunk/src/arch-ppc.c3
-rw-r--r--trunk/src/arch-s390.c4
-rw-r--r--trunk/src/arch-s390x.c4
-rw-r--r--trunk/src/arch-sh.c4
-rw-r--r--trunk/src/arch-sparc.c2
-rw-r--r--trunk/src/arch-sparc64.c2
-rw-r--r--trunk/src/arch-x86_64.c4
-rw-r--r--trunk/src/prelink.c2
-rw-r--r--trunk/src/prelink.h2
15 files changed, 50 insertions, 14 deletions
diff --git a/trunk/ChangeLog b/trunk/ChangeLog
index 3f70894..7b78dd2 100644
--- a/trunk/ChangeLog
+++ b/trunk/ChangeLog
@@ -1,5 +1,21 @@
2006-10-24 Richard Sandiford <richard@codesourcery.com>
+ * src/prelink.h (PLArch): Make the arch_prelink callback take
+ a "struct prelink_info *" argument, not a "DSO *" argument.
+ * src/prelink.c (prelink): Adjust call accordingly.
+ * src/arch-alpha.c (alpha_arch_prelink): Adjust definition accordingly.
+ * src/arch-arm.c (arm_arch_prelink): Likewise.
+ * src/arch-cris.c (cris_arch_prelink): Likewise.
+ * src/arch-i386.c (i386_arch_prelink): Likewise.
+ * src/arch-ia64.c (ia64_arch_prelink): Likewise.
+ * src/arch-ppc.c (ppc_arch_prelink): Likewise.
+ * src/arch-s390.c (s390_arch_prelink): Likewise
+ * src/arch-s390x.c (s390x_arch_prelink): Likewise
+ * src/arch-sh.c (sh_arch_prelink): Likewise.
+ * src/arch-sparc64.c (sparc64_arch_prelink): Likewise.
+ * src/arch-sparc.c (sparc_arch_prelink): Likewise
+ * src/arch-x86_64.c (x86_64_arch_prelink): Likewise.
+
* src/prelink.h (PLArch): Add an arch_adjust callback.
* src/dso.c (adjust_dso): Use it, if defined.
diff --git a/trunk/src/arch-alpha.c b/trunk/src/arch-alpha.c
index 4b74aaa..51182ed 100644
--- a/trunk/src/arch-alpha.c
+++ b/trunk/src/arch-alpha.c
@@ -367,9 +367,12 @@ alpha_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-alpha_arch_prelink (DSO *dso)
+alpha_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
+
/* Correct sh_entsize on .plt sections. */
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
int sec = addr_to_sec (dso, dso->info[DT_PLTGOT] + 16);
diff --git a/trunk/src/arch-arm.c b/trunk/src/arch-arm.c
index 09d0f68..6641e86 100644
--- a/trunk/src/arch-arm.c
+++ b/trunk/src/arch-arm.c
@@ -495,10 +495,12 @@ arm_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-arm_arch_prelink (DSO *dso)
+arm_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int i;
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
/* Write address of .plt into got[1].
diff --git a/trunk/src/arch-cris.c b/trunk/src/arch-cris.c
index dd45ff9..6b56016 100644
--- a/trunk/src/arch-cris.c
+++ b/trunk/src/arch-cris.c
@@ -309,10 +309,12 @@ cris_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-cris_arch_prelink (DSO *dso)
+cris_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int i;
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
/* Write address of .plt + 28 into got[1].
diff --git a/trunk/src/arch-i386.c b/trunk/src/arch-i386.c
index 3302211..d5211b2 100644
--- a/trunk/src/arch-i386.c
+++ b/trunk/src/arch-i386.c
@@ -599,10 +599,12 @@ i386_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-i386_arch_prelink (DSO *dso)
+i386_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int i;
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
/* Write address of .plt + 0x16 into got[1].
diff --git a/trunk/src/arch-ia64.c b/trunk/src/arch-ia64.c
index 958bf7c..0be672c 100644
--- a/trunk/src/arch-ia64.c
+++ b/trunk/src/arch-ia64.c
@@ -418,14 +418,16 @@ ia64_create_opd (struct prelink_info *info, int first, int last, int plt)
}
static int
-ia64_arch_prelink (DSO *dso)
+ia64_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int plt = -1, got = -1, i;
const char *name;
/* Write address of .plt + 0x30 into .got[1].
.plt + 0x30 is what .IA_64.pltoff[0] contains unless prelinking. */
+ dso = info->dso;
for (i = 1; i < dso->ehdr.e_shnum; i++)
if (dso->shdr[i].sh_type == SHT_PROGBITS)
{
diff --git a/trunk/src/arch-ppc.c b/trunk/src/arch-ppc.c
index 4799755..5608750 100644
--- a/trunk/src/arch-ppc.c
+++ b/trunk/src/arch-ppc.c
@@ -668,8 +668,9 @@ ppc_arch_pre_prelink (DSO *dso)
}
static int
-ppc_arch_prelink (DSO *dso)
+ppc_arch_prelink (struct prelink_info *info)
{
+ DSO *dso = info->dso;
Elf32_Addr plt = dso->info[DT_PLTGOT];
if (plt && !dynamic_info_is_set (dso, DT_PPC_GOT_BIT))
diff --git a/trunk/src/arch-s390.c b/trunk/src/arch-s390.c
index 989b05f..4be0dcb 100644
--- a/trunk/src/arch-s390.c
+++ b/trunk/src/arch-s390.c
@@ -337,10 +337,12 @@ s390_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-s390_arch_prelink (DSO *dso)
+s390_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int i;
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
/* Write address of .plt + 0x2c into got[1].
diff --git a/trunk/src/arch-s390x.c b/trunk/src/arch-s390x.c
index 8942524..1e381c7 100644
--- a/trunk/src/arch-s390x.c
+++ b/trunk/src/arch-s390x.c
@@ -418,10 +418,12 @@ s390x_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-s390x_arch_prelink (DSO *dso)
+s390x_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int i;
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
/* Write address of .plt + 0x2e into got[1].
diff --git a/trunk/src/arch-sh.c b/trunk/src/arch-sh.c
index 8701733..b448612 100644
--- a/trunk/src/arch-sh.c
+++ b/trunk/src/arch-sh.c
@@ -300,10 +300,12 @@ sh_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-sh_arch_prelink (DSO *dso)
+sh_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int i;
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
/* Write address of .plt + 36 into got[1].
diff --git a/trunk/src/arch-sparc.c b/trunk/src/arch-sparc.c
index cdb6bc4..98bacac 100644
--- a/trunk/src/arch-sparc.c
+++ b/trunk/src/arch-sparc.c
@@ -471,7 +471,7 @@ sparc_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-sparc_arch_prelink (DSO *dso)
+sparc_arch_prelink (struct prelink_info *info)
{
return 0;
}
diff --git a/trunk/src/arch-sparc64.c b/trunk/src/arch-sparc64.c
index 088e5b0..e673e99 100644
--- a/trunk/src/arch-sparc64.c
+++ b/trunk/src/arch-sparc64.c
@@ -524,7 +524,7 @@ sparc64_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-sparc64_arch_prelink (DSO *dso)
+sparc64_arch_prelink (struct prelink_info *info)
{
return 0;
}
diff --git a/trunk/src/arch-x86_64.c b/trunk/src/arch-x86_64.c
index 0db1a23..8079f1a 100644
--- a/trunk/src/arch-x86_64.c
+++ b/trunk/src/arch-x86_64.c
@@ -350,10 +350,12 @@ x86_64_need_rel_to_rela (DSO *dso, int first, int last)
}
static int
-x86_64_arch_prelink (DSO *dso)
+x86_64_arch_prelink (struct prelink_info *info)
{
+ DSO *dso;
int i;
+ dso = info->dso;
if (dso->info[DT_PLTGOT])
{
/* Write address of .plt + 0x16 into got[1].
diff --git a/trunk/src/prelink.c b/trunk/src/prelink.c
index a828440..b818b62 100644
--- a/trunk/src/prelink.c
+++ b/trunk/src/prelink.c
@@ -941,7 +941,7 @@ prelink (DSO *dso, struct prelink_entry *ent)
}
}
- if (dso->arch->arch_prelink && dso->arch->arch_prelink (dso))
+ if (dso->arch->arch_prelink && dso->arch->arch_prelink (&info))
goto error_out;
if (dso->arch->read_opd && dso->arch->read_opd (dso, ent))
diff --git a/trunk/src/prelink.h b/trunk/src/prelink.h
index 03128dc..9e8fa4c 100644
--- a/trunk/src/prelink.h
+++ b/trunk/src/prelink.h
@@ -156,7 +156,7 @@ struct PLArch
#define RTYPE_CLASS_TLS (8|4)
int (*reloc_class) (int);
int (*arch_pre_prelink) (DSO *dso);
- int (*arch_prelink) (DSO *dso);
+ int (*arch_prelink) (struct prelink_info *info);
int (*arch_undo_prelink) (DSO *dso);
int (*undo_prelink_rel) (DSO *dso, GElf_Rel *rel, GElf_Addr reladdr);
int (*undo_prelink_rela) (DSO *dso, GElf_Rela *rela, GElf_Addr relaaddr);