[uClibc-cvs] uClibc/ldso/ldso ldso.c,1.75,1.76

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


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

Modified Files:
	ldso.c 
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: ldso.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/ldso.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- ldso.c	5 Dec 2003 20:24:26 -0000	1.75
+++ ldso.c	17 Dec 2003 08:05:40 -0000	1.76
@@ -287,7 +287,7 @@
   __asm__("\tbl _GLOBAL_OFFSET_TABLE_-4 at local\n\t":"=l"(got));
 #elif defined(__mips__)
   __asm__("\tmove %0, $28\n\tsubu %0,%0,0x7ff0\n\t":"=r"(got));
-#elif defined(__sh__)
+#elif defined(__sh__) && !defined(__SH5__)
   __asm__(
 "       mov.l    1f, %0\n"
 "       mova     1f, r0\n"
@@ -583,11 +583,13 @@
 				SEND_STDERR(strtab + symtab[symtab_index].st_name);
 				SEND_STDERR("\n");
 #endif  
+				PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr, &symtab[symtab_index]);
+			} else {
+				/*
+				 * Use this machine-specific macro to perform the actual relocation.
+				 */
+				PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr, NULL);
 			}
-			/*
-			 * Use this machine-specific macro to perform the actual relocation.
-			 */
-			PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr);
 		}
 	}
 




More information about the uClibc-cvs mailing list