1752702 Members
5847 Online
108789 Solutions
New Discussion

_etext symbol

 
Sandip Ghayal
Occasional Advisor

_etext symbol

1. I have iPlanet server which allows to have external plug-in libraries.
2. I have created a plugin library called libjeas_httpd40.sl
3. This plugin library depends on other libraries for symbol resolution.
a. libjctssecct.sl
b. libjsybscl_r.sl
c. libjtml_r.sl (This used to be static library but for try I converted this library in to dynamic library)
d. some other libraries provided by iPlanet server which will be subsequently loaded by iPlanet server before loading my library
4. Libraries mentioned in point 3a and 3b are linked using aCC whereas library mentioned in point c is linked using ld
4. Libraries mentioned in point 3a and 3b also depends on libjtml_r.sl
5. libjtml_r.sl contains some defination for thread local storage and uses symbol _etext.
6. As libjtml_r.sl contains thread local storage and my plugin libraries depend on libraries mentioned in point 3d I used following procedure
to get around the problem of dynamic loading (shl_load cannot load libraries with thread local storage)
a. Don't link any libraries mentioned in point 3 to libjeas_httpd40.sl
b. Use LD_PRELOAD environment variable to load libjctssecct.sl and libjsybscl_r.sl
7. My assumption is using LD_PRELOAD will load all the libraries that depend on libjtml_r.sl when loading the binary. This will have two effects
a. I don't have to worry for resolving symbols for libjeas_httpd40.sl
b. I don't have to worry for loading libraries with thread local storage

Hope this clarifies the entire picture of what I am trying to do.

Now this is the error I am getting why I try to load the iPlanet server

/usr/lib/dld.sl: Unresolved symbol: _etext (data) from /testarea/iplanet/bin/https/lib/libjtml_r.sl
/usr/lib/dld.sl: Unresolved module for symbol: tml__profile_init (code) from /testarea/iplanet/bin/https/lib/libjtml_r.sl

Issues are
1. Why do I get unresolved symbol for _etext and how to resolve this issue
2. Why do I get unresolved symbol for tml__profile_init where as the code for it is
already defined in libjtml_r.sl. Refer below for the nm output for libjtml_r.sl

$ nm /testarea/iplanet/bin/https/lib/libjtml_r.sl | grep tml__profile_init
tml__profile_init | 38300|extern|entry |
tml__profile_init | 38396|extern|code |$CODE$
tml__profile_init | 46184|uext |stub |

Noticiable part is tml__profile_init comes from the same object file where _etext is used (and not defined. I have included crt0.h file for defination)



Any GURUS want to give this a shot. I don't have source for iplanet