Another problem about dlsym with RTLD_NEXT

Yang Yingliang yangyingliang at huawei.com
Wed Sep 24 09:31:40 UTC 2014


Hi,

I encountered another problem, when I use dlsym with RTLD_NEXT.
There are different results between glibc and uclibc.

E.g.
$ cat test.c 
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>

int main(void)
{
	void *libaa = dlopen("./libaa.so", RTLD_LAZY);
	if (!libaa) {
		printf("open libaa.so failed\n");
		return 1;
	}

	printf("%p\n", dlsym(RTLD_NEXT, "aaSymbol"));
	dlclose(libaa);
	return 0;
}

With uclibc the result is:
$ CC -o test test.c -ldl
$ ./test
0xb6f2476c

But with glibc the result comes out:
$ CC -o test test.c -ldl
$ ./test
(nil)

Is it a bug or just different from glibc ?



More information about the uClibc mailing list