summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2005-12-18 04:52:37 +0000
committermarcel <marcel@FreeBSD.org>2005-12-18 04:52:37 +0000
commit0a081d09f4f7db02d1baa4889eb218e2eff4097a (patch)
treec8421e79058b3959c09903a706bc77c9de3e7087 /sys
parent3394701ae17fa6037d9dc3f0da623707988cb02a (diff)
downloadFreeBSD-src-0a081d09f4f7db02d1baa4889eb218e2eff4097a.zip
FreeBSD-src-0a081d09f4f7db02d1baa4889eb218e2eff4097a.tar.gz
Make our ELF64 type definitions match standards. In particular this
means: o Remove Elf64_Quarter, o Redefine Elf64_Half to be 16-bit, o Redefine Elf64_Word to be 32-bit, o Add Elf64_Xword and Elf64_Sxword for 64-bit entities, o Use Elf_Size in MI code to abstract the difference between Elf32_Word and Elf64_Word. o Add Elf_Ssize as the signed counterpart of Elf_Size. MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/elf_machdep.c2
-rw-r--r--sys/amd64/amd64/elf_machdep.c2
-rw-r--r--sys/boot/common/bootstrap.h2
-rw-r--r--sys/boot/common/load_elf.c2
-rw-r--r--sys/boot/common/load_elf_obj.c4
-rw-r--r--sys/boot/common/reloc_elf.c6
-rw-r--r--sys/ia64/ia64/elf_machdep.c4
-rw-r--r--sys/kern/link_elf.c10
-rw-r--r--sys/kern/link_elf_obj.c10
-rw-r--r--sys/sparc64/sparc64/elf_machdep.c6
-rw-r--r--sys/sys/elf32.h32
-rw-r--r--sys/sys/elf64.h82
-rw-r--r--sys/sys/elf_generic.h7
-rw-r--r--sys/sys/imgact_elf.h18
-rw-r--r--sys/sys/linker.h6
15 files changed, 102 insertions, 91 deletions
diff --git a/sys/alpha/alpha/elf_machdep.c b/sys/alpha/alpha/elf_machdep.c
index 6937e84..6a3c060 100644
--- a/sys/alpha/alpha/elf_machdep.c
+++ b/sys/alpha/alpha/elf_machdep.c
@@ -121,7 +121,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
Elf_Addr *where;
Elf_Addr addr;
Elf_Addr addend;
- Elf_Word rtype, symidx;
+ Elf_Size rtype, symidx;
const Elf_Rel *rel;
const Elf_Rela *rela;
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 7396503..0c4a0cc 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -119,7 +119,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
Elf32_Addr *where32, val32;
Elf_Addr addr;
Elf_Addr addend;
- Elf_Word rtype, symidx;
+ Elf_Size rtype, symidx;
const Elf_Rel *rel;
const Elf_Rela *rela;
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index f84c8e3..d309c2b 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -240,7 +240,7 @@ int file_addmodule(struct preloaded_file *fp, char *modname, int version,
#define ELF_RELOC_RELA 2
struct elf_file;
-typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Word symidx);
+typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Size symidx);
int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result);
int __elfN(obj_loadfile)(char *filename, u_int64_t dest,
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index a44145b..2235ea8 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -744,7 +744,7 @@ __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef,
}
static Elf_Addr
-__elfN(symaddr)(struct elf_file *ef, Elf_Word symidx)
+__elfN(symaddr)(struct elf_file *ef, Elf_Size symidx)
{
/* Symbol lookup by index not required here. */
diff --git a/sys/boot/common/load_elf_obj.c b/sys/boot/common/load_elf_obj.c
index 53b1317..4b3aaea 100644
--- a/sys/boot/common/load_elf_obj.c
+++ b/sys/boot/common/load_elf_obj.c
@@ -70,7 +70,7 @@ static int __elfN(obj_reloc_ptr)(struct preloaded_file *mp, elf_file_t ef,
Elf_Addr p, void *val, size_t len);
static int __elfN(obj_parse_modmetadata)(struct preloaded_file *mp,
elf_file_t ef);
-static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx);
+static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx);
const char *__elfN(obj_kerneltype) = "elf kernel";
const char *__elfN(obj_moduletype) = "elf obj module";
@@ -495,7 +495,7 @@ __elfN(obj_reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, Elf_Addr p,
/* Look up the address of a specified symbol. */
static Elf_Addr
-__elfN(obj_symaddr)(struct elf_file *ef, Elf_Word symidx)
+__elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx)
{
Elf_Sym sym;
Elf_Addr base;
diff --git a/sys/boot/common/reloc_elf.c b/sys/boot/common/reloc_elf.c
index d6ff999..43b7cbf 100644
--- a/sys/boot/common/reloc_elf.c
+++ b/sys/boot/common/reloc_elf.c
@@ -54,7 +54,7 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata,
int reltype, Elf_Addr relbase, Elf_Addr dataaddr, void *data, size_t len)
{
#ifdef __sparc__
- Elf_Word w;
+ Elf_Size w;
const Elf_Rela *a;
switch (reltype) {
@@ -81,7 +81,7 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata,
#elif defined(__i386__) && __ELF_WORD_SIZE == 64
Elf64_Addr *where, val;
Elf_Addr addend, addr;
- Elf_Word rtype, symidx;
+ Elf_Size rtype, symidx;
const Elf_Rel *rel;
const Elf_Rela *rela;
@@ -138,7 +138,7 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata,
return (0);
#elif defined(__i386__) && __ELF_WORD_SIZE == 32
Elf_Addr addend, addr, *where, val;
- Elf_Word rtype, symidx;
+ Elf_Size rtype, symidx;
const Elf_Rel *rel;
const Elf_Rela *rela;
diff --git a/sys/ia64/ia64/elf_machdep.c b/sys/ia64/ia64/elf_machdep.c
index 51902ec..ccd5083 100644
--- a/sys/ia64/ia64/elf_machdep.c
+++ b/sys/ia64/ia64/elf_machdep.c
@@ -118,7 +118,7 @@ elf64_dump_thread(struct thread *td, void *dst, size_t *off __unused)
static Elf_Addr
-lookup_fdesc(linker_file_t lf, Elf_Word symidx, elf_lookup_fn lookup)
+lookup_fdesc(linker_file_t lf, Elf_Size symidx, elf_lookup_fn lookup)
{
linker_file_t top;
Elf_Addr addr;
@@ -171,7 +171,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
{
Elf_Addr *where;
Elf_Addr addend, addr;
- Elf_Word rtype, symidx;
+ Elf_Size rtype, symidx;
const Elf_Rel *rel;
const Elf_Rela *rela;
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 29b54e5..7b3f1ab 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -120,7 +120,7 @@ static int link_elf_each_function_name(linker_file_t,
int (*)(const char *, void *),
void *);
static void link_elf_reloc_local(linker_file_t);
-static Elf_Addr elf_lookup(linker_file_t lf, Elf_Word symidx, int deps);
+static Elf_Addr elf_lookup(linker_file_t lf, Elf_Size symidx, int deps);
static kobj_method_t link_elf_methods[] = {
KOBJMETHOD(linker_lookup_symbol, link_elf_lookup_symbol),
@@ -909,7 +909,7 @@ link_elf_unload_preload(linker_file_t file)
}
static const char *
-symbol_name(elf_file_t ef, Elf_Word r_info)
+symbol_name(elf_file_t ef, Elf_Size r_info)
{
const Elf_Sym *ref;
@@ -1232,7 +1232,7 @@ link_elf_get_gp(linker_file_t lf)
#endif
const Elf_Sym *
-elf_get_sym(linker_file_t lf, Elf_Word symidx)
+elf_get_sym(linker_file_t lf, Elf_Size symidx)
{
elf_file_t ef = (elf_file_t)lf;
@@ -1242,7 +1242,7 @@ elf_get_sym(linker_file_t lf, Elf_Word symidx)
}
const char *
-elf_get_symname(linker_file_t lf, Elf_Word symidx)
+elf_get_symname(linker_file_t lf, Elf_Size symidx)
{
elf_file_t ef = (elf_file_t)lf;
const Elf_Sym *sym;
@@ -1261,7 +1261,7 @@ elf_get_symname(linker_file_t lf, Elf_Word symidx)
* the case that the symbol can be found through the hash table.
*/
static Elf_Addr
-elf_lookup(linker_file_t lf, Elf_Word symidx, int deps)
+elf_lookup(linker_file_t lf, Elf_Size symidx, int deps)
{
elf_file_t ef = (elf_file_t)lf;
const Elf_Sym *sym;
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index a338610..de43b7a 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -124,7 +124,7 @@ static int link_elf_each_function_name(linker_file_t,
int (*)(const char *, void *), void *);
static void link_elf_reloc_local(linker_file_t);
-static Elf_Addr elf_obj_lookup(linker_file_t lf, Elf_Word symidx, int deps);
+static Elf_Addr elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int deps);
static kobj_method_t link_elf_methods[] = {
KOBJMETHOD(linker_lookup_symbol, link_elf_lookup_symbol),
@@ -843,7 +843,7 @@ link_elf_unload_file(linker_file_t file)
}
static const char *
-symbol_name(elf_file_t ef, Elf_Word r_info)
+symbol_name(elf_file_t ef, Elf_Size r_info)
{
const Elf_Sym *ref;
@@ -879,7 +879,7 @@ relocate_file(elf_file_t ef)
const char *symname;
const Elf_Sym *sym;
int i;
- Elf_Word symidx;
+ Elf_Size symidx;
Elf_Addr base;
@@ -1069,7 +1069,7 @@ link_elf_each_function_name(linker_file_t file,
* the case that the symbol can be found through the hash table.
*/
static Elf_Addr
-elf_obj_lookup(linker_file_t lf, Elf_Word symidx, int deps)
+elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int deps)
{
elf_file_t ef = (elf_file_t)lf;
const Elf_Sym *sym;
@@ -1122,7 +1122,7 @@ link_elf_reloc_local(linker_file_t lf)
const Elf_Sym *sym;
Elf_Addr base;
int i;
- Elf_Word symidx;
+ Elf_Size symidx;
/* Perform relocations without addend if there are any: */
for (i = 0; i < ef->nrel; i++) {
diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c
index edc18ac..b113afe 100644
--- a/sys/sparc64/sparc64/elf_machdep.c
+++ b/sys/sparc64/sparc64/elf_machdep.c
@@ -288,9 +288,9 @@ elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type,
elf_lookup_fn lookup)
{
const Elf_Rela *rela;
- Elf_Half *where32;
+ Elf_Word *where32;
Elf_Addr *where;
- Elf_Word rtype, symidx;
+ Elf_Size rtype, symidx;
Elf_Addr value;
Elf_Addr mask;
Elf_Addr addr;
@@ -300,7 +300,7 @@ elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type,
rela = (const Elf_Rela *)data;
where = (Elf_Addr *)(relocbase + rela->r_offset);
- where32 = (Elf_Half *)where;
+ where32 = (Elf_Word *)where;
rtype = ELF_R_TYPE(rela->r_info);
symidx = ELF_R_SYM(rela->r_info);
diff --git a/sys/sys/elf32.h b/sys/sys/elf32.h
index b0c083c..412db54 100644
--- a/sys/sys/elf32.h
+++ b/sys/sys/elf32.h
@@ -35,13 +35,17 @@
* ELF definitions common to all 32-bit architectures.
*/
-typedef u_int32_t Elf32_Addr;
-typedef u_int16_t Elf32_Half;
-typedef u_int32_t Elf32_Off;
+typedef uint32_t Elf32_Addr;
+typedef uint16_t Elf32_Half;
+typedef uint32_t Elf32_Off;
typedef int32_t Elf32_Sword;
-typedef u_int32_t Elf32_Word;
-typedef u_int32_t Elf32_Size;
-typedef Elf32_Off Elf32_Hashelt;
+typedef uint32_t Elf32_Word;
+
+typedef Elf32_Word Elf32_Hashelt;
+
+/* Non-standard class-dependent datatype used for abstraction. */
+typedef Elf32_Word Elf32_Size;
+typedef Elf32_Sword Elf32_Ssize;
/*
* ELF header.
@@ -75,11 +79,11 @@ typedef struct {
Elf32_Word sh_flags; /* Section flags. */
Elf32_Addr sh_addr; /* Address in memory image. */
Elf32_Off sh_offset; /* Offset in file. */
- Elf32_Size sh_size; /* Size in bytes. */
+ Elf32_Word sh_size; /* Size in bytes. */
Elf32_Word sh_link; /* Index of a related section. */
Elf32_Word sh_info; /* Depends on section type. */
- Elf32_Size sh_addralign; /* Alignment in bytes. */
- Elf32_Size sh_entsize; /* Size of each entry in section. */
+ Elf32_Word sh_addralign; /* Alignment in bytes. */
+ Elf32_Word sh_entsize; /* Size of each entry in section. */
} Elf32_Shdr;
/*
@@ -91,10 +95,10 @@ typedef struct {
Elf32_Off p_offset; /* File offset of contents. */
Elf32_Addr p_vaddr; /* Virtual address in memory image. */
Elf32_Addr p_paddr; /* Physical address (not used). */
- Elf32_Size p_filesz; /* Size of contents in file. */
- Elf32_Size p_memsz; /* Size of contents in memory. */
+ Elf32_Word p_filesz; /* Size of contents in file. */
+ Elf32_Word p_memsz; /* Size of contents in memory. */
Elf32_Word p_flags; /* Access permission flags. */
- Elf32_Size p_align; /* Alignment in memory and file. */
+ Elf32_Word p_align; /* Alignment in memory and file. */
} Elf32_Phdr;
/*
@@ -104,7 +108,7 @@ typedef struct {
typedef struct {
Elf32_Sword d_tag; /* Entry type. */
union {
- Elf32_Size d_val; /* Integer value. */
+ Elf32_Word d_val; /* Integer value. */
Elf32_Addr d_ptr; /* Address value. */
} d_un;
} Elf32_Dyn;
@@ -140,7 +144,7 @@ typedef struct {
typedef struct {
Elf32_Word st_name; /* String table index of name. */
Elf32_Addr st_value; /* Symbol value. */
- Elf32_Size st_size; /* Size of associated object. */
+ Elf32_Word st_size; /* Size of associated object. */
unsigned char st_info; /* Type and binding information. */
unsigned char st_other; /* Reserved (not used). */
Elf32_Half st_shndx; /* Section index of symbol. */
diff --git a/sys/sys/elf64.h b/sys/sys/elf64.h
index 0f236e5..c39cd13 100644
--- a/sys/sys/elf64.h
+++ b/sys/sys/elf64.h
@@ -35,13 +35,13 @@
* ELF definitions common to all 64-bit architectures.
*/
-typedef u_int64_t Elf64_Addr;
-typedef u_int32_t Elf64_Half;
-typedef u_int64_t Elf64_Off;
-typedef int64_t Elf64_Sword;
-typedef u_int64_t Elf64_Word;
-typedef u_int64_t Elf64_Size;
-typedef u_int16_t Elf64_Quarter;
+typedef uint64_t Elf64_Addr;
+typedef uint16_t Elf64_Half;
+typedef uint64_t Elf64_Off;
+typedef int32_t Elf64_Sword;
+typedef int64_t Elf64_Sxword;
+typedef uint32_t Elf64_Word;
+typedef uint64_t Elf64_Xword;
/*
* Types of dynamic symbol hash table bucket and chain elements.
@@ -53,28 +53,32 @@ typedef u_int16_t Elf64_Quarter;
#ifdef __alpha__
typedef Elf64_Off Elf64_Hashelt;
#else
-typedef Elf64_Half Elf64_Hashelt;
+typedef Elf64_Word Elf64_Hashelt;
#endif
+/* Non-standard class-dependent datatype used for abstraction. */
+typedef Elf64_Xword Elf64_Size;
+typedef Elf64_Sxword Elf64_Ssize;
+
/*
* ELF header.
*/
typedef struct {
unsigned char e_ident[EI_NIDENT]; /* File identification. */
- Elf64_Quarter e_type; /* File type. */
- Elf64_Quarter e_machine; /* Machine architecture. */
- Elf64_Half e_version; /* ELF format version. */
+ Elf64_Half e_type; /* File type. */
+ Elf64_Half e_machine; /* Machine architecture. */
+ Elf64_Word e_version; /* ELF format version. */
Elf64_Addr e_entry; /* Entry point. */
Elf64_Off e_phoff; /* Program header file offset. */
Elf64_Off e_shoff; /* Section header file offset. */
- Elf64_Half e_flags; /* Architecture-specific flags. */
- Elf64_Quarter e_ehsize; /* Size of ELF header in bytes. */
- Elf64_Quarter e_phentsize; /* Size of program header entry. */
- Elf64_Quarter e_phnum; /* Number of program header entries. */
- Elf64_Quarter e_shentsize; /* Size of section header entry. */
- Elf64_Quarter e_shnum; /* Number of section header entries. */
- Elf64_Quarter e_shstrndx; /* Section name strings section. */
+ Elf64_Word e_flags; /* Architecture-specific flags. */
+ Elf64_Half e_ehsize; /* Size of ELF header in bytes. */
+ Elf64_Half e_phentsize; /* Size of program header entry. */
+ Elf64_Half e_phnum; /* Number of program header entries. */
+ Elf64_Half e_shentsize; /* Size of section header entry. */
+ Elf64_Half e_shnum; /* Number of section header entries. */
+ Elf64_Half e_shstrndx; /* Section name strings section. */
} Elf64_Ehdr;
/*
@@ -82,17 +86,17 @@ typedef struct {
*/
typedef struct {
- Elf64_Half sh_name; /* Section name (index into the
+ Elf64_Word sh_name; /* Section name (index into the
section header string table). */
- Elf64_Half sh_type; /* Section type. */
- Elf64_Size sh_flags; /* Section flags. */
+ Elf64_Word sh_type; /* Section type. */
+ Elf64_Xword sh_flags; /* Section flags. */
Elf64_Addr sh_addr; /* Address in memory image. */
Elf64_Off sh_offset; /* Offset in file. */
- Elf64_Size sh_size; /* Size in bytes. */
- Elf64_Half sh_link; /* Index of a related section. */
- Elf64_Half sh_info; /* Depends on section type. */
- Elf64_Size sh_addralign; /* Alignment in bytes. */
- Elf64_Size sh_entsize; /* Size of each entry in section. */
+ Elf64_Xword sh_size; /* Size in bytes. */
+ Elf64_Word sh_link; /* Index of a related section. */
+ Elf64_Word sh_info; /* Depends on section type. */
+ Elf64_Xword sh_addralign; /* Alignment in bytes. */
+ Elf64_Xword sh_entsize; /* Size of each entry in section. */
} Elf64_Shdr;
/*
@@ -100,14 +104,14 @@ typedef struct {
*/
typedef struct {
- Elf64_Half p_type; /* Entry type. */
- Elf64_Half p_flags; /* Access permission flags. */
+ Elf64_Word p_type; /* Entry type. */
+ Elf64_Word p_flags; /* Access permission flags. */
Elf64_Off p_offset; /* File offset of contents. */
Elf64_Addr p_vaddr; /* Virtual address in memory image. */
Elf64_Addr p_paddr; /* Physical address (not used). */
- Elf64_Size p_filesz; /* Size of contents in file. */
- Elf64_Size p_memsz; /* Size of contents in memory. */
- Elf64_Size p_align; /* Alignment in memory and file. */
+ Elf64_Xword p_filesz; /* Size of contents in file. */
+ Elf64_Xword p_memsz; /* Size of contents in memory. */
+ Elf64_Xword p_align; /* Alignment in memory and file. */
} Elf64_Phdr;
/*
@@ -115,9 +119,9 @@ typedef struct {
*/
typedef struct {
- Elf64_Size d_tag; /* Entry type. */
+ Elf64_Sxword d_tag; /* Entry type. */
union {
- Elf64_Size d_val; /* Integer value. */
+ Elf64_Xword d_val; /* Integer value. */
Elf64_Addr d_ptr; /* Address value. */
} d_un;
} Elf64_Dyn;
@@ -129,14 +133,14 @@ typedef struct {
/* Relocations that don't need an addend field. */
typedef struct {
Elf64_Addr r_offset; /* Location to be relocated. */
- Elf64_Size r_info; /* Relocation type and symbol index. */
+ Elf64_Xword r_info; /* Relocation type and symbol index. */
} Elf64_Rel;
/* Relocations that need an addend field. */
typedef struct {
Elf64_Addr r_offset; /* Location to be relocated. */
- Elf64_Size r_info; /* Relocation type and symbol index. */
- Elf64_Off r_addend; /* Addend. */
+ Elf64_Xword r_info; /* Relocation type and symbol index. */
+ Elf64_Sxword r_addend; /* Addend. */
} Elf64_Rela;
/* Macros for accessing the fields of r_info. */
@@ -151,12 +155,12 @@ typedef struct {
*/
typedef struct {
- Elf64_Half st_name; /* String table index of name. */
+ Elf64_Word st_name; /* String table index of name. */
unsigned char st_info; /* Type and binding information. */
unsigned char st_other; /* Reserved (not used). */
- Elf64_Quarter st_shndx; /* Section index of symbol. */
+ Elf64_Half st_shndx; /* Section index of symbol. */
Elf64_Addr st_value; /* Symbol value. */
- Elf64_Size st_size; /* Size of associated object. */
+ Elf64_Xword st_size; /* Size of associated object. */
} Elf64_Sym;
/* Macros for accessing the fields of st_info. */
diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h
index cc0c471..c1e5a66 100644
--- a/sys/sys/elf_generic.h
+++ b/sys/sys/elf_generic.h
@@ -60,8 +60,6 @@ __ElfType(Half);
__ElfType(Off);
__ElfType(Sword);
__ElfType(Word);
-__ElfType(Size);
-__ElfType(Hashelt);
__ElfType(Ehdr);
__ElfType(Shdr);
__ElfType(Phdr);
@@ -70,6 +68,11 @@ __ElfType(Rel);
__ElfType(Rela);
__ElfType(Sym);
+/* Non-standard ELF types. */
+__ElfType(Hashelt);
+__ElfType(Size);
+__ElfType(Ssize);
+
#define ELF_R_SYM __ELFN(R_SYM)
#define ELF_R_TYPE __ELFN(R_TYPE)
#define ELF_R_INFO __ELFN(R_INFO)
diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h
index 3454787..8bb4cc2 100644
--- a/sys/sys/imgact_elf.h
+++ b/sys/sys/imgact_elf.h
@@ -44,15 +44,15 @@ struct thread;
* stack fixup routine.
*/
typedef struct {
- Elf_Sword execfd;
- Elf_Word phdr;
- Elf_Word phent;
- Elf_Word phnum;
- Elf_Word pagesz;
- Elf_Word base;
- Elf_Word flags;
- Elf_Word entry;
- Elf_Word trace;
+ Elf_Ssize execfd;
+ Elf_Size phdr;
+ Elf_Size phent;
+ Elf_Size phnum;
+ Elf_Size pagesz;
+ Elf_Size base;
+ Elf_Size flags;
+ Elf_Size entry;
+ Elf_Size trace;
} __ElfN(Auxargs);
typedef struct {
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index ba91af2..90ed243 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -242,13 +242,13 @@ extern int kld_debug;
#endif
-typedef Elf_Addr elf_lookup_fn(linker_file_t, Elf_Word, int);
+typedef Elf_Addr elf_lookup_fn(linker_file_t, Elf_Size, int);
/* Support functions */
int elf_reloc(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu);
int elf_reloc_local(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu);
-const Elf_Sym *elf_get_sym(linker_file_t _lf, Elf_Word _symidx);
-const char *elf_get_symname(linker_file_t _lf, Elf_Word _symidx);
+const Elf_Sym *elf_get_sym(linker_file_t _lf, Elf_Size _symidx);
+const char *elf_get_symname(linker_file_t _lf, Elf_Size _symidx);
int elf_cpu_load_file(linker_file_t);
int elf_cpu_unload_file(linker_file_t);
OpenPOWER on IntegriCloud