I have taken the patch provided for the issue "do_lookup_x may access dangling memory" fixed in bugzilla http://sourceware.org/bugzilla/show_bug.cgi?id=13579 With this patch crash issue of "do_lookup_x may access dangling memory" gets solved but I am getting one more new issue on my MIPS target. error : ./libjpeg.so: cannot enable executable stack as shared object requires: Invalid argument. -------------------------------------------------------------- cat test.c #include <stdio.h> #include <dlfcn.h> #include <pthread.h> void *handle; static void *thread_abc() { handle = dlopen ("./libjpeg.so", RTLD_LAZY | RTLD_GLOBAL); printf ("<thread_abc> Handle:%p\n", handle); dlclose (handle); return NULL; } static void *thread_xyz() { handle = dlopen ("./libjpeg.so", RTLD_LAZY | RTLD_GLOBAL); printf ("<thread_abc> Handle:%p\n", handle); dlclose (handle); return NULL; } int main() { int i=0; handle = dlopen ("./libjpeg.so", RTLD_LAZY | RTLD_GLOBAL); printf ("<thread_abc> Handle:%p\n", handle); if((error=dlerror()) != NULL) printf("error : %s\n", error); if(handle==NULL) return 0; printf ("<thread_abc> Handle:%p\n", handle); dlclose (handle); printf ("Returning from main\n"); return 0; } ------------------------------------------------- When I check my libjpeg.so with readelf it didn't have any STACK frame $ mipsel-34kv3r1-linux-gnu-readelf -l libjpeg.so | grep "STACK" $ Furthermore, I checked that if I removed the patch for BUG 13579, then this issue is not occurring.
Issue fixed. After applying patch for BUG 13579, I have only replace ld and libc library on my target and thus this was causing issue. After I have replaced library libpthread.so also, then no issue occurs.