Browse Source

Make mips at least compile

Eric Andersen 20 years ago
parent
commit
112b1a4132
2 changed files with 12 additions and 10 deletions
  1. 10 10
      ldso/ldso/mips/dl-startup.h
  2. 2 0
      ldso/ldso/mips/dl-sysdep.h

+ 10 - 10
ldso/ldso/mips/dl-startup.h

@@ -51,15 +51,16 @@ asm("" \
 #define PERFORM_BOOTSTRAP_GOT(got, tpnt)					\
 #define PERFORM_BOOTSTRAP_GOT(got, tpnt)					\
 do {										\
 do {										\
 	Elf32_Sym *sym;								\
 	Elf32_Sym *sym;								\
-	unsigned long i;							\
+	Elf32_Addr i;							\
+	Elf32_Addr *mipsgot = (void *) got;					\
 										\
 										\
 	/* Add load address displacement to all local GOT entries */		\
 	/* Add load address displacement to all local GOT entries */		\
 	i = 2;									\
 	i = 2;									\
 	while (i < tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX])			\
 	while (i < tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX])			\
-		got[i++] += load_addr;						\
+		mipsgot[i++] += load_addr;					\
 										\
 										\
 	/* Handle global GOT entries */						\
 	/* 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] +			\
 	sym = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] +			\
 		 load_addr) + tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX];		\
 		 load_addr) + tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX];		\
 	i = tpnt->dynamic_info[DT_MIPS_SYMTABNO_IDX] - 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--) {								\
 	while (i--) {								\
 		if (sym->st_shndx == SHN_UNDEF ||				\
 		if (sym->st_shndx == SHN_UNDEF ||				\
 			sym->st_shndx == SHN_COMMON)				\
 			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 &&		\
 		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) {		\
 		else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) {		\
 			if (sym->st_other == 0)					\
 			if (sym->st_other == 0)					\
-				*got += load_addr;				\
+				*mipsgot += load_addr;				\
 		}								\
 		}								\
 		else								\
 		else								\
-			*got = load_addr + sym->st_value;			\
+			*mipsgot = load_addr + sym->st_value;			\
 										\
 										\
-		got++;								\
+		mipsgot++;							\
 		sym++;								\
 		sym++;								\
 	}									\
 	}									\
 } while (0)
 } while (0)
 
 
-
 /*
 /*
  * Here is a macro to perform a relocation.  This is only used when
  * Here is a macro to perform a relocation.  This is only used when
  * bootstrapping the dynamic loader.
  * bootstrapping the dynamic loader.

+ 2 - 0
ldso/ldso/mips/dl-sysdep.h

@@ -8,6 +8,8 @@
 /* Define this if the system uses RELOCA.  */
 /* Define this if the system uses RELOCA.  */
 #undef ELF_USES_RELOCA
 #undef ELF_USES_RELOCA
 #include <elf.h>
 #include <elf.h>
+#include <link.h>
+
 #define ARCH_NUM 3
 #define ARCH_NUM 3
 #define DT_MIPS_GOTSYM_IDX	(DT_NUM + OS_NUM)
 #define DT_MIPS_GOTSYM_IDX	(DT_NUM + OS_NUM)
 #define DT_MIPS_LOCAL_GOTNO_IDX	(DT_NUM + OS_NUM +1)
 #define DT_MIPS_LOCAL_GOTNO_IDX	(DT_NUM + OS_NUM +1)