summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/generic/bits/link.h1
-rw-r--r--include/link.h3
-rw-r--r--ldso/dynlink.c4
-rw-r--r--src/internal/vdso.c3
4 files changed, 6 insertions, 5 deletions
diff --git a/arch/generic/bits/link.h b/arch/generic/bits/link.h
new file mode 100644
index 00000000..4a94d8f8
--- /dev/null
+++ b/arch/generic/bits/link.h
@@ -0,0 +1 @@
+typedef uint32_t Elf_Symndx;
diff --git a/include/link.h b/include/link.h
index 9349cddd..81501859 100644
--- a/include/link.h
+++ b/include/link.h
@@ -16,8 +16,7 @@ extern "C" {
#define ElfW(type) Elf32_ ## type
#endif
-/* this is the same everywhere except alpha and s390 */
-typedef uint32_t Elf_Symndx;
+#include <bits/link.h>
struct dl_phdr_info {
ElfW(Addr) dlpi_addr;
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index acb73bc2..ad49cac2 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -54,7 +54,7 @@ struct dso {
size_t phentsize;
int refcnt;
Sym *syms;
- uint32_t *hashtab;
+ Elf_Symndx *hashtab;
uint32_t *ghashtab;
int16_t *versym;
char *strings;
@@ -206,7 +206,7 @@ static Sym *sysv_lookup(const char *s, uint32_t h, struct dso *dso)
{
size_t i;
Sym *syms = dso->syms;
- uint32_t *hashtab = dso->hashtab;
+ Elf_Symndx *hashtab = dso->hashtab;
char *strings = dso->strings;
for (i=hashtab[2+h%hashtab[0]]; i; i=hashtab[2+hashtab[0]+i]) {
if ((!dso->versym || dso->versym[i] >= 0)
diff --git a/src/internal/vdso.c b/src/internal/vdso.c
index 6ae0212e..a4862171 100644
--- a/src/internal/vdso.c
+++ b/src/internal/vdso.c
@@ -1,4 +1,5 @@
#include <elf.h>
+#include <link.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>
@@ -57,7 +58,7 @@ void *__vdsosym(const char *vername, const char *name)
char *strings = 0;
Sym *syms = 0;
- uint32_t *hashtab = 0;
+ Elf_Symndx *hashtab = 0;
uint16_t *versym = 0;
Verdef *verdef = 0;