Subject: gcc -nostdlib and shared libs
To: None <>
From: Cherry G. Mathew <>
List: tech-toolchain
Date: 03/15/2005 06:09:54

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:

  "%{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}} \

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