Browse Source

Move _dl_protect_relro after INIT to allow using attribute_relro within uClibc_init

Peter S. Mazinger 19 years ago
parent
commit
feefb2252e
1 changed files with 5 additions and 8 deletions
  1. 5 8
      ldso/ldso/ldso.c

+ 5 - 8
ldso/ldso/ldso.c

@@ -705,14 +705,6 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
 	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
@@ -764,6 +756,11 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
 		}
 	}
 
+	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);