busybox --gc-sections thing

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Sun Dec 10 14:19:40 UTC 2006


Denis, all,

On Sunday 10 December 2006 040, Denis Vlasenko wrote:
> Static glibc cannot do name resolution. Forget "ping <hostname>" -
> it won't work. (Didn't check recently - maybe fixed now).

Yes it does. *But* you have to have at least one of those:
   libnss_{compat,dns,files,hesiod,nis{,plus}}*.so

And, yes, those are shared libraries, and you need them to be present even if
your binary was statically linked. NSS stands for Name Service Switch, and is
configured via /etc/nsswitch.conf.

And those libraries are linked against libc.so and ld-linux.so, then you'll
have to have the shared C library and the dynamic loader as well!

Thus, compiling static binaries, which require name services (eg. DNS), with
glibc anyway sucks in libc.so and at least one of the libnss libraries...

So, stay away from static linking with glibc. Use uClibc.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< °_° >==-- °------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |
°------------------------------°-------°------------------°--------------------°



More information about the busybox mailing list