LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-26-2007, 05:16 AM   #1
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100
Blog Entries: 1

Rep: Reputation: 15
How to change the script of an executable?


Dear All,

In my /etc of ARM Linux, there is no ld.so.config file and there is no ldconfig command running, there is ld.so.cache which is binary executable, but there is no command like ldcache to run this file.

Then i create the ld.so.conf file in which i wrote the names of the directories where my shared object libraries are lying (like /lib,/user/lib) and i execute ./ld.so.cache (It could be that i am doing wrong) which infact runs my ld.so.conf file and it shows that /usr/lib is a directory (ofcourse ./ is to execute binary files).

how to create the ldcache command to execute ld.so.cache, how can i know that from which file ld.so.cache file has been generated? so that i can change it and can load my shared object libraries at the initialisation time.

Any input will be appreciable.

Thanks,
Nishant
 
Old 02-26-2007, 10:25 AM   #2
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 48
Quote:
Originally Posted by Nishant Desai
...how to create the ldcache command to execute ld.so.cache, how can i know that from which file ld.so.cache file has been generated? so that i can change it and can load my shared object libraries at the initialisation time...
Hmm... I'm not exactly sure what you're after here, but isn't the command you're looking for called 'ldconfig', not 'ldcache'?
 
Old 02-26-2007, 01:19 PM   #3
iamnothere
Member
 
Registered: Feb 2007
Location: UK
Distribution: Slamd 64, Slackware
Posts: 46

Rep: Reputation: 16
There is no ldcache command, it is ldconfig, as alienDog stated. /etc/ld.so.conf is a text file, which lists directories in which shared libraries are to be located. This file is processed with /sbin/ldconfig to produce /etc/ld.so.cache. I.e. think of /etc/ld.so.conf as the 'source' file, which is 'compiled' with ldconfig to produce the output file /etc/ld.so.cache.

/etc/ld.so.cache is used by the dynamic linker (/lib/ld-linux.so.2) to locate libaries whenever a command is executed (since searching the filesystem everytime a command is run would be hideously slow). Note that ldconfig is not a daemon, it isn't running all the time, you just run it to process /etc/ls.so.conf (whenever libraries are installed/removed). If you don't have an /etc/ld.so.conf, then just create one.
 
Old 02-26-2007, 11:59 PM   #4
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by iamnothere
There is no ldcache command, it is ldconfig, as alienDog stated. /etc/ld.so.conf is a text file, which lists directories in which shared libraries are to be located. This file is processed with /sbin/ldconfig to produce /etc/ld.so.cache. I.e. think of /etc/ld.so.conf as the 'source' file, which is 'compiled' with ldconfig to produce the output file /etc/ld.so.cache.

/etc/ld.so.cache is used by the dynamic linker (/lib/ld-linux.so.2) to locate libaries whenever a command is executed (since searching the filesystem everytime a command is run would be hideously slow). Note that ldconfig is not a daemon, it isn't running all the time, you just run it to process /etc/ls.so.conf (whenever libraries are installed/removed). If you don't have an /etc/ld.so.conf, then just create one.
Hiii,

I understand what you are saying, and i also have created the ld.so.conf, but how to make the command ldconfig under /sbin, so that whenever i run the command ldconfig it runs the /etc/ld.so.conf and produce the ld.so.cache? there is no ldconfig command in my /usr/sbin directory.

Hoping for the prompt reply.

Thanks for the help.
Nishant
 
Old 02-27-2007, 12:54 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look for the ldconfig command in the /sbin/ directory. You should have it, because is is usually supplied along with glibc.
 
Old 02-27-2007, 12:18 PM   #6
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 48
Quote:
Originally Posted by jschiwal
Look for the ldconfig command in the /sbin/ directory. You should have it, because is is usually supplied along with glibc.
If not, then your installation is broken...
 
Old 02-27-2007, 11:22 PM   #7
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by alienDog
If not, then your installation is broken...
Hiii,

Finally what i did is take the ld.so.conf, write the necessary code inside and then generate the ld.so.cache in my desktop linux and then copy it to my ARM Linux's Ramdisk, and it works for me, first i was in doubt that the file which has been created on the normal desktop wont work on the ARM processor, but after all it works for me.

Thanks,
Nishant
 
Old 02-27-2007, 11:35 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Maybe on embedded systems, one doesn't normally add libraries and ldconfig is considered to be superfluous.

FYI: I noticed that there is a new book "Embedded Linux by Example" in Barnes and Nobels.
 
Old 02-28-2007, 11:20 PM   #9
Nishant Desai
Member
 
Registered: Jul 2006
Posts: 100

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Quote:
Originally Posted by jschiwal
Maybe on embedded systems, one doesn't normally add libraries and ldconfig is considered to be superfluous.

FYI: I noticed that there is a new book "Embedded Linux by Example" in Barnes and Nobels.
Hiii,
I dont think that ldconfig kind of files are superflous, because as in my case there are many cases can happened in which you want to load library files on the initialisation, and ldconfig is for that only.

Anyways, can you refer me to the site, where you found the above book.

Thanks,
Nishant
 
  


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
Matlab 14.3 startup script not executable via yast2 tomatoefish SUSE / openSUSE 1 07-16-2006 03:39 PM
When an executable turned to a script file,...??! lucky6969b Programming 8 03-08-2006 02:26 AM
shell script to execute my c executable cranium2004 Programming 2 04-06-2005 05:26 AM
How do you turn an executable into a shell script? Thaidog Linux - Newbie 1 09-20-2004 07:20 PM
Make a shell script executable but not readable davholla Linux - Security 5 03-24-2004 03:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration