summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorskrll <skrll@NetBSD.org>2010-09-30 09:11:18 +0000
committerskrll <skrll@NetBSD.org>2010-09-30 09:11:18 +0000
commit06acf46b03cff87a23a4e302cadf7f6076ee63c0 (patch)
treeb96a7e99a4c183f44183e1cc98ffd74b0f9f079e /libexec
parent672cabf514c3c8d5a2043a713efa94d6d8d12145 (diff)
Introduce a new type Elf_Symindx for use in decoding the symbol hash table
section and allow this type to be overridden. The ELF specification says it should always be uint32_t (Elf_Word), but alpha decided to be different (not sure why). Define Elf_Symindx to be uint64_t on alpha. Alpha no longer uses non-standard definitions of Elf64_Sword and Elf64_Word. Remove the ability to override these types. Fixes ld.elf_so after Herculean effort from me and martin.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.elf_so/arch/alpha/alpha_reloc.c8
-rw-r--r--libexec/ld.elf_so/headers.c8
-rw-r--r--libexec/ld.elf_so/rtld.h6
3 files changed, 11 insertions, 11 deletions
diff --git a/libexec/ld.elf_so/arch/alpha/alpha_reloc.c b/libexec/ld.elf_so/arch/alpha/alpha_reloc.c
index 0d7f1ce896a..357adc78e5a 100644
--- a/libexec/ld.elf_so/arch/alpha/alpha_reloc.c
+++ b/libexec/ld.elf_so/arch/alpha/alpha_reloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha_reloc.c,v 1.37 2010/08/06 16:33:17 joerg Exp $ */
+/* $NetBSD: alpha_reloc.c,v 1.38 2010/09/30 09:11:18 skrll Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -62,7 +62,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: alpha_reloc.c,v 1.37 2010/08/06 16:33:17 joerg Exp $");
+__RCSID("$NetBSD: alpha_reloc.c,v 1.38 2010/09/30 09:11:18 skrll Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -80,7 +80,7 @@ __RCSID("$NetBSD: alpha_reloc.c,v 1.37 2010/08/06 16:33:17 joerg Exp $");
void _rtld_bind_start(void);
void _rtld_bind_start_old(void);
void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr);
-caddr_t _rtld_bind(const Obj_Entry *, Elf_Word);
+caddr_t _rtld_bind(const Obj_Entry *, Elf_Addr);
static inline int _rtld_relocate_plt_object(const Obj_Entry *,
const Elf_Rela *, Elf_Addr *);
@@ -476,7 +476,7 @@ out:
}
caddr_t
-_rtld_bind(const Obj_Entry *obj, Elf_Word reloff)
+_rtld_bind(const Obj_Entry *obj, Elf_Addr reloff)
{
const Elf_Rela *rela =
(const Elf_Rela *)((const uint8_t *)obj->pltrela + reloff);
diff --git a/libexec/ld.elf_so/headers.c b/libexec/ld.elf_so/headers.c
index 487f044eba7..0e52a403e89 100644
--- a/libexec/ld.elf_so/headers.c
+++ b/libexec/ld.elf_so/headers.c
@@ -1,4 +1,4 @@
-/* $NetBSD: headers.c,v 1.30 2010/09/23 13:03:35 joerg Exp $ */
+/* $NetBSD: headers.c,v 1.31 2010/09/30 09:11:18 skrll Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: headers.c,v 1.30 2010/09/23 13:03:35 joerg Exp $");
+__RCSID("$NetBSD: headers.c,v 1.31 2010/09/30 09:11:18 skrll Exp $");
#endif /* not lint */
#include <err.h>
@@ -138,8 +138,8 @@ _rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
case DT_HASH:
{
- const Elf_Word *hashtab = (const Elf_Word *)
- (obj->relocbase + dynp->d_un.d_ptr);
+ const Elf_Symindx *hashtab = (const Elf_Symindx *)
+ (obj->relocbase + dynp->d_un.d_ptr);
if (hashtab[0] > UINT32_MAX)
obj->nbuckets = UINT32_MAX;
diff --git a/libexec/ld.elf_so/rtld.h b/libexec/ld.elf_so/rtld.h
index ec33013f91b..d09e38736a8 100644
--- a/libexec/ld.elf_so/rtld.h
+++ b/libexec/ld.elf_so/rtld.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.h,v 1.92 2010/08/06 16:33:17 joerg Exp $ */
+/* $NetBSD: rtld.h,v 1.93 2010/09/30 09:11:18 skrll Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -161,12 +161,12 @@ typedef struct Struct_Obj_Entry {
Elf_Word gotsym; /* First dynamic symbol in GOT */
#endif
- const Elf_Word *buckets; /* Hash table buckets array */
+ const Elf_Symindx *buckets; /* Hash table buckets array */
uint32_t nbuckets; /* Number of buckets */
uint32_t nbuckets_m; /* Precomputed for fast remainder */
uint8_t nbuckets_s1;
uint8_t nbuckets_s2;
- const Elf_Word *chains; /* Hash table chain array */
+ const Elf_Symindx *chains; /* Hash table chain array */
unsigned long nchains; /* Number of chains */
Search_Path *rpaths; /* Search path specified in object */