Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [fyi] lddtree magic
Date: Tue, 09 Apr 2013 19:30:04
Message-Id: 201304091531.06078.vapier@gentoo.org
1 i doubt few people have noticed, but i've rewritten lddtree recently in
2 python. i did for speed, for fun, and to add a lot more functionality that
3 would have driven the bash code base to new perverse levels.
4
5 i've randomly stumbled across places in our code base (beyond ebuilds) where
6 the new python version would be useful. rather than try and ferret out those
7 myself, i'll just announce here and people can sort it out.
8
9 if you guys think this can satisfy most of your needs but there's like a small
10 edge case that isn't quite handled, let me know. i can always add another
11 option :).
12
13 specifically, lddtree (both the shell & python variants) support a --list:
14 $ lddtree -l /bin/bash
15 /bin/bash
16 /lib64/ld-linux-x86-64.so.2
17 /lib64/libreadline.so.6
18 /lib64/libhistory.so.6
19 /lib64/libncurses.so.5
20 /lib64/libdl.so.2
21 /lib64/libc.so.6
22 this way you don't have to resort to grep/awk/sed on the output to try and get
23 the names out of `lddtree` (or heaven forbid, `ldd`).
24
25 it also supports --root just like you'd expect:
26 $ lddtree -l /bin/bash --root /mnt/space/distros/x86
27 /mnt/space/distros/x86/bin/bash
28 /mnt/space/distros/x86/lib/ld-linux.so.2
29 /mnt/space/distros/x86/lib/libreadline.so.6
30 /mnt/space/distros/x86/lib/libncurses.so.5
31 /mnt/space/distros/x86/lib/libdl.so.2
32 /mnt/space/distros/x86/lib/libc.so.6
33
34 but things get even crazier with the new --copy-to-tree option (python version
35 only). this is useful for scenarios like kernel initramfs where you want to
36 copy over one or two ELFs and their dependencies w/out resorting to statically
37 linking them. check out the --help text for more details.
38 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] [fyi] lddtree magic "Diego Elio Pettenò" <flameeyes@×××××××××.eu>
Re: [gentoo-dev] [fyi] lddtree magic Samuli Suominen <ssuominen@g.o>
Re: [gentoo-dev] [fyi] lddtree magic Samuli Suominen <ssuominen@g.o>