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

vapier at uclibc.org vapier at uclibc.org
Sat Jun 25 08:41:39 UTC 2005


Author: vapier
Date: 2005-06-25 02:41:38 -0600 (Sat, 25 Jun 2005)
New Revision: 10592

Log:
create some DEBUG macros for the ld debug early

Modified:
   trunk/uClibc/ldso/include/dl-string.h
   trunk/uClibc/ldso/ldso/dl-startup.c


Changeset:
Modified: trunk/uClibc/ldso/include/dl-string.h
===================================================================
--- trunk/uClibc/ldso/include/dl-string.h	2005-06-25 08:34:42 UTC (rev 10591)
+++ trunk/uClibc/ldso/include/dl-string.h	2005-06-25 08:41:38 UTC (rev 10592)
@@ -282,7 +282,7 @@
 	const char *tmp1 = (X); \
 	CONSTANT_STRING_GOT_FIXUP(tmp1); \
 	_dl_write(2, tmp1, _dl_strlen(tmp1)); \
-};
+}
 
 #define SEND_ADDRESS_STDERR(ADR, add_a_newline) \
 { \
@@ -321,4 +321,12 @@
 }
 #endif
 
+#ifdef __SUPPORT_LD_DEBUG_EARLY__
+# define SEND_STDERR_DEBUG(X) SEND_STDERR(X)
+# define SEND_ADDRESS_STDERR_DEBUG(X, add_a_newline) SEND_ADDRESS_STDERR(X, add_a_newline)
+#else
+# define SEND_STDERR_DEBUG(X)
+# define SEND_ADDRESS_STDERR_DEBUG(X, add_a_newline)
 #endif
+
+#endif

Modified: trunk/uClibc/ldso/ldso/dl-startup.c
===================================================================
--- trunk/uClibc/ldso/ldso/dl-startup.c	2005-06-25 08:34:42 UTC (rev 10591)
+++ trunk/uClibc/ldso/ldso/dl-startup.c	2005-06-25 08:41:38 UTC (rev 10592)
@@ -177,10 +177,8 @@
 		SEND_STDERR("Invalid ELF header\n");
 		_dl_exit(0);
 	}
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-	SEND_STDERR("ELF header=");
-	SEND_ADDRESS_STDERR(load_addr, 1);
-#endif
+	SEND_STDERR_DEBUG("ELF header=");
+	SEND_ADDRESS_STDERR_DEBUG(load_addr, 1);
 
 
 	/* Locate the global offset table.  Since this code must be PIC
@@ -189,17 +187,13 @@
 	 * we can always read stuff out of the ELF file to find it... */
 	got = elf_machine_dynamic();
 	dpnt = (Elf32_Dyn *) (got + load_addr);
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-	SEND_STDERR("First Dynamic section entry=");
-	SEND_ADDRESS_STDERR(dpnt, 1);
-#endif
+	SEND_STDERR_DEBUG("First Dynamic section entry=");
+	SEND_ADDRESS_STDERR_DEBUG(dpnt, 1);
 	_dl_memset(tpnt, 0, sizeof(struct elf_resolve));
 	tpnt->loadaddr = load_addr;
 	/* OK, that was easy.  Next scan the DYNAMIC section of the image.
 	   We are only doing ourself right now - we will have to do the rest later */
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-	SEND_STDERR("scanning DYNAMIC section\n");
-#endif
+	SEND_STDERR_DEBUG("scanning DYNAMIC section\n");
 	tpnt->dynamic_addr = dpnt;
 #if defined(__mips__) || defined(__cris__)
 	/* Some architectures cannot call functions here, must inline */
@@ -208,15 +202,11 @@
 	_dl_parse_dynamic_info(dpnt, tpnt->dynamic_info, NULL, load_addr);
 #endif
 
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-	SEND_STDERR("done scanning DYNAMIC section\n");
-#endif
+	SEND_STDERR_DEBUG("done scanning DYNAMIC section\n");
 
 #if defined(__mips__)
 
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-	SEND_STDERR("About to do specific GOT bootstrap\n");
-#endif
+	SEND_STDERR_DEBUG("About to do specific GOT bootstrap\n");
 	/* For MIPS we have to do stuff to the GOT before we do relocations.  */
 	PERFORM_BOOTSTRAP_GOT(tpnt);
 
@@ -224,9 +214,7 @@
 
 	/* OK, now do the relocations.  We do not do a lazy binding here, so
 	   that once we are done, we have considerably more flexibility. */
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-	SEND_STDERR("About to do library loader relocations\n");
-#endif
+	SEND_STDERR_DEBUG("About to do library loader relocations\n");
 
 	{
 		int goof, indx;
@@ -279,11 +267,9 @@
 					sym = &symtab[symtab_index];
 					symbol_addr = load_addr + sym->st_value;
 
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-					SEND_STDERR("relocating symbol: ");
-					SEND_STDERR(strtab + sym->st_name);
-					SEND_STDERR("\n");
-#endif
+					SEND_STDERR_DEBUG("relocating symbol: ");
+					SEND_STDERR_DEBUG(strtab + sym->st_name);
+					SEND_STDERR_DEBUG("\n");
 				}
 				/* Use this machine-specific macro to perform the actual relocation.  */
 				PERFORM_BOOTSTRAP_RELOC(rpnt, reloc_addr, symbol_addr, load_addr, sym);
@@ -296,11 +282,9 @@
 	}
 #endif
 
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
 	/* Wahoo!!! */
-	SEND_STDERR("Done relocating library loader, so we can now\n"
+	SEND_STDERR_DEBUG("Done relocating library loader, so we can now\n"
 			"\tuse globals and make function calls!\n");
-#endif
 
 	/* Now we have done the mandatory linking of some things.  We are now
 	   free to start using global variables, since these things have all been
@@ -310,10 +294,7 @@
 
 
 	/* Transfer control to the application.  */
-#ifdef __SUPPORT_LD_DEBUG_EARLY__
-	SEND_STDERR("transfering control to application\n");
-#endif
+	SEND_STDERR_DEBUG("transfering control to application\n");
 	_dl_elf_main = (int (*)(int, char **, char **)) auxvt[AT_ENTRY].a_un.a_fcn;
 	START();
 }
-




More information about the uClibc-cvs mailing list