Question: Finding libraries that are required for busybox??

Laurent Bercot ska-dietlibc at skarnet.org
Mon Jun 25 19:13:10 UTC 2018


>Using busybox nslookup failed due to one of the libraries I had removed 
>not
>being there? libnss_dns and libnss_files. ldd busybox doesn't report 
>these
>libraries are used? Once I put those libraries back, the nslookup 
>resolves.

  That's because those shared libraries are not used at build time - or
at process start time - so ldd cannot find them. They are actually
dlopen()ed by glibc later in the life of the process, whenever you do
an NSS request (which nslookup does).

  In the precise case of the libnss_*.so files, the way to know whether
or not you need them is to look at /etc/nsswitch.conf : depending on
how your NSS is set up, you may or may not need certain backends.

  In the general case, however, I don't think there's a simple way of
finding out all the .so dependencies of a project whenever dlopen() is
involved. You just have to know the project and what .so modules it
may want to load dynamically.

--
  Laurent



More information about the busybox mailing list