[git commit] mips/libdl: Apply relocations after appending the new scope

Khem Raj raj.khem at gmail.com
Tue Jan 24 00:10:21 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=bee3ea0f5a8d2cc2cfaeebdc4ef65f2d6b30b749
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Without this the relocations for the current shared object
are not resolved since the scope is not added to map yet

Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 ldso/libdl/libdl.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index bc3ef8a..32afe1c 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -543,6 +543,12 @@ static void *do_dlopen(const char *libname, int flag)
 	 * Now we go through and look for REL and RELA records that indicate fixups
 	 * to the GOT tables.  We need to do this in reverse order so that COPY
 	 * directives work correctly */
+
+	/* Get the tail of the list */
+	for (ls = &_dl_loaded_modules->symbol_scope; ls && ls->next; ls = ls->next);
+
+	/* Extend the global scope by adding the local scope of the dlopened DSO. */
+	ls->next = &dyn_chain->dyn->symbol_scope;
 #ifdef __mips__
 	/*
 	 * Relocation of the GOT entries for MIPS have to be done
@@ -550,11 +556,6 @@ static void *do_dlopen(const char *libname, int flag)
 	 */
 	_dl_perform_mips_global_got_relocations(tpnt, !now_flag);
 #endif
-	/* Get the tail of the list */
-	for (ls = &_dl_loaded_modules->symbol_scope; ls && ls->next; ls = ls->next);
-
-	/* Extend the global scope by adding the local scope of the dlopened DSO. */
-	ls->next = &dyn_chain->dyn->symbol_scope;
 
 	if (_dl_fixup(dyn_chain, &_dl_loaded_modules->symbol_scope, now_flag))
 		goto oops;


More information about the uClibc-cvs mailing list