svn commit: branches/uClibc-nptl: ldso/ldso ldso/libdl libc/misc/internals

sjhill at uclibc.org sjhill at uclibc.org
Tue Oct 4 00:42:16 UTC 2005


Author: sjhill
Date: 2005-10-03 17:42:09 -0700 (Mon, 03 Oct 2005)
New Revision: 11743

Log:
Bring in changes from trunk.


Modified:
   branches/uClibc-nptl/ldso/ldso/ldso.c
   branches/uClibc-nptl/ldso/libdl/libdl.c
   branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c


Changeset:
Modified: branches/uClibc-nptl/ldso/ldso/ldso.c
===================================================================
--- branches/uClibc-nptl/ldso/ldso/ldso.c	2005-10-04 00:33:54 UTC (rev 11742)
+++ branches/uClibc-nptl/ldso/ldso/ldso.c	2005-10-04 00:42:09 UTC (rev 11743)
@@ -777,14 +777,6 @@
 	if (_dl_symbol_tables)
 		goof += _dl_fixup(_dl_symbol_tables, unlazy);
 
-	for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
-		if (tpnt->relro_size)
-			_dl_protect_relro (tpnt);
-	}
-
-
-
-
 	/* OK, at this point things are pretty much ready to run.  Now we need
 	 * to touch up a few items that are required, and then we can let the
 	 * user application have at it.  Note that the dynamic linker itself
@@ -836,6 +828,11 @@
 		}
 	}
 
+	for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
+		if (tpnt->relro_size)
+			_dl_protect_relro (tpnt);
+	}
+
 	/* Find the real malloc function and make ldso functions use that from now on */
 	 _dl_malloc_function = (void* (*)(size_t)) (intptr_t) _dl_find_hash("malloc",
 			 _dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT);

Modified: branches/uClibc-nptl/ldso/libdl/libdl.c
===================================================================
--- branches/uClibc-nptl/ldso/libdl/libdl.c	2005-10-04 00:33:54 UTC (rev 11742)
+++ branches/uClibc-nptl/ldso/libdl/libdl.c	2005-10-04 00:42:09 UTC (rev 11743)
@@ -349,15 +349,6 @@
 	if (_dl_fixup(dyn_chain, now_flag))
 		goto oops;
 
-	if (relro_ptr) {
-		for (rpnt = relro_ptr->next; rpnt; rpnt = rpnt->next) {
-			if (rpnt->dyn->relro_size)
-				_dl_protect_relro(rpnt->dyn);
-		}
-	}
-	/* TODO:  Should we set the protections of all pages back to R/O now ? */
-
-
 	/* Notify the debugger we have added some objects. */
 	if (_dl_debug_addr) {
 		dl_brk = (void (*)(void)) _dl_debug_addr->r_brk;
@@ -389,6 +380,15 @@
 		}
 	}
 #endif
+
+	if (relro_ptr) {
+		for (rpnt = relro_ptr->next; rpnt; rpnt = rpnt->next) {
+			if (rpnt->dyn->relro_size)
+				_dl_protect_relro(rpnt->dyn);
+		}
+	}
+	/* TODO:  Should we set the protections of all pages back to R/O now ? */
+
 	_dl_unmap_cache();
 	return (void *) dyn_chain;
 

Modified: branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c
===================================================================
--- branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c	2005-10-04 00:33:54 UTC (rev 11742)
+++ branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c	2005-10-04 00:42:09 UTC (rev 11743)
@@ -30,9 +30,9 @@
 #include <stdint.h>
 
 /* for gcc-3.x + Etoh ssp */
-uintptr_t __guard /* segfaults with attribute_relro */;
+uintptr_t __guard attribute_relro;
 /* for gcc-4.1 non-TLS */
-uintptr_t __stack_chk_guard /* attribute_relro */;
+uintptr_t __stack_chk_guard attribute_relro;
 #endif
 
 /*
@@ -53,7 +53,6 @@
 
 
 
-
 /*
  * Declare the __environ global variable and create a weak alias environ.
  * Note: Apparently we must initialize __environ to ensure that the weak




More information about the uClibc-cvs mailing list