Re: dlopen failed: wrong ELF class: ELFCLASS64

Mike Brodbelt <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 06/01/11 10:03, Kiran Das wrote:

> root@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

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

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.