[uClibc-cvs] uClibc/ldso/ldso/i386 ld_sysdep.h,1.8,1.9

Erik Andersen andersen at uclibc.org
Wed Dec 17 08:05:43 UTC 2003


Update of /var/cvs/uClibc/ldso/ldso/i386
In directory nail:/tmp/cvs-serv23304/ldso/ldso/i386

Modified Files:
	ld_sysdep.h 
Log Message:
Patch from Paul Mundt <lethal at linux-sh.org>:

For sh64 we need implicit access to the symtab, primarily to get at the
->st_other value. This presently isn't possible, as PERFORM_BOOTSTRAP_RELOC()
is invoked as such:

        PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr);

while we can easily get the symtab_index value from rpnt->r_info, this still
doesn't buy us easy access to the actual table. As such, I've modified
PERFORM_BOOTSTRAP_RELOC() to take an additional SYMTAB argument. Most
architectures aren't going to care about this, but unfortunately we don't
have any other options for sh64.

The following patch fixes up the API for what we need for sh64, and updates
the other architectures appropriately.



Index: ld_sysdep.h
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/i386/ld_sysdep.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ld_sysdep.h	28 May 2002 21:33:32 -0000	1.8
+++ ld_sysdep.h	17 Dec 2003 08:05:41 -0000	1.9
@@ -18,11 +18,11 @@
 /*
  * Initialization sequence for a GOT.
  */
-#define INIT_GOT(GOT_BASE,MODULE) \
-{				\
-  GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
-  GOT_BASE[1] = (unsigned long) MODULE; \
-}
+#define INIT_GOT(GOT_BASE,MODULE)				\
+do {								\
+  GOT_BASE[2] = (unsigned long) _dl_linux_resolve;		\
+  GOT_BASE[1] = (unsigned long) MODULE;				\
+} while(0)
 
 /*
  * Here is a macro to perform a relocation.  This is only used when
@@ -31,23 +31,23 @@
  * SYMBOL is the symbol involved in the relocation, and LOAD is the
  * load address.
  */
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD) \
-	switch(ELF32_R_TYPE((RELP)->r_info)){		\
-	case R_386_32:		\
-	  *REL += SYMBOL;		\
-	  break;		\
-	case R_386_PC32:		\
-	  *REL += SYMBOL - (unsigned long) REL;		\
-	  break;		\
-	case R_386_GLOB_DAT:		\
-	case R_386_JMP_SLOT:		\
-	  *REL = SYMBOL;		\
-	  break;		\
-	case R_386_RELATIVE:		\
-	  *REL += (unsigned long) LOAD;		\
-	  break;		\
-	default:		\
-	  _dl_exit(1);		\
+#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB)	\
+	switch(ELF32_R_TYPE((RELP)->r_info)){			\
+	case R_386_32:						\
+	  *REL += SYMBOL;					\
+	  break;						\
+	case R_386_PC32:					\
+	  *REL += SYMBOL - (unsigned long) REL;			\
+	  break;						\
+	case R_386_GLOB_DAT:					\
+	case R_386_JMP_SLOT:					\
+	  *REL = SYMBOL;					\
+	  break;						\
+	case R_386_RELATIVE:					\
+	  *REL += (unsigned long) LOAD;				\
+	  break;						\
+	default:						\
+	  _dl_exit(1);						\
 	}
 
 
@@ -56,9 +56,9 @@
  * is done.  This routine has to exit the current function, then 
  * call the _dl_elf_main function.
  */
-#define START()		\
-	__asm__ volatile ("leave\n\t" \
-		    "jmp *%%eax\n\t"	\
+#define START()							\
+	__asm__ volatile ("leave\n\t"				\
+		    "jmp *%%eax\n\t"				\
 		    : "=a" (status) :	"a" (_dl_elf_main))
 
 




More information about the uClibc-cvs mailing list