Index: external/gpl3/gcc/dist/gcc/config/netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h,v retrieving revision 1.10 diff -p -u -u -r1.10 netbsd-elf.h --- external/gpl3/gcc/dist/gcc/config/netbsd-elf.h 19 Aug 2016 05:11:09 -0000 1.10 +++ external/gpl3/gcc/dist/gcc/config/netbsd-elf.h 19 Aug 2016 05:17:12 -0000 @@ -73,6 +73,9 @@ along with GCC; see the file COPYING3. Target-specific code must provide the %(netbsd_entry_point) spec. */ +#define NETBSD_LINK_LD_ELF_SO_SPEC \ + "%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}" + #define NETBSD_LINK_SPEC_ELF \ "%{assert*} %{R*} %{rpath*} \ %{shared:-shared} \ @@ -84,14 +87,16 @@ along with GCC; see the file COPYING3. %{!e*:-e %(netbsd_entry_point)}}} \ %{!static: \ %{rdynamic:-export-dynamic} \ - -dynamic-linker /usr/libexec/ld.elf_so} \ - %{static:-static}} \ + %(netbsd_link_ld_elf_so)} \ + %{static:-static \ + %{pie: %(netbsd_link_ld_elf_so)}}} \ %{!nostdlib:%{!nodefaultlibs:\ %{%:sanitize(address): -lasan } \ %{%:sanitize(undefined): -lubsan}}}" /* Provide the standard list of subtarget extra specs for NetBSD targets. */ #define NETBSD_SUBTARGET_EXTRA_SPECS \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \