Hi all,

[ please CC me on replies ]

I'm part time fixing some bugs in Nexenta, and I have for a second time hit the bug, where library libA.so has been linked against some other shared library libB.so and some symbols were incorrectly resolved to be at absolute address 0x0. Note that I'm talking about symbols representing regular functions like pthread_create, dlopen, ...

Some recent examples of this bug can be found in the bug reports:

http://www.gnusolaris.org/cgi-bin/trac.cgi/ticket/409
http://www.gnusolaris.org/cgi-bin/trac.cgi/ticket/347

This most probably happens due to a bug in GNU ld, that, given a certain wrong set of commandline switches resolves the symbols incorrectly, and leads to application crash when the resolved symbol is first used (plain old segfault while jumping to 0x0 address).

While investigating this, I could see that on Solaris, some symbols in some libraries are deliberately put at the address 0x0, and since this happens in libraries like libc.so, libpthread.so, I don't believe it is a bug.

I'm just curious why this happens, what these symbols mean, and what are they used for. Seems that GNU ld is picking them up in situations where it shouldn't be, and I would like to reproduce a test case where ld can deliberately exhibit this bug.

thanx,
Martin

P.S. an excerpt of
$ nm -D libc.so | grep '00000000 A'
...
00000000 A dladdr
00000000 A dladdr1
00000000 A dlclose
00000000 A dldump
00000000 A dlerror
00000000 A dlinfo
00000000 A dlmopen
00000000 A dlopen
00000000 A dlsym
00000000 A frexp
00000000 A isnan
00000000 A isnand
00000000 A isnanf
00000000 A ldexp
00000000 A logb
00000000 A modf
00000000 A modff
...

--
http://martinman.net
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to