In <[EMAIL PROTECTED]>, Jordan K. Hubbard wrote: 
> root@zippy-> cc -fPIC -c stub.c
> root@zippy-> ld -shared -o stub.so stub.o
> root@zippy-> cc -static test.c -o test stub.so
> root@zippy-> ./test 
> ELF interpreter /usr/lib/libc.so.1 not found
> Abort trap
> root@zippy-> cc -static test.c -o test stub.o
> root@zippy-> ./test 
> Now in the client, calling doit()
> You have reached the stub.  Please leave a message.

As a workaround for a static binary, you should be able to use
  -Xlinker -Bstatic
instead of
  -static

-static links the libs statically and also leaves out the dynamic
loading code from the binary.

The former leaves the dynamic loading code in the binary, but links
the libs statically. You have a slightly bigger binary, but you don't
need the libs at runtime and you are resistent against changed/faked
libs, which might do the job you want static linking for.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <[EMAIL PROTECTED]> http://www.cons.org/cracauer/
BSD User Group Hamburg, Germany     http://www.bsdhh.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to