Discussion:
dlopen failed: wrong ELF class: ELFCLASS64
Kiran Das
2011-01-06 10:03:53 UTC
Permalink
Hi all,

I have not been able to resolve this even with efforts from Mr Google
and am wondering whether anyone can offer help/advice.

Only just today I installed version 5.6.1 thinking of monitoring the
tempreture. I had an older version which was working with FMD. But
after installing this new version, even FMD traps are not working.

I am cracking my head to figure out why was it working before and not now.
I know the error below is related to 32 or 64 bit. My server is running 64 bit.

***@server1: # isainfo -b
64

***@server1: # /usr/local/sbin/snmpd -f -L
dlopen failed: ld.so.1: snmpd: fatal:
/usr/sfw/lib/sparcv9/libseaProxy.so: wrong ELF class: ELFCLASS64
dlopen failed: ld.so.1: snmpd: fatal:
/usr/sfw/lib/sparcv9/libseaExtensions.so: wrong ELF class: ELFCLASS64
dlopen failed: ld.so.1: snmpd: fatal:
/usr/lib/fm/sparcv9/libfmd_snmp.so.1: wrong ELF class: ELFCLASS64
NET-SNMP version 5.6.1
Mike Brodbelt
2011-01-06 15:19:27 UTC
Permalink
Post by Kiran Das
/usr/sfw/lib/sparcv9/libseaProxy.so: wrong ELF class: ELFCLASS64
/usr/sfw/lib/sparcv9/libseaExtensions.so: wrong ELF class: ELFCLASS64
/usr/lib/fm/sparcv9/libfmd_snmp.so.1: wrong ELF class: ELFCLASS64
NET-SNMP version 5.6.1
When you built net-snmp, looks like you've compiled a 32 bit binary,
which your dynamic linker is now trying to link to a 64 bit library at
startup.

The following will help confirm if this is the case:-

# file /usr/local/sbin/snmpd
# objdump -x /usr/local/sbin/snmpd | grep -i path

I suspect you'll see you have a ELF 32-bit MSB executable with the RPATH
set to your 64 bit libraries - though the library path could be coming
from elsewhere.


Your best fix is probably going to be to recompile your binaries as
64-bit, with a specified linker path. Do something like:-

export CFLAGS="-O3 -m64 -mcpu=v9 -Wa,-xarch=v9b"
export LDFLAGS="-L/usr/sfw/lib/sparcv9 -R/usr/sfw/lib/sparcv9
-L/usr/lib/fm/sparcv9 -R/usr/lib/fm/sparcv9"

./configure ........

make
make install

As a second option, you could just use your existing 32-bit binaries and
force use of the 32 bit libs somehow - either via crle, LD_LIBRARY_PATH,
or changing the embedded RPATH with objcopy, which I believe can do this.

ISTR that you'll be better going the 64-bit route on Solaris though,
particularly if you want the larger network counters and so forth. I'm a
bit rusty though - not had to self build this stuff on Solaris since the
5.4 days.

HTH,

Mike

Loading...