summaryrefslogtreecommitdiff
path: root/libebl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-08-07 08:12:22 +0000
committerUlrich Drepper <drepper@redhat.com>2005-08-07 08:12:22 +0000
commitb03b05785914250d53d31e966373617f6104bd9d (patch)
tree2da0e3cec4bb107100824cee10cce599596f5db2 /libebl
parentb944695be7719b6f98c762fe7847245efb3d609b (diff)
downloadelfutils-b03b05785914250d53d31e966373617f6104bd9d.tar.gz
Add support for a few missing DT_ and R_* values.
Import new elf.h.
Diffstat (limited to 'libebl')
-rw-r--r--libebl/ChangeLog12
-rw-r--r--libebl/alpha_init.c2
-rw-r--r--libebl/alpha_symbol.c23
-rw-r--r--libebl/libebl_alpha.h6
-rw-r--r--libebl/libebl_ppc.h6
-rw-r--r--libebl/libebl_ppc64.h3
-rw-r--r--libebl/ppc64_init.c1
-rw-r--r--libebl/ppc64_symbol.c9
-rw-r--r--libebl/ppc_init.c2
-rw-r--r--libebl/ppc_symbol.c35
10 files changed, 96 insertions, 3 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 8c4473fd..5553cc49 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,15 @@
+2005-08-07 Ulrich Drepper <drepper@redhat.com>
+
+ * ppc_init.c: Add support for new DT_PPC_* and R_PPC_* values.
+ * ppc_symbol.c: Likewise.
+ * libebl_ppc.h: Likewise.
+ * ppc64_init.c: There is now also a dynamic_tag_check functions
+ * ppc64_symbol.c: Add dynamic_tag_check.
+ * libebl_ppc64.h: Add prototype.
+ * alpha_init.c: Add support for new DT_ALPHA_* value.
+ * alpha_symbol.c: Likewise.
+ * libebl_alpha.h: Likewise.
+
2005-08-03 Ulrich Drepper <drepper@redhat.com>
* libebl_alpha.map: Remove unnecessary exports.
diff --git a/libebl/alpha_init.c b/libebl/alpha_init.c
index 17eff373..327f3bd0 100644
--- a/libebl/alpha_init.c
+++ b/libebl/alpha_init.c
@@ -34,6 +34,8 @@ alpha_init (elf, machine, eh, ehlen)
eh->name = "Alpha";
eh->reloc_type_name = alpha_reloc_type_name;
eh->reloc_type_check = alpha_reloc_type_check;
+ eh->dynamic_tag_name = alpha_dynamic_tag_name;
+ eh->dynamic_tag_check = alpha_dynamic_tag_check;
eh->copy_reloc_p = alpha_copy_reloc_p;
eh->destr = alpha_destr;
diff --git a/libebl/alpha_symbol.c b/libebl/alpha_symbol.c
index 49e7c72f..3fcd1846 100644
--- a/libebl/alpha_symbol.c
+++ b/libebl/alpha_symbol.c
@@ -93,6 +93,29 @@ alpha_reloc_type_check (int type)
&& reloc_map_table[type] != NULL) ? true : false;
}
+
+const char *
+alpha_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
+{
+ switch (tag)
+ {
+ case DT_ALPHA_PLTRO:
+ return "ALPHA_PLTRO";
+ default:
+ break;
+ }
+ return NULL;
+}
+
+
+bool
+alpha_dynamic_tag_check (int64_t tag)
+{
+ return tag == DT_ALPHA_PLTRO;
+}
+
+
/* Check whether given relocation is a copy relocation. */
bool
alpha_copy_reloc_p (int reloc)
diff --git a/libebl/libebl_alpha.h b/libebl/libebl_alpha.h
index 7990d995..24a3500e 100644
--- a/libebl/libebl_alpha.h
+++ b/libebl/libebl_alpha.h
@@ -31,6 +31,12 @@ extern const char *alpha_reloc_type_name (int type, char *buf, size_t len);
/* Check relocation type. */
extern bool alpha_reloc_type_check (int type);
+/* Name of dynamic tag. */
+extern const char *alpha_dynamic_tag_name (int64_t tag, char *buf, size_t len);
+
+/* Check dynamic tag. */
+extern bool alpha_dynamic_tag_check (int64_t tag);
+
/* Check whether given relocation is a copy relocation. */
extern bool alpha_copy_reloc_p (int reloc);
diff --git a/libebl/libebl_ppc.h b/libebl/libebl_ppc.h
index 1e646d4f..e3c6d21c 100644
--- a/libebl/libebl_ppc.h
+++ b/libebl/libebl_ppc.h
@@ -41,6 +41,12 @@ extern Elf_Type ppc_reloc_simple_type (Elf *elf, int type);
extern bool ppc_core_note (const char *name, uint32_t type, uint32_t descsz,
const char *desc);
+/* Name of dynamic tag. */
+extern const char *ppc_dynamic_tag_name (int64_t tag, char *buf, size_t len);
+
+/* Check dynamic tag. */
+extern bool ppc_dynamic_tag_check (int64_t tag);
+
/* Check whether given relocation is a copy relocation. */
extern bool ppc_copy_reloc_p (int reloc);
diff --git a/libebl/libebl_ppc64.h b/libebl/libebl_ppc64.h
index e737c56a..148e2249 100644
--- a/libebl/libebl_ppc64.h
+++ b/libebl/libebl_ppc64.h
@@ -44,6 +44,9 @@ extern bool ppc64_core_note (const char *name, uint32_t type, uint32_t descsz,
/* Name of dynamic tag. */
extern const char *ppc64_dynamic_tag_name (int64_t tag, char *buf, size_t len);
+/* Check dynamic tag. */
+extern bool ppc64_dynamic_tag_check (int64_t tag);
+
/* Check whether given relocation is a copy relocation. */
extern bool ppc64_copy_reloc_p (int reloc);
diff --git a/libebl/ppc64_init.c b/libebl/ppc64_init.c
index 8231a32d..347444c0 100644
--- a/libebl/ppc64_init.c
+++ b/libebl/ppc64_init.c
@@ -37,6 +37,7 @@ ppc64_init (elf, machine, eh, ehlen)
eh->reloc_valid_use = ppc64_reloc_valid_use;
eh->reloc_simple_type = ppc64_reloc_simple_type;
eh->dynamic_tag_name = ppc64_dynamic_tag_name;
+ eh->dynamic_tag_check = ppc64_dynamic_tag_check;
eh->copy_reloc_p = ppc64_copy_reloc_p;
eh->destr = ppc64_destr;
diff --git a/libebl/ppc64_symbol.c b/libebl/ppc64_symbol.c
index f844816b..457e84e6 100644
--- a/libebl/ppc64_symbol.c
+++ b/libebl/ppc64_symbol.c
@@ -227,6 +227,15 @@ ppc64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
return NULL;
}
+bool
+ppc64_dynamic_tag_check (int64_t tag)
+{
+ return (tag == DT_PPC64_GLINK
+ || tag == DT_PPC64_OPD
+ || tag == DT_PPC64_OPDSZ);
+}
+
+
/* Check whether given relocation is a copy relocation. */
bool
ppc64_copy_reloc_p (int reloc)
diff --git a/libebl/ppc_init.c b/libebl/ppc_init.c
index 4d72c46d..dca780b5 100644
--- a/libebl/ppc_init.c
+++ b/libebl/ppc_init.c
@@ -36,6 +36,8 @@ ppc_init (elf, machine, eh, ehlen)
eh->reloc_type_check = ppc_reloc_type_check;
eh->reloc_valid_use = ppc_reloc_valid_use;
eh->reloc_simple_type = ppc_reloc_simple_type;
+ eh->dynamic_tag_name = ppc_dynamic_tag_name;
+ eh->dynamic_tag_check = ppc_dynamic_tag_check;
eh->copy_reloc_p = ppc_copy_reloc_p;
eh->destr = ppc_destr;
diff --git a/libebl/ppc_symbol.c b/libebl/ppc_symbol.c
index 20beae31..e865eaab 100644
--- a/libebl/ppc_symbol.c
+++ b/libebl/ppc_symbol.c
@@ -103,8 +103,14 @@ static struct
[R_PPC_GOT_DTPREL16] = { "R_PPC_GOT_DTPREL16", exec },
[R_PPC_GOT_DTPREL16_LO] = { "R_PPC_GOT_DTPREL16_LO", exec },
[R_PPC_GOT_DTPREL16_HI] = { "R_PPC_GOT_DTPREL16_HI", exec },
- [R_PPC_GOT_DTPREL16_HA] = { "R_PPC_GOT_DTPREL16_HA", exec }
+ [R_PPC_GOT_DTPREL16_HA] = { "R_PPC_GOT_DTPREL16_HA", exec },
+ [R_PPC_REL16] = { "R_PPC_REL16", rel },
+ [R_PPC_REL16_LO] = { "R_PPC_REL16_LO", rel },
+ [R_PPC_REL16_HI] = { "R_PPC_REL16_HI", rel },
+ [R_PPC_REL16_HA] = { "R_PPC_REL16_HA", rel },
};
+#define nreloc_map_table \
+ (sizeof (reloc_map_table) / sizeof (reloc_map_table[0]))
/* Determine relocation type string for PPC. */
@@ -112,7 +118,7 @@ const char *
ppc_reloc_type_name (int type, char *buf __attribute__ ((unused)),
size_t len __attribute__ ((unused)))
{
- if (type < 0 || type >= R_PPC_NUM)
+ if (type < 0 || (size_t) type >= nreloc_map_table)
return NULL;
return reloc_map_table[type].name;
@@ -123,7 +129,7 @@ ppc_reloc_type_name (int type, char *buf __attribute__ ((unused)),
bool
ppc_reloc_type_check (int type)
{
- return (type >= R_PPC_NONE && type < R_PPC_NUM
+ return (type >= R_PPC_NONE && (size_t) type < nreloc_map_table
&& reloc_map_table[type].name != NULL) ? true : false;
}
@@ -166,6 +172,29 @@ ppc_reloc_simple_type (Elf *elf __attribute__ ((unused)), int type)
}
}
+
+const char *
+ppc_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)))
+{
+ switch (tag)
+ {
+ case DT_PPC_GOT:
+ return "PPC_GOT";
+ default:
+ break;
+ }
+ return NULL;
+}
+
+
+bool
+ppc_dynamic_tag_check (int64_t tag)
+{
+ return tag == DT_PPC_GOT;
+}
+
+
/* Check whether given relocation is a copy relocation. */
bool
ppc_copy_reloc_p (int reloc)