[uClibc-cvs] svn commit: trunk/uClibc/ldso/ldso

jocke at uclibc.org jocke at uclibc.org
Mon Mar 14 16:53:10 UTC 2005


Author: jocke
Date: 2005-03-14 09:53:09 -0700 (Mon, 14 Mar 2005)
New Revision: 10000

Log:
Simplify PT_INTERP handling.
Add prototype for _dl_boot() 


Modified:
   trunk/uClibc/ldso/ldso/ldso.c


Changeset:
Modified: trunk/uClibc/ldso/ldso/ldso.c
===================================================================
--- trunk/uClibc/ldso/ldso/ldso.c	2005-03-14 13:25:07 UTC (rev 9999)
+++ trunk/uClibc/ldso/ldso/ldso.c	2005-03-14 16:53:09 UTC (rev 10000)
@@ -58,6 +58,7 @@
 int   _dl_debug_file      = 2;
 #endif
 
+extern attribute_hidden void _dl_boot(void);
 #include "dl-startup.c"
 /* Forward function declarations */
 static int _dl_suid_ok(void);
@@ -261,38 +262,18 @@
 
 		/* OK, fill this in - we did not have this before */
 		if (ppnt->p_type == PT_INTERP) {
-			int readsize = 0;
-			char *pnt, *pnt1, buf[1024];
+			char *ptmp;
 
-			tpnt->libname = _dl_strdup((char *) ppnt->p_offset +
-					(auxvt[AT_PHDR].a_un.a_val & PAGE_ALIGN));
+			tpnt->libname = (char *) ppnt->p_vaddr + app_tpnt->loadaddr;
 
-			/* Determine if the shared lib loader is a symlink */
-			_dl_memset(buf, 0, sizeof(buf));
-			readsize = _dl_readlink(tpnt->libname, buf, sizeof(buf));
-			if (readsize > 0 && readsize < (int)(sizeof(buf)-1)) {
-				pnt1 = _dl_strrchr(buf, '/');
-				if (pnt1 && buf != pnt1) {
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-					_dl_dprintf(_dl_debug_file,
-						    "changing tpnt->libname from '%s' to '%s'\n",
-						    tpnt->libname, buf);
-#endif
-					tpnt->libname = _dl_strdup(buf);
-				}
-			}
-
 			/* Store the path where the shared lib loader was found
 			 * for later use
 			 */
-			pnt = _dl_strdup(tpnt->libname);
-			pnt1 = _dl_strrchr(pnt, '/');
-			if (pnt != pnt1) {
-				*pnt1 = '\0';
-				_dl_ldsopath = pnt;
-			} else {
-				_dl_ldsopath = tpnt->libname;
-			}
+			_dl_ldsopath = _dl_strdup(tpnt->libname);
+			ptmp = _dl_strrchr(_dl_ldsopath, '/');
+			if (ptmp != _dl_ldsopath)
+				*ptmp = '\0';
+
 #ifdef __SUPPORT_LD_DEBUG_EARLY__
 			_dl_dprintf(_dl_debug_file, "Lib Loader:\t(%x) %s\n",
 				    tpnt->loadaddr, tpnt->libname);




More information about the uClibc-cvs mailing list