LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-30-2006, 06:58 AM   #1
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Rep: Reputation: 31
Exclamation bad ELF interpreter


Hello,

I have an binary file which is working on Ubuntu 5.10 Breezy Linux... But when I copy that to my web server which runs CentOS 3.4 and execute that, I get an error message :

Code:
-bash: ./myappbinary: /usr/libexec/ld-elf.so.1: bad ELF interpreter: No such fil
e or directory
I have made sure that binary file is correctly transmitted and have correct permission, (i.e 755)

I have checked and there isn't any file named ld-elf in libexec directory.

Any guess, how I can get this binary running on CentOS ?

Thanks, Kirtimaan.

Last edited by kirtimaan_bkn; 06-30-2006 at 07:00 AM.
 
Old 06-30-2006, 08:45 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
My system (SuSE 64) has neither the ld-elf.so file or the /usr/libexec/ directory. The systems are too different at the binary level. Either install the same program from a CentOS package, or compile on the CentOS machine.
 
Old 06-30-2006, 08:25 PM   #3
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Original Poster
Rep: Reputation: 31
thanks jschiwal,

Problem is that I don't have code of that application. This is a compiled application. Which is running fine on RHL9 and Ubuntu. I have also a BSD port of this application which is an compiled binary as well. I tried running that binary and got the message :

can not execute the binary file.


So, the only option is the Linux binary which is not running even. I need to run this binary file on CentOS w/o recompiling.


Thanks, Kirtimaan
 
Old 06-30-2006, 09:17 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
First check what the dependencies are for the program. Perhaps they can be installed. Does CentOS have the /usr/libexec/ld-elf.so.1 file. Perhaps you just have a newer version. Also check that were you installed the binary has execution rights and check the ownership and permission of the files. Also try "locate ld-elf.so". It could be that the real file exists in /usr/libexec/ld-elf.so.1 and you can link to it. ( However it is more likely the other way around ).

Use the rpm command to locate if any package supplies ld-elf.so.1: "rpm -q --all | grep ld-elf.so"
The same can be done for uninstalled packages using the -p option, but you may need to limit your search to reduce the size of the argument list.

I searched on rpm.pbone.net and there was no package found supplying ld-elf.so.1 for CentOS.

First of all, do the computer archetecures match between systems. If so, you might copying the ls-elf.so.1 library from your old system. This could cause a crash however. Also look at "ldd /path/to/program" to see which other library files that the binary uses. It may use others that you don't have.

How did you install the program originally. What is the program? Myappbinary sounds like a program you wrote and compiled yourself. ( Or a program with a very stupid name. )
 
Old 07-01-2006, 01:09 AM   #5
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Original Poster
Rep: Reputation: 31
thanks for your reply.
Quote:
First check what the dependencies are for the program. Perhaps they can be installed. Does CentOS have the /usr/libexec/ld-elf.so.1 file. Perhaps you just have a newer version. Also check that were you installed the binary has execution rights and check the ownership and permission of the files. Also try "locate ld-elf.so". It could be that the real file exists in /usr/libexec/ld-elf.so.1 and you can link to it. ( However it is more likely the other way around ).
CentOS which is installed on my server don't have ld-elf.so.1 file.
My binary file correct permissions (i.e. 755) and the I am running that as root.

"locate ld-elf.so" gives no result.
Quote:
Use the rpm command to locate if any package supplies ld-elf.so.1: "rpm -q --all | grep ld-elf.so"
The same can be done for uninstalled packages using the -p option, but you may need to limit your search to reduce the size of the argument list.
No results.

Quote:
First of all, do the computer archetecures match between systems. If so, you might copying the ls-elf.so.1 library from your old system. This could cause a crash however. Also look at "ldd /path/to/program" to see which other library files that the binary uses. It may use others that you don't have.
Even in my ubuntu system, there isn't any file named ls-elf.so* but the binary executing well. When I execute 'ldd myappbinary' it gives message "not a dynamic executable".

Quote:
How did you install the program originally. What is the program? Myappbinary sounds like a program you wrote and compiled yourself. ( Or a program with a very stupid name. )
I purchased the binary of application from a vendor. Actually, now the vendor is no more supporting the product. Application name Myappbinary is given by me. As I have copied 3-4 different binary there of same app. ( all the versions which have for that app...) and all giving same error.

This is a CC verification app.

As I don't have code, I can't recompile it! Any Idea

Thanks, Kirtimaan
 
Old 07-01-2006, 01:47 AM   #6
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You have three choices. One complain to the vendor. Two write the program yourself. Three install ELF utilities on the server. Though the kernel have to have ELF support.
 
Old 07-01-2006, 04:40 AM   #7
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Original Poster
Rep: Reputation: 31
Hello Electro,

In these three options, I can go with only third one for now.
Quote:
Three install ELF utilities on the server. Though the kernel have to have ELF support
Can you tell me how I can install ELF utilities on the server. What are the packages required for that. also, how I can check the kernel for having ELF support and what if kernel don't have ?

Thanks, Kirtimaan
 
Old 07-02-2006, 04:39 AM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Linux uses elf libraries by default. As far as I know, programs are loaded by the "ld-linux.so" library and not a "ld-elf" program. I believe that ld-elf.so is used to load programs when you use a BSD based system.

That is why you don't have the ld-elf library. Perhaps if you created a symbolic link from ld-elf.so.1 to your ld-linux.so loader, you might be able to run the program.
 
Old 07-02-2006, 06:51 PM   #9
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Original Poster
Rep: Reputation: 31
Thanks jschiwal,

I will try your suggestion and post the result here today.

Thanks, Kirtimaan.
 
Old 07-03-2006, 04:33 AM   #10
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Original Poster
Rep: Reputation: 31
Hello jschiwal,


Quote:
Linux uses elf libraries by default. As far as I know, programs are loaded by the "ld-linux.so" library and not a "ld-elf" program. I believe that ld-elf.so is used to load programs when you use a BSD based system.

That is why you don't have the ld-elf library. Perhaps if you created a symbolic link from ld-elf.so.1 to your ld-linux.so loader, you might be able to run the program.
Now, getting following error :

Code:
root@lserver:/# ./myAppBinary
./myAppBinary: error while loading shared libraries: libc.so.4: cannot open shared object file: No such file or directory
running ldd for dependency, I get following message.

Code:
root@lserver:/# ldd myAppBinary
        not a dynamic executable
Any idea ?

Thanks, Kirtimaan

Last edited by kirtimaan_bkn; 07-03-2006 at 04:36 AM.
 
Old 07-04-2006, 07:27 AM   #11
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Original Poster
Rep: Reputation: 31
Hello jschiwal,

Just want to notify that, I had copied ld-linux.so to ld-elf.so.1 (instead of creating symbolic link).

Thanks, Kirtimaan
 
Old 07-04-2006, 03:41 PM   #12
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I think that you are trying to run a program compiled for a bsd unix on a Linux machine. The error message is telling you that you need libc.so.4 installed. You probably have libc.so.6. The program was built with an old glibc version. You might see if you can install an older package for RedHat, try looking in rpm.pbone.net, but if your package system says it can't due to conflicts with your current glibc installation, then don't force it. That is one library you don't want to muck up because everything uses it. If this is the case, you might try using "unrpm" or the "mc" program to extract just the libc.so.4 library. Make sure you do not copy over your current libc.so libraries or links.

The libc.so.4 in the package may be a link to the libc.so that the package supplies. If that is the case, you will probably need to first extract the libc.so file to a temporary directory and rename as libc.so.4. You want this old version to be uniquely named and you don't want to trump over a current version of any of your current libc files.

Just to say it a third time. Be Carefull!!!

Last edited by jschiwal; 07-04-2006 at 03:43 PM.
 
Old 07-04-2006, 03:51 PM   #13
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I went back and looked for libc.so.4 in earlier Red Hat editions.
Here is a link to the latest one I could find from Red Hat 5.2.
http://rpm.pbone.net/index.php3/stat....i386.rpm.html

Download the one that will work for your architecture, but don't install the package. Instead, use "mc", or "unrpm" and "cpio" or "unrpm" to get at the "lib.so.4" and "lib.so.4.2" files. The lib.so.4 file is a symbolic link to "lib.so.4.2" library.
 
Old 07-04-2006, 11:11 PM   #14
kirtimaan_bkn
Member
 
Registered: Aug 2004
Location: INDIA
Distribution: Various Distros
Posts: 203

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jschiwal
I went back and looked for libc.so.4 in earlier Red Hat editions.
Here is a link to the latest one I could find from Red Hat 5.2.
http://rpm.pbone.net/index.php3/stat....i386.rpm.html

Download the one that will work for your architecture, but don't install the package. Instead, use "mc", or "unrpm" and "cpio" or "unrpm" to get at the "lib.so.4" and "lib.so.4.2" files. The lib.so.4 file is a symbolic link to "lib.so.4.2" library.

Thanks jschiwal,

I will try this and let you know. Thanks for reminding me to be carefull. I will post the results here.

Thanks, Kirtimaan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bad interpreter error zum Linux - Software 3 05-31-2005 10:01 AM
bad interpreter???? yenonn Programming 4 09-25-2004 05:21 AM
./configure - bad interpreter Seventh Linux - Newbie 4 02-23-2004 08:11 AM
script: bad interpreter... chunkymunky Programming 6 12-25-2003 09:58 PM
bad interpreter penzilsinc Linux - Newbie 5 06-26-2002 01:51 PM


All times are GMT -5. The time now is 02:30 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration