[klibc] testers sought for script to interpret ELF/klibc executables

Erik van Konijnenburg ekonijn at xs4all.nl
Sun Mar 6 12:41:38 PST 2005


On Sun, Mar 06, 2005 at 10:57:24AM -0800, H. Peter Anvin wrote:
> Erik van Konijnenburg wrote:
> > Here's a small test program to find out where a klibc executable
> > expects its shared library (or interpreter to be precise) to be.
> > It should work regardless of 32/64 bit, little- or big-endian,
> > but only on native executables.
> 
> It shouldn't be too hard to make it generic.  In fact, if done properly, 
> it should even work on non-klibc libraries.

Oh, it finds the interp for executables regardless of which library is
used.  Just not the shared libraries, but for glibc ldd handles that
and klibc does not support shared libraries (correct me if I'm wrong;
I could not find a loader in the sources).

> > The tricky part is that perl unpacking of 64-bit integers has
> > limitations: only available on 64-bit machines, only if configured in.
> > If it turns out this causes problems in practise, I'll have to rework
> > this to unpack 64-bit ints as two longs; something I'd rather avoid.
> 
> Sounds like a good reason to write it in C instead.

You're probably right.  See also Debian bug #298311, "new ldd breaks
initrd-tools on amd64".  This tool would need to:
- be based on bfd,
- find interp, the dynamic loader
- find the NEEDED records from the .dynamic segment
- apply LD_LIBRARY_PATH to such records

I'll do some experimenting with this approach.

Thanks for your comment,
Erik




More information about the klibc mailing list