Subject: gcc -nostdlib and shared libs
To: None <tech-toolchain@netbsd.org>
From: Cherry G. Mathew <cherry.g.mathew@gmail.com>
List: tech-toolchain
Date: 03/15/2005 06:09:54
Hi,

I'm trying to get an elf binary with .dynamic and friends available
and _DYNAMIC defined properly. ( Essentially a shared obj. ) It looks
like doing LDFLAGS +=  -nostdlib makes linking static.

Two questions:

1) Does anyone know if this is the case with gcc/ia64 on FreeBSD/Linux
2) Is it possible to pass -nostdlib to gcc and yet get a shared elf
object file on NetBSD ?
If not, is it because of:

#define NETBSD_LINK_SPEC_ELF \
  "%{assert*} %{R*} %{rpath*} \
   %{shared:-shared} \
   %{symbolic:-Bsymbolic} \
   %{!shared: \
     -dc -dp \
     %{!nostdlib: \
        ^^^^^^^^^^^^^

       %{!r*: \
         %{!e*:-e %(netbsd_entry_point)}}} \
     %{!static: \
       %{rdynamic:-export-dynamic} \
       %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
     %{static:-static}}"

in gnu/dist/gcc/gcc/config/netbsd-elf.h ? 


Thanks,

-- 
~Cherry