Operating System - Linux
1753743 Members
4920 Online
108799 Solutions
New Discussion юеВ

Re: shl_load ENOSYM error

 
SOLVED
Go to solution
Tom Dawson
Regular Advisor

shl_load ENOSYM error

Hi,

We are getting an ENOSYM error when we try to execute shl_load().

We are in the process of porting this application from 32 bit to 64 bit.
This piece of code works fine in our 32 bit environment.

This is the shl_load() command we fail on:

Lhandle = shl_load(/opt/cambar/object/libWHO700.sl, BIND_DEFERRED | DYNAMIC_PATH, 0);

This code is in a function in a library called libcsiunx.sl.
Both libraries are compiled for 64 bit:

may1cswdev /home/tdawson $ file /opt/cambar/object/libcsiunx.sl
/opt/cambar/object/libcsiunx.sl: ELF-64 shared object file - PA-RISC 2.0 (LP64)
may1cswdev /home/tdawson $ file /opt/cambar/object/libWHO700.sl
/opt/cambar/object/libWHO700.sl: ELF-64 shared object file - PA-RISC 2.0 (LP64)

And both libraries are owned by the same user and are readable
and executable by everybody:

may1cswdev /home/tdawson $ ls -l /opt/cambar/object/libcsiunx.sl
-rwxr-xr-x 1 cambar csw 76112 Nov 27 10:12 /opt/cambar/object/libcsiunx.sl
may1cswdev /home/tdawson $ ls -l /opt/cambar/object/libWHO700.sl
-rwxrwxrwx 1 cambar csw 75240 Sep 27 15:38 /opt/cambar/object/libWHO700.sl

The shl_load() command yields errno 215. This is the ENOSYM
entry from /usr/include/sys/errno.h:

#define ENOSYM 215 /* symbol does not exist in executable */

This has me confused because with this command we're not
searching for any symbol, we're just trying to load the
library into memory.

Can anyone shed some light on what the ENOSYM error really
means and how I can debug it further?

Thanks,
Tom
3 REPLIES 3
Dennis Handly
Acclaimed Contributor
Solution

Re: shl_load ENOSYM error

>This has me confused because with this command we're not searching for any symbol, we're just trying to load the library into memory.

When you load a shlib, you also will execute C++ static initializer and INIT functions. These would be causing your unsats. You should OR in BIND_VERBOSE to see what the problem symbol is.
Tom Dawson
Regular Advisor

Re: shl_load ENOSYM error

Dennis,

Thanks, but BIND_VERBOSE didn't really help. Only because the stdout gets lost amoung all of our library calls with this application.

But I took that idea and started redirecting stderr from the calling C program and finally found what I think is the "real" error.

The unsatisfied symbol appears to be '_mFldhandle'. This is a Micro Focus symbol. I've found an entry for this on their support site and it appears we have to re-work how we build our Shared Library(ies).

Thanks for the help,
Tom
Dennis Handly
Acclaimed Contributor

Re: shl_load ENOSYM error

Also if you change BIND_DEFERRED to BIND_IMMEDIATE (as a debugging tool) you'll see all possible undefined symbols.