From a5ebab17668503a0887dfcace6904d86de8b1d8f Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Wed, 17 Nov 2004 09:36:40 +0000 Subject: Add BIND NOW support to MIPS. Mips did not honour the LD_BIND_NOW env. variable or the DT_BIND_NOW flag in the dynamic section. --- ldso/libdl/libdl.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'ldso/libdl/libdl.c') diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 5a4bb0dce..271b3550f 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -61,7 +61,7 @@ int _dl_map_cache(void) __attribute__ ((__weak__)); int _dl_unmap_cache(void) __attribute__ ((__weak__)); #endif #ifdef __mips__ -extern void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt) +extern void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy) __attribute__ ((__weak__)); #endif #ifdef __SUPPORT_LD_DEBUG__ @@ -299,13 +299,6 @@ void *dlopen(const char *libname, int flag) * further needs to be done. */ return (void *) dyn_chain; } -#ifdef __mips__ - /* - * Relocation of the GOT entries for MIPS have to be done - * after all the libraries have been loaded. - */ - _dl_perform_mips_global_got_relocations(tpnt); -#endif #ifdef __SUPPORT_LD_DEBUG__ if(_dl_debug) @@ -319,6 +312,15 @@ void *dlopen(const char *libname, int flag) now_flag = (flag & RTLD_NOW) ? RTLD_NOW : 0; if (getenv("LD_BIND_NOW")) now_flag = RTLD_NOW; + +#ifdef __mips__ + /* + * Relocation of the GOT entries for MIPS have to be done + * after all the libraries have been loaded. + */ + _dl_perform_mips_global_got_relocations(tpnt, !now_flag); +#endif + if (_dl_fixup(dyn_chain, now_flag)) goto oops; -- cgit v1.2.3