aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-12-21 12:55:34 -0600
committerMark Hatle <mark.hatle@windriver.com>2011-12-21 13:01:38 -0600
commit948e632f0957b8456b02a393772c9d1c904a2505 (patch)
treea31fc6bf7a8940ee7e22e17186c48e4b029efcf1
parent9552f214c7faa816fdb55b289a457f0cab034f00 (diff)
downloadprelink-cross-948e632f0957b8456b02a393772c9d1c904a2505.tar.gz
prelink-cross-948e632f0957b8456b02a393772c9d1c904a2505.tar.bz2
prelink-cross-948e632f0957b8456b02a393772c9d1c904a2505.zip
Implement PL_ARCH(arch)
In order to allow for multiple (related) architectures to be defined in the same file, we allow an arch setting for each PL_ARCH string. The code is based on work originally done by Code Sourcery, LLC. (Now part of Mentor Graphics.) Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-rw-r--r--trunk/ChangeLog19
-rw-r--r--trunk/src/arch-alpha.c2
-rw-r--r--trunk/src/arch-arm.c2
-rw-r--r--trunk/src/arch-cris.c2
-rw-r--r--trunk/src/arch-i386.c2
-rw-r--r--trunk/src/arch-ia64.c2
-rw-r--r--trunk/src/arch-mips.c2
-rw-r--r--trunk/src/arch-ppc.c2
-rw-r--r--trunk/src/arch-ppc64.c2
-rw-r--r--trunk/src/arch-s390.c2
-rw-r--r--trunk/src/arch-s390x.c2
-rw-r--r--trunk/src/arch-sh.c2
-rw-r--r--trunk/src/arch-sparc.c2
-rw-r--r--trunk/src/arch-sparc64.c2
-rw-r--r--trunk/src/arch-x86_64.c2
-rw-r--r--trunk/src/prelink.h4
16 files changed, 35 insertions, 16 deletions
diff --git a/trunk/ChangeLog b/trunk/ChangeLog
index 2ab86ce..ce51553 100644
--- a/trunk/ChangeLog
+++ b/trunk/ChangeLog
@@ -1,3 +1,22 @@
+2011-12-21 Mark Hatle <mark@hatle.net>
+ * Following code is based on work originally by
+ Code Sourcery, LLC. (Now part of Mentor Graphics)
+ * prelink.h: Change definition of PL_ARCH
+ * src/arch-alpha.c: Rename PL_ARCH to PL_ARCH(alpha)
+ * src/arch-arm.c: Likewise
+ * src/arch-cris.c: Likewise
+ * src/arch-i386.c: Likewise
+ * src/arch-ia64.c: Likewise
+ * src/arch-mips.c: Likewise
+ * src/arch-ppc.c: Likewise
+ * src/arch-ppc64.c: Likewise
+ * src/arch-s390.c: Likewise
+ * src/arch-s390x.c: Likewise
+ * src/arch-sh.c: Likewise
+ * src/arch-sparc.c: Likewise
+ * src/arch-sparc64.c: Likewise
+ * src/arch-x86_64.c: Likewise
+
2011-10-12 Jakub Jelinek <jakub@redhat.com>
* src/main.c (layout_page_size): New variable.
diff --git a/trunk/src/arch-alpha.c b/trunk/src/arch-alpha.c
index b326b0b..7802a3e 100644
--- a/trunk/src/arch-alpha.c
+++ b/trunk/src/arch-alpha.c
@@ -466,7 +466,7 @@ alpha_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(alpha) = {
.name = "Alpha",
.class = ELFCLASS64,
.machine = EM_ALPHA,
diff --git a/trunk/src/arch-arm.c b/trunk/src/arch-arm.c
index 30a8259..17c7507 100644
--- a/trunk/src/arch-arm.c
+++ b/trunk/src/arch-arm.c
@@ -823,7 +823,7 @@ arm_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(arm) = {
.name = "ARM",
.class = ELFCLASS32,
.machine = EM_ARM,
diff --git a/trunk/src/arch-cris.c b/trunk/src/arch-cris.c
index d70260a..3272779 100644
--- a/trunk/src/arch-cris.c
+++ b/trunk/src/arch-cris.c
@@ -374,7 +374,7 @@ cris_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(cris) = {
.name = "CRIS",
.class = ELFCLASS32,
.machine = EM_CRIS,
diff --git a/trunk/src/arch-i386.c b/trunk/src/arch-i386.c
index aae68f9..a1e0fcc 100644
--- a/trunk/src/arch-i386.c
+++ b/trunk/src/arch-i386.c
@@ -1089,7 +1089,7 @@ i386_layout_libs_post (struct layout_libs *l)
return 0;
}
-PL_ARCH = {
+PL_ARCH(i386) = {
.name = "i386",
.class = ELFCLASS32,
.machine = EM_386,
diff --git a/trunk/src/arch-ia64.c b/trunk/src/arch-ia64.c
index 2573d69..6039115 100644
--- a/trunk/src/arch-ia64.c
+++ b/trunk/src/arch-ia64.c
@@ -492,7 +492,7 @@ ia64_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(ia64) = {
.name = "IA-64",
.class = ELFCLASS64,
.machine = EM_IA_64,
diff --git a/trunk/src/arch-mips.c b/trunk/src/arch-mips.c
index 3e39f03..0c6fddc 100644
--- a/trunk/src/arch-mips.c
+++ b/trunk/src/arch-mips.c
@@ -995,7 +995,7 @@ mips_undo_prelink_rel (DSO *dso, GElf_Rel *rel, GElf_Addr reladdr)
return 0;
}
-PL_ARCH = {
+PL_ARCH(mips) = {
.name = "MIPS",
.class = ELFCLASS32,
.machine = EM_MIPS,
diff --git a/trunk/src/arch-ppc.c b/trunk/src/arch-ppc.c
index cb0c5f8..e22e5d5 100644
--- a/trunk/src/arch-ppc.c
+++ b/trunk/src/arch-ppc.c
@@ -1150,7 +1150,7 @@ ppc_layout_libs_post (struct layout_libs *l)
return 0;
}
-PL_ARCH = {
+PL_ARCH(ppc) = {
.name = "PowerPC",
.class = ELFCLASS32,
.machine = EM_PPC,
diff --git a/trunk/src/arch-ppc64.c b/trunk/src/arch-ppc64.c
index 351fab1..a764b99 100644
--- a/trunk/src/arch-ppc64.c
+++ b/trunk/src/arch-ppc64.c
@@ -859,7 +859,7 @@ ppc64_free_opd (struct prelink_entry *ent)
return 0;
}
-PL_ARCH = {
+PL_ARCH(ppc64) = {
.name = "PowerPC",
.class = ELFCLASS64,
.machine = EM_PPC64,
diff --git a/trunk/src/arch-s390.c b/trunk/src/arch-s390.c
index 829392e..fd076b1 100644
--- a/trunk/src/arch-s390.c
+++ b/trunk/src/arch-s390.c
@@ -567,7 +567,7 @@ s390_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(s390) = {
.name = "S390",
.class = ELFCLASS32,
.machine = EM_S390,
diff --git a/trunk/src/arch-s390x.c b/trunk/src/arch-s390x.c
index a0321ef..8676fff 100644
--- a/trunk/src/arch-s390x.c
+++ b/trunk/src/arch-s390x.c
@@ -597,7 +597,7 @@ s390x_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(s390x) = {
.name = "S390",
.class = ELFCLASS64,
.machine = EM_S390,
diff --git a/trunk/src/arch-sh.c b/trunk/src/arch-sh.c
index 095ed58..f5b0636 100644
--- a/trunk/src/arch-sh.c
+++ b/trunk/src/arch-sh.c
@@ -413,7 +413,7 @@ sh_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(sh) = {
.name = "SuperH",
.class = ELFCLASS32,
.machine = EM_SH,
diff --git a/trunk/src/arch-sparc.c b/trunk/src/arch-sparc.c
index 7a3c8db..e016a79 100644
--- a/trunk/src/arch-sparc.c
+++ b/trunk/src/arch-sparc.c
@@ -606,7 +606,7 @@ sparc_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(sparc) = {
.name = "SPARC",
.class = ELFCLASS32,
.machine = EM_SPARC,
diff --git a/trunk/src/arch-sparc64.c b/trunk/src/arch-sparc64.c
index 63e107f..aee4601 100644
--- a/trunk/src/arch-sparc64.c
+++ b/trunk/src/arch-sparc64.c
@@ -806,7 +806,7 @@ sparc64_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(sparc64) = {
.name = "SPARC",
.class = ELFCLASS64,
.machine = EM_SPARCV9,
diff --git a/trunk/src/arch-x86_64.c b/trunk/src/arch-x86_64.c
index 3c760ed..3830f84 100644
--- a/trunk/src/arch-x86_64.c
+++ b/trunk/src/arch-x86_64.c
@@ -523,7 +523,7 @@ x86_64_reloc_class (int reloc_type)
}
}
-PL_ARCH = {
+PL_ARCH(x86_64) = {
.name = "x86-64",
.class = ELFCLASS64,
.machine = EM_X86_64,
diff --git a/trunk/src/prelink.h b/trunk/src/prelink.h
index c223d4b..eceb2b6 100644
--- a/trunk/src/prelink.h
+++ b/trunk/src/prelink.h
@@ -312,8 +312,8 @@ unsigned char *get_data_from_iterator (struct data_iterator *it,
GElf_Addr size);
int get_sym_from_iterator (struct data_iterator *it, GElf_Sym *sym);
-#define PL_ARCH \
-static struct PLArch plarch __attribute__((section("pl_arch"),used))
+#define PL_ARCH(F) \
+static struct PLArch plarch_##F __attribute__((section("pl_arch"),used))
#define addr_adjust(addr, start, adjust) \
do { \