summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-03-14 22:13:36 +0000
committerEric Andersen <andersen@codepoet.org>2005-03-14 22:13:36 +0000
commit112b1a413234988767c6d636f4aa8472f423d864 (patch)
treed4ac78a2e778ff6cd5e6fd18f7c827826ab94ca5 /ldso
parent90fd5cb00fc8399392bf5ce69432c0ac5678606a (diff)
Make mips at least compile
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/mips/dl-startup.h20
-rw-r--r--ldso/ldso/mips/dl-sysdep.h2
2 files changed, 12 insertions, 10 deletions
diff --git a/ldso/ldso/mips/dl-startup.h b/ldso/ldso/mips/dl-startup.h
index 0dd92b5ba..0a19f7534 100644
--- a/ldso/ldso/mips/dl-startup.h
+++ b/ldso/ldso/mips/dl-startup.h
@@ -51,15 +51,16 @@ asm("" \
#define PERFORM_BOOTSTRAP_GOT(got, tpnt) \
do { \
Elf32_Sym *sym; \
- unsigned long i; \
+ Elf32_Addr i; \
+ Elf32_Addr *mipsgot = (void *) got; \
\
/* Add load address displacement to all local GOT entries */ \
i = 2; \
while (i < tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]) \
- got[i++] += load_addr; \
+ mipsgot[i++] += load_addr; \
\
/* Handle global GOT entries */ \
- got += tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]; \
+ mipsgot += tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]; \
sym = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + \
load_addr) + tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; \
i = tpnt->dynamic_info[DT_MIPS_SYMTABNO_IDX] - tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX];\
@@ -67,23 +68,22 @@ do { \
while (i--) { \
if (sym->st_shndx == SHN_UNDEF || \
sym->st_shndx == SHN_COMMON) \
- *got = load_addr + sym->st_value; \
+ *mipsgot = load_addr + sym->st_value; \
else if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && \
- *got != sym->st_value) \
- *got += load_addr; \
+ *mipsgot != sym->st_value) \
+ *mipsgot += load_addr; \
else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) { \
if (sym->st_other == 0) \
- *got += load_addr; \
+ *mipsgot += load_addr; \
} \
else \
- *got = load_addr + sym->st_value; \
+ *mipsgot = load_addr + sym->st_value; \
\
- got++; \
+ mipsgot++; \
sym++; \
} \
} while (0)
-
/*
* Here is a macro to perform a relocation. This is only used when
* bootstrapping the dynamic loader.
diff --git a/ldso/ldso/mips/dl-sysdep.h b/ldso/ldso/mips/dl-sysdep.h
index 3f4672182..7fc75b7aa 100644
--- a/ldso/ldso/mips/dl-sysdep.h
+++ b/ldso/ldso/mips/dl-sysdep.h
@@ -8,6 +8,8 @@
/* Define this if the system uses RELOCA. */
#undef ELF_USES_RELOCA
#include <elf.h>
+#include <link.h>
+
#define ARCH_NUM 3
#define DT_MIPS_GOTSYM_IDX (DT_NUM + OS_NUM)
#define DT_MIPS_LOCAL_GOTNO_IDX (DT_NUM + OS_NUM +1)