Question: Finding libraries that are required for busybox??

Eli Schwartz eschwartz at archlinux.org
Tue Jun 26 21:38:16 UTC 2018


On 06/26/2018 07:37 AM, Walter Harms wrote:
> there is no static version of gnu-libc.

There is absolutely a libc.a provided by GNU libc, and you can
statically link it on account of it's a static library.

I'm looking at it right now, along with the binaries which are,
successfully, statically linked to it.

> But i agree there is other to really know what is needed.
> Dynamic libraries by there very name are dynamic and may link
> other libraies in without notice, i doubt ldd will be clever enought
> to see this.

This has absolutely nothing to do with dynamic vs. static libs.

Static libraries are part of the binary, and dynamic libraries are *very
clearly* marked as required, as ldd, readelf, objdump, or literally
anything else which checks ELF headers can attest.

dlopen() is a *third* way of "linking" a library, and any or all three
methods can be used in the same ELF file.

> In the give case ldd may be ok, but it is clearly not fool-proof and
> a runtime test is always required.

ldd is never okay, because it cannot detect dlopen().

Nothing can, except for running the binary and tracing the calls it makes.

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20180626/600855c9/attachment.asc>


More information about the busybox mailing list