Building statically linked application

Daniel Jacobowitz drow@false.org
Sun May 17 19:05:00 GMT 2009


This is not actually a binutils issue; you may want to try the
glibc libc-help list.

On Sun, May 17, 2009 at 06:21:47PM +0200, Andre-Marcel Hellmund wrote:
> In function `main':
> test.c:(.text+0x19): warning: Using 'getprotobyname' in statically
> linked applications requires at runtime the shared libraries from the
> glibc version used for linking
> 
> Could you please give some (short) background about this warning and why
> this function (and some others as well) still require the shared
> libraries at runtime although linked statically with:

Take a look at /etc/nsswitch.conf.  This specifies shared libraries
implementing bits of the resolver, and they have to be dynamically
loaded at runtime.  So you use the statically linked ld.so to load the
system libc.so.6 and libnss*.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list