OK, I believe I've fixed this in src/libexec/rtld-elf/rtld.c
revision 1.4. It now does what the documentation says it does.
returns a handle which, if passed to dlsym(), will cause the main
executable and all of its needed shared objects to be searched for
will search for the symbol in the caller's shared object. N.B.,
that's the caller's shared object _only_. It doesn't include any
needed shared objects.
Also, your particular test case of trying to look up "main" still
isn't going to work. The reason is that ELF doesn't put "main" into
the dynamic symbol table, because it's not needed there. If you are
looking up symbols defined in shared libraries or called from shared
libraries, it should work fine. But symbols in the main executable
that don't meet those criteria probably won't be found.
There is a linker option "-E" that puts all global symbols into the
dynamic symbol table. That will cause it to do what you want. But
of course you have to specify it when you're building the program
John Polstra jd...@polstra.com
John D. Polstra & Co., Inc. Seattle, Washington USA
"Self-knowledge is always bad news." -- John Barth
To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message