summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2001-07-31 03:46:39 +0000
committerjake <jake@FreeBSD.org>2001-07-31 03:46:39 +0000
commit21b80f4133cacd90a3c9ee8a77c9616618c61c46 (patch)
treebb7222b6df769fb8c1baffd9425be229c7589573 /sys
parent1b33ddb75343a3261717f1fbd107de8d47f38602 (diff)
downloadFreeBSD-src-21b80f4133cacd90a3c9ee8a77c9616618c61c46.zip
FreeBSD-src-21b80f4133cacd90a3c9ee8a77c9616618c61c46.tar.gz
Use a machine dependent type, Elf_Hashelt, for the elements of the elf
dynamic symbol table buckets and chains. The sparc64 toolchain uses 32 bit .hash entries, unlike other 64 bits architectures (alpha), which use 64 bit entries. Discussed with: dfr, jdp
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/include/elf.h11
-rw-r--r--sys/amd64/include/elf.h11
-rw-r--r--sys/i386/include/elf.h11
-rw-r--r--sys/ia64/include/elf.h11
-rw-r--r--sys/kern/link_elf.c10
-rw-r--r--sys/kern/link_elf_obj.c10
-rw-r--r--sys/powerpc/include/elf.h11
7 files changed, 65 insertions, 10 deletions
diff --git a/sys/alpha/include/elf.h b/sys/alpha/include/elf.h
index aacfb3d..e57e3cb 100644
--- a/sys/alpha/include/elf.h
+++ b/sys/alpha/include/elf.h
@@ -60,6 +60,17 @@ typedef struct { /* Auxiliary vector entry on initial stack */
__ElfType(Auxinfo);
+/*
+ * Types of dynamic symbol hash table bucket and chain elements.
+ *
+ * This is inconsistent among 64 bit architectures, so a machine dependent
+ * typedef is required.
+ */
+
+typedef Elf64_Off Elf64_Hashelt;
+
+__ElfType(Hashelt);
+
/* Values for a_type. */
#define AT_NULL 0 /* Terminates the vector. */
#define AT_IGNORE 1 /* Ignored entry. */
diff --git a/sys/amd64/include/elf.h b/sys/amd64/include/elf.h
index 314dd9c..eb411d8 100644
--- a/sys/amd64/include/elf.h
+++ b/sys/amd64/include/elf.h
@@ -60,6 +60,17 @@ typedef struct { /* Auxiliary vector entry on initial stack */
__ElfType(Auxinfo);
+/*
+ * Types of dynamic symbol hash table bucket and chain elements.
+ *
+ * This is inconsistent among 64 bit architectures, so a machine dependent
+ * typedef is required.
+ */
+
+typedef Elf32_Off Elf32_Hashelt;
+
+__ElfType(Hashelt);
+
/* Values for a_type. */
#define AT_NULL 0 /* Terminates the vector. */
#define AT_IGNORE 1 /* Ignored entry. */
diff --git a/sys/i386/include/elf.h b/sys/i386/include/elf.h
index 314dd9c..eb411d8 100644
--- a/sys/i386/include/elf.h
+++ b/sys/i386/include/elf.h
@@ -60,6 +60,17 @@ typedef struct { /* Auxiliary vector entry on initial stack */
__ElfType(Auxinfo);
+/*
+ * Types of dynamic symbol hash table bucket and chain elements.
+ *
+ * This is inconsistent among 64 bit architectures, so a machine dependent
+ * typedef is required.
+ */
+
+typedef Elf32_Off Elf32_Hashelt;
+
+__ElfType(Hashelt);
+
/* Values for a_type. */
#define AT_NULL 0 /* Terminates the vector. */
#define AT_IGNORE 1 /* Ignored entry. */
diff --git a/sys/ia64/include/elf.h b/sys/ia64/include/elf.h
index db8bbcd..a35b156 100644
--- a/sys/ia64/include/elf.h
+++ b/sys/ia64/include/elf.h
@@ -60,6 +60,17 @@ typedef struct { /* Auxiliary vector entry on initial stack */
__ElfType(Auxinfo);
+/*
+ * Types of dynamic symbol hash table bucket and chain elements.
+ *
+ * This is inconsistent among 64 bit architectures, so a machine dependent
+ * typedef is required.
+ */
+
+typedef Elf64_Off Elf64_Hashelt;
+
+__ElfType(Hashelt);
+
/* Values for a_type. */
#define AT_NULL 0 /* Terminates the vector. */
#define AT_IGNORE 1 /* Ignored entry. */
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 439b9de..faaf160 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -67,10 +67,10 @@ typedef struct elf_file {
vm_object_t object; /* VM object to hold file pages */
#endif
Elf_Dyn* dynamic; /* Symbol table etc. */
- Elf_Off nbuckets; /* DT_HASH info */
- Elf_Off nchains;
- const Elf_Off* buckets;
- const Elf_Off* chains;
+ Elf_Hashelt nbuckets; /* DT_HASH info */
+ Elf_Hashelt nchains;
+ const Elf_Hashelt* buckets;
+ const Elf_Hashelt* chains;
caddr_t hash;
caddr_t strtab; /* DT_STRTAB */
int strsz; /* DT_STRSZ */
@@ -299,7 +299,7 @@ parse_dynamic(elf_file_t ef)
case DT_HASH:
{
/* From src/libexec/rtld-elf/rtld.c */
- const Elf_Off *hashtab = (const Elf_Off *)
+ const Elf_Hashelt *hashtab = (const Elf_Hashelt *)
(ef->address + dp->d_un.d_ptr);
ef->nbuckets = hashtab[0];
ef->nchains = hashtab[1];
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index 439b9de..faaf160 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -67,10 +67,10 @@ typedef struct elf_file {
vm_object_t object; /* VM object to hold file pages */
#endif
Elf_Dyn* dynamic; /* Symbol table etc. */
- Elf_Off nbuckets; /* DT_HASH info */
- Elf_Off nchains;
- const Elf_Off* buckets;
- const Elf_Off* chains;
+ Elf_Hashelt nbuckets; /* DT_HASH info */
+ Elf_Hashelt nchains;
+ const Elf_Hashelt* buckets;
+ const Elf_Hashelt* chains;
caddr_t hash;
caddr_t strtab; /* DT_STRTAB */
int strsz; /* DT_STRSZ */
@@ -299,7 +299,7 @@ parse_dynamic(elf_file_t ef)
case DT_HASH:
{
/* From src/libexec/rtld-elf/rtld.c */
- const Elf_Off *hashtab = (const Elf_Off *)
+ const Elf_Hashelt *hashtab = (const Elf_Hashelt *)
(ef->address + dp->d_un.d_ptr);
ef->nbuckets = hashtab[0];
ef->nchains = hashtab[1];
diff --git a/sys/powerpc/include/elf.h b/sys/powerpc/include/elf.h
index c10dfb4..81c748c 100644
--- a/sys/powerpc/include/elf.h
+++ b/sys/powerpc/include/elf.h
@@ -63,6 +63,17 @@ typedef struct { /* Auxiliary vector entry on initial stack */
__ElfType(Auxinfo);
+/*
+ * Types of dynamic symbol hash table bucket and chain elements.
+ *
+ * This is inconsistent among 64 bit architectures, so a machine dependent
+ * typedef is required.
+ */
+
+typedef Elf32_Off Elf32_Hashelt;
+
+__ElfType(Hashelt);
+
/* Values for a_type. */
#define AT_NULL 0 /* Terminates the vector. */
#define AT_IGNORE 1 /* Ignored entry. */
OpenPOWER on IntegriCloud