Bug#301455: ldd no longer puts a => before /bin/ld-linux.so.2
At Thu, 31 Mar 2005 00:25:39 +0300,
George Cristian Birzan wrote:
> On Wed, Mar 30, 2005 at 12:23:30PM +0900, GOTO Masanori wrote:
> > I expect you to explain why mkinitrd breaks with new ldd.
>
> gcbirzan@meteor:~$ ldd /bin/bash | sed 's/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/'
> (0xffffe000)
> /lib/libncurses.so.5
> /lib/tls/libdl.so.2
> /lib/tls/libc.so.6
> /lib/ld-linux.so.2 (0xb7fea000)
>
> That's what mkinitrd uses to get the libs a binary depends on. The fixed
Yes, I confirmed it.
> version would be
> sed -n 's/.*\(=>\)\?[[:blank:]]\+\(\/[^[:blank:]]*\).*/\2/p'
> (No, I don't know what this break on and, no, I've not yet submitted a
> bugreport against mkinitrd.)
> Anyway, bottom line is it doesn't put /lib/ld-linux.so.2 in the initrd,
> which makes it useless.
I think we shouldn't assume / character in \2 part. In 2.3.4, ldd
displays three different library formats as follows:
linux-gate.so.1 => (0xffffe000)
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7fdf000)
/lib/ld-linux.so.2 (0xb7fea000)
So, how about it, instead.
sed 's/\(.*=>\)\?[[:blank:]]*\(.*\)[[:blank:]]*\((.*)\)/\2/;/^$/d'
> > > Fixing mkinitrd would be relatively easy, I guess, since I fixed mine,
> > > but there may be other scripts which depend on this behaviour.
> >
> > But this argument does not become the exact reason to modify ldd. I
> > think tools should be followed because the behavior of ldd is not
> > standardized.
>
> Yes, but changing one tool is better than changing N, where N is greater
> than one. :-)
Yeah, IIRC there're no more packages having this problem except for
mkinitrd - perhaps N equals 1 :-)
I think we have no reason reverting to the old 2.3.2.ds1 ldd format in
Debian glibc package locally. I'll put this change into initrd-tools.
Regards,
-- gotom
Reply to: