How do I build a cross-ldd?

Rob Landley rob at landley.net
Tue Dec 19 15:05:27 UTC 2006


On Tuesday 19 December 2006 3:25 am, Dave Dodge wrote:
> On Mon, Dec 18, 2006 at 01:19:23AM -0500, Rob Landley wrote:
> > I want an x86 version of ldd that does a proper dump for non-x86 binaries.  
> > What am I doing wrong?
> 
> It could be tricky.  Bear in mind that ldd normally takes the names of
> the required shared libraries and actually finds the library files (on
> the target system) that match.

Yeah, search path would be a bit weird, but I can ignore anything to the right 
of -> or add some kind of --chroot option.

> I think it also tracks down dependencies recursively,

Not that I know of.  I had to write a script when I wanted the recursive 
dependencies.  (See the busybox test suite.)

> for example if the executable requires 
> libABC then it also looks for any libraries that libABC says it needs.
> I don't know how ldd is normally implemented, but if it expects to use
> the loader itself to do this

The glibc one does, the uClibc one does not.  That's why I like the uClibc 
one.

> then that's even more trouble due to the 
> loader being cross-compiled to target code.
> 
> If you just want a simple list of library names that the executable
> needs, you could try "readelf -d" instead.

I want an ldd command that works.  I have existing scripts that depend on the 
ldd command, which was there back in libc5.

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery



More information about the uClibc mailing list