- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- _mcount unresolved
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-21-2010 09:22 PM
тАО12-21-2010 09:22 PM
_mcount unresolved
We are building a shared library on HP 11.11 with aCC compiler. When we try use the .sl in our binary we get the below error message:
/usr/lib/dld.sl: Unresolved symbol: _mcount (code) from ../../XYX.sl
/usr/lib/dld.sl: Call to __sigenable() failed
/usr/lib/dld.sl: Not owner
This is the command we give to build the .sl:
aCC -b -mt -Wl,+s -Wl,+b,/usr/lib:. -lCsup -lCsup_v2 -lstd_v2 -lcaopenssl_crypto_stub -lcaopenssl_ssl_stub -lcapki_stub -lcurl -lpcre -llgr -lmesgparsing -lrusl -lhash -lifp -lutls -lbreg -lloc -ldlib -lireccrypt -lpcreposix -lGMSG -lGDBG -lENCK -lGLOG -lEncRpc -lmisc -lhash -lSIGN -lc
Please share your observations.
Thanks in advance
Bhanu
- Tags:
- unsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-21-2010 10:31 PM
тАО12-21-2010 10:31 PM
Re: _mcount unresolved
>aCC -b -mt -Wl,+b,/usr/lib:. -lCsup -lCsup_v2 -lstd_v2 -lc
Linking shlibs with -mt is now ignored.
You shouldn't link your shlib with -lc, this should be on the executable.
You can't link with both these shlibs: -lCsup -lCsup_v2
Remove the first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-21-2010 11:10 PM
тАО12-21-2010 11:10 PM
Re: _mcount unresolved
Thanks for the quick response. I made the changes as you suggested but the problem still exists. The other thing is that we are not linking the shlib from our application but we are using dlopen to access its functions.
This is how I compiled the shlib:
aCC -G -b -Wl,+s -Wl,+b,/usr/lib:. -lCsup_v2 -lstd_v2 -lcaopenssl_crypto_stub -lcaopenssl_ssl_stub -lcapki_stub -lcurl -lpcre -llgr -lmesgparsing -lrusl -lhash -lifp -lutls -lbreg -lloc -ldlib -lcawinHP -lireccrypt -lpcre -lpcreposix -lGMSG -lGDBG -lENCK -lGLOG -lEncRpc -lmisc -lhash -lSIGN
one more observation I made is that by using -lgprof32 option I am not getting the above errors but still the shlib fails to get loaded by the application.
Thanks
Bhanu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2010 12:27 AM
тАО12-22-2010 12:27 AM
Re: _mcount unresolved
(You didn't remove -G from the compile line.)
>This is how I compiled the shlib: aCC -G -b
Any reason you are using -G?
>-lCsup_v2 -lstd_v2
These are in the wrong order and they need to be last. See:
http://docs.hp.com/en/14672/Help/distributing.htm#linking
>one more observation I made is that by using -lgprof32 option I am not getting the above errors but still the shlib fails to get loaded by the application.
What's the error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2010 03:21 AM
тАО12-22-2010 03:21 AM
Re: _mcount unresolved
I have recompiled the shlib with the below options:
aCC -b -Wl,+s -Wl,+b,/usr/lib:. -lstd_v2 -lCsup_v2 -L"/usr/local/lib/" -o release.hpux/XYZ.sl
and tried to dlopen with the below code :
#include
#include
#include
int main(int argc, char **argv) {
void *handle;
double (*cosine)(double);
char *error;
handle = dlopen ("./XYZ.sl", RTLD_LAZY);
if (!handle) {
fputs (dlerror(), stderr);
exit(1);
}
/*func = dlsym(handle, "cos");
if ((error = dlerror()) != NULL) {
fputs(error, stderr);
exit(1);
}
printf ("%f\n", (*cosine)(2.0));
*/
dlclose(handle);
}
and I get the below error:
/usr/lib/dld.sl: Unresolved symbol: _mcount (code) from ./BABiSponsor11UX.sl
ABORT instruction (core dumped)
Please share your observations:
Ths os and comapiler versions are:HP-UX bso-sdhp B.11.23 U 9000/800 and aCC: HP ANSI C++ B3910B A.03.90
Thanks
Bhanu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2010 03:37 AM
тАО12-22-2010 03:37 AM
Re: _mcount unresolved
As I mentioned, these must be the very last aC++ shlibs on the link line.
>dld.sl: Unresolved symbol: _mcount (code) from ./BABiSponsor11UX.sl
You need to rebuild this shlib without -G. Or possibly add -lgprof to it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2010 03:47 AM
тАО12-22-2010 03:47 AM
Re: _mcount unresolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-22-2010 04:10 AM
тАО12-22-2010 04:10 AM
Re: _mcount unresolved
Then what is your current problem/error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2010 03:18 AM
тАО12-23-2010 03:18 AM
Re: _mcount unresolved
I have tried it once more today , but no luck. I tried compiling the shlib with the below options :
aCC -b -Wl,+s -Wl,+b,/usr/lib:. -L"/usr/local/lib/" -o release.hpux/XYZ.sl -lcaopenssl_crypto_stub -lcaopenssl_ssl_stub -lcapki_stub -lcurl -lpcre -llgr -lmesgparsing -lrusl -lhash -lifp -lutls -lbreg -lloc -ldlib -lireccrypt -lpcreposix -lGMSG -lGDBG -lENCK -lGLOG -lEncRpc -lmisc -lhash -lSIGN -lstd_v2 -lCsup_v2 -lgprof32 -lpthread
Changes i made:
1) added -lgprof32 and removed -G
2) added -lpthread as there was a "Can't dlopen() a library containing Thread Local Storage: /usr/lib/libpthread.1" error
3) Removed -lCsup since -lCsup_v2 is present in the link line and placed "-lstd_v2 -lCsup_v2" at the end of the link line.
Every time i try to load the shlib with the application, I get one consistent error i.e
/usr/lib/dld.sl: Unresolved symbol: _mcount (code) from ./XYZ.sl
ABORT instruction (core dumped)
Please suggest your changes...
Thanks
Bhanu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2010 03:38 AM
тАО12-23-2010 03:38 AM
Re: _mcount unresolved
You shouldn't add -lpthread to shlibs.
(Are you sure it isn't just -lgprof?)
>1) added -lgprof32 and removed -G
Have you recompiled any archive or shlib that you previously compiled with -G?
You can find these with:
-Wl,-y_mcount
>2) added -lpthread as there was a "Can't dlopen() a library containing Thread Local Storage: /usr/lib/libpthread.1" error
You need to add -lpthread to your executable, not your shlib. In fact, why are you adding it at all?
>I get one consistent error i.e
>Unresolved symbol: _mcount (code) from ./XYZ.sl
You need to hunt down that object and recompile it.