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
This commit is contained in:
Jake Burkholder 2001-07-31 03:46:39 +00:00
parent baa444b77e
commit 7e5102989e
7 changed files with 65 additions and 10 deletions

View File

@ -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. */

View File

@ -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. */

View File

@ -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. */

View File

@ -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. */

View File

@ -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];

View File

@ -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];

View File

@ -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. */