How to find all executables dependent on a library?
How to find all executables dependent on a library?
I know that one can use "ldd" followed by the name of an executable file to find and list all the library files that the executable file is dependent upon and requires. However, is there anything that does the opposite, i.e., lists all executable files that depend upon a given library file? I thought Jonathan Marsden worked on something like that in an older version of Puppy but I could never get the commands he was using to work on the Puppy versions I had. I am trying to customize my own Puppy and want to efficiently figure out which library files can be safely deleted after certain executable files are also deleted.
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
I remember Jonathan Marsden's script, I tried it and it worked for me. I think I had to create some bash script that run his perl script.
I can try searching for it later and possibly post it here tomorrow, if you're interested.
I can try searching for it later and possibly post it here tomorrow, if you're interested.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
Ok, here we go:
The "scripts" tarball contains the Jonathan M perl script with the bash script that runs it. (I didn't try it again, but I don't see why it shouldn't work.)
I also wrote a bash script that does the same job and more: it creates a file with a list of the libraries missing and one of "orphaned" libraries- that nothing depends on, so they might not be needed (not for sure, but at least worth investigating).
The "scripts" tarball contains the Jonathan M perl script with the bash script that runs it. (I didn't try it again, but I don't see why it shouldn't work.)
I also wrote a bash script that does the same job and more: it creates a file with a list of the libraries missing and one of "orphaned" libraries- that nothing depends on, so they might not be needed (not for sure, but at least worth investigating).
- Attachments
-
- list-dependents.sh.gz
- creates three files:
/root/dependents.txt
/root/missing.txt
/root/orphaned.txt - (1.28 KiB) Downloaded 276 times
-
- scripts.tar.gz
- (510 Bytes) Downloaded 248 times
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
Lee: I'm ashamed to say I don't know what upx compressed execs are...
However, I don't think Puppy has any.
Anyway, there is another problem: "find" doesn't seem to recognise some directories!
I tried my best to get it to find files within the /usr/lib/perl5 directory and it just wouldn't do it!
I'll probably post a bug report about it tomorrow...
However, I don't think Puppy has any.
Anyway, there is another problem: "find" doesn't seem to recognise some directories!
I tried my best to get it to find files within the /usr/lib/perl5 directory and it just wouldn't do it!
I'll probably post a bug report about it tomorrow...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
http://upx.sourceforge.net/
I usually upx executables that I install into my Puppy save file to save space.
--Lee
I usually upx executables that I install into my Puppy save file to save space.
--Lee
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
Toddyjoe: look at the message I posted about the problem with "find".
I actually have another script, which goes over all the paths and finds everything, but it's much slower. If you want I can post it here for you.
Lee, I could actually add an exception for UPX in my script -- have each UPX file extracted to a temp folder and then lld'd...
I actually have another script, which goes over all the paths and finds everything, but it's much slower. If you want I can post it here for you.
Lee, I could actually add an exception for UPX in my script -- have each UPX file extracted to a temp folder and then lld'd...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind