Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot find ELF

0 views
Skip to first unread message

Anne M. Hammond

unread,
Jul 10, 2002, 4:25:42 PM7/10/02
to ham...@colorado.edu
This is with OpenSSH 3.4p1 which was compiled with gcc 3.0:

lcd 36% ssh
ssh: Cannot find ELF
Killed

There are numerous messages on the net about this problem with
other programs. So it's not specific to OpenSSH.

sshd is running fine.

lcd 34% printenv LD_LIBRARY_PATH
/usr/lib:/usr/local/lib:/opt/SUNWspro/lib

Any pointers very much appreciated.

Anne M. Hammond
University of Colorado at Boulder

Alan Coopersmith

unread,
Jul 10, 2002, 6:38:39 PM7/10/02
to
"Anne M. Hammond" <Anne.H...@Colorado.EDU> writes in comp.sys.sun.admin:

|lcd 36% ssh
|ssh: Cannot find ELF

What does "file `which ssh`" show?

--
________________________________________________________________________
Alan Coopersmith al...@alum.calberkeley.org
http://soar.Berkeley.EDU/~alanc/ aka: Alan.Coo...@Sun.COM
Working for, but definitely not speaking for, Sun Microsystems, Inc.

Tino Reinhardt

unread,
Jul 10, 2002, 7:59:29 PM7/10/02
to
Anne M. Hammond <Anne.H...@colorado.edu> wrote:
> This is with OpenSSH 3.4p1 which was compiled with gcc 3.0:

> lcd 36% ssh
> ssh: Cannot find ELF
> Killed

It might be Gnu strip going berserk.

Put /usr/ccs/bin/strip before Gnu strip in your $PATH
or replace stripprog="${STRIPPROG-strip}"
by stripprog=/usr/ccs/bin/strip in "install-sh" in your
OpenSSH-sources.

IIRC, running Gnu strip twice a time on your binary
fixed it too.

Anne M. Hammond

unread,
Jul 16, 2002, 6:38:16 PM7/16/02
to
Thanks Tino. The original file was compiled with gcc 3.0.

strip was Gnu strip:
lcd 11% which strip
/usr/local/bin/strip

I did make clean, and compiled using Sun's cc, and the error
message is gone.

But I'd like to discover what causes this. I'll compile
again and replace stripprog.

Anne

Andrew Mueller

unread,
Jul 19, 2002, 11:34:58 AM7/19/02
to
"Anne M. Hammond" <Anne.H...@Colorado.EDU> wrote in message news:<3D34A058...@Colorado.EDU>...

> Thanks Tino. The original file was compiled with gcc 3.0.
>
> I did make clean, and compiled using Sun's cc, and the error
> message is gone.

I love egcs, but given the choice I'd always use the Forte tools.
(extra tools like fpversion...)

-Andrew Mueller
http://www.synecdoche.net/~andy

Anne M. Hammond

unread,
Jul 19, 2002, 3:47:00 PM7/19/02
to
This is the result of gnu strip incorrectly stripping
parts of the object file (man strip) when the file had
been compiled with gcc and when using the Solaris loader.

Strip is used to save filesystem and memory space after
the object file has been tested and is ready for installation.
As you can see, the resultant file is about 20% the size of
the original:

-rwxr-xr-x 1 root 4359576 Jul 18 15:12 ./ssh
-rwxr-xr-x 1 root 933876 Jul 18 15:15 ssh (installed version)

To solve this problem of the executable not containing the
full information, use /usr/ccs/bin/strip instead of
/usr/local/bin/strip. Either setenv PATH so that /usr/ccs/bin
is first, or edit install-sh:
#stripprog="${STRIPPROG-strip}"
stripprog=/usr/ccs/bin/strip

You can diagnose this by running the ldd utility on the object
file in the compile directory, and on the installed directory:

lcd 255# ldd ./ssh
libz.so => /usr/local/lib/libz.so
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1

lcd 256# ldd /usr2/newssh/bin/ssh
ldd: /usr2/newssh/bin/ssh: file has insecure interpreter ELF

This is an ls of the object file in the compile directory, and
in the installion directory, when /usr/ccs/bin/strip is used.
/usr/ccs/bin/strip actually creates a smaller executable than
gnu's strip:

-rwxr-xr-x 1 root 4359576 Jul 18 15:12 ./ssh
-rwxr-xr-x 1 root 891380 Jul 19 12:57 /usr2/newssh/bin/ssh

LD_LIBRARY_PATH does not have anything to do with this problem.
There may be options to gnu's strip, but I haven't investigated
this.

Another fix is to run gnu strip twice on the object file.
I haven't tried this. Also since make install doesn't do this,
using /usr/ccs/bin/strip seems a better solution.

Thanks to Tino Reinhardt for solving this problem.

Anne Hammond

Anne M. Hammond

unread,
Jul 19, 2002, 3:52:46 PM7/19/02
to ham...@colorado.edu
This is the result of gnu strip incorrectly stripping
parts of the object file (man strip) when the file had
been compiled with gcc and when using the Solaris loader.

Strip is used to save filesystem and memory space after
the object file has been tested and is ready for installation.
As you can see, the resultant file is about 20% the size of
the original:

-rwxr-xr-x 1 root 4359576 Jul 18 15:12 ./ssh
-rwxr-xr-x 1 root 933876 Jul 18 15:15 ssh (installed version)

To solve this problem of the executable not containing the
full information, use /usr/ccs/bin/strip instead of
/usr/local/bin/strip. Either setenv PATH so that /usr/ccs/bin
is first, or edit install-sh:
#stripprog="${STRIPPROG-strip}"
stripprog=/usr/ccs/bin/strip

You can diagnose this by running the ldd utility on the object

file in the compile directory, and on the installed binary:

lcd 255# ldd ./ssh
libz.so => /usr/local/lib/libz.so
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1

lcd 256# ldd /usr2/newssh/bin/ssh
ldd: /usr2/newssh/bin/ssh: file has insecure interpreter ELF

Below is an ls of the object file in the compile directory, and


in the installion directory, when /usr/ccs/bin/strip is used.
/usr/ccs/bin/strip actually creates a smaller executable than
gnu's strip:

-rwxr-xr-x 1 root 4359576 Jul 18 15:12 ./ssh
-rwxr-xr-x 1 root 891380 Jul 19 12:57 /usr2/newssh/bin/ssh

LD_LIBRARY_PATH does not have anything to do with this problem.
There may be options to gnu's strip, but I haven't investigated
this.

Another fix is to run gnu strip twice on the object file.

I didn't try this. Since make install doesn't run strip twice,

Anne M. Hammond

unread,
Jul 19, 2002, 3:57:02 PM7/19/02
to ham...@colorado.edu

Anne M. Hammond

unread,
Jul 19, 2002, 4:04:07 PM7/19/02
to
Sorry for multiple messages!!! A new SMTP server
in netscape preferences gave error messages; so I thought
the message had not been sent. Apologies!
0 new messages