From feefb2252ef7ae7c06c041d63727e5039cec2edc Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Mon, 3 Oct 2005 17:25:28 +0000 Subject: Move _dl_protect_relro after INIT to allow using attribute_relro within uClibc_init --- ldso/ldso/ldso.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'ldso') diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 196828ec1..3b678588f 100644 --- a/ldso/ldso/ldso.c +++ b/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); -- cgit v1.2.3