Index: netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h,v retrieving revision 1.9 diff -p -u -u -r1.9 netbsd-elf.h --- netbsd-elf.h 1 Jun 2016 22:27:49 -0000 1.9 +++ netbsd-elf.h 9 Aug 2016 20:15:20 -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 /usr/libexec/ld.elf_so" + #define NETBSD_LINK_SPEC_ELF \ "%{assert*} %{R*} %{rpath*} \ %{shared:-shared} \ @@ -84,8 +87,9 @@ 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}}}" Index: alpha/netbsd.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/alpha/netbsd.h,v retrieving revision 1.4 diff -p -u -u -r1.4 netbsd.h --- alpha/netbsd.h 24 Jan 2016 09:43:32 -0000 1.4 +++ alpha/netbsd.h 9 Aug 2016 20:15:20 -0000 @@ -44,7 +44,8 @@ along with GCC; see the file COPYING3. #define EXTRA_SPECS \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ - { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, + { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* Provide a LINK_SPEC appropriate for a NetBSD/alpha ELF target. */ Index: arm/netbsd-eabi.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-eabi.h,v retrieving revision 1.14 diff -p -u -u -r1.14 netbsd-eabi.h --- arm/netbsd-eabi.h 27 May 2015 15:33:41 -0000 1.14 +++ arm/netbsd-eabi.h 9 Aug 2016 20:15:20 -0000 @@ -100,7 +100,8 @@ { "linker_little_emulation", TARGET_LINKER_LITTLE_EMULATION }, \ { "be8_link_spec", BE8_LINK_SPEC }, \ { "target_fix_v4bx_spec", TARGET_FIX_V4BX_SPEC }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #define NETBSD_ENTRY_POINT "__start" Index: arm/netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h,v retrieving revision 1.10 diff -p -u -u -r1.10 netbsd-elf.h --- arm/netbsd-elf.h 10 Jun 2016 01:14:00 -0000 1.10 +++ arm/netbsd-elf.h 9 Aug 2016 20:15:20 -0000 @@ -80,7 +80,8 @@ { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \ { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #define NETBSD_ENTRY_POINT "__start" Index: i386/netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h,v retrieving revision 1.6 diff -p -u -u -r1.6 netbsd-elf.h --- i386/netbsd-elf.h 24 Jan 2016 09:43:33 -0000 1.6 +++ i386/netbsd-elf.h 9 Aug 2016 20:15:20 -0000 @@ -32,7 +32,8 @@ along with GCC; see the file COPYING3. #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target. */ Index: i386/netbsd64.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h,v retrieving revision 1.6 diff -p -u -u -r1.6 netbsd64.h --- i386/netbsd64.h 27 Mar 2016 17:17:59 -0000 1.6 +++ i386/netbsd64.h 9 Aug 2016 20:15:20 -0000 @@ -33,7 +33,8 @@ along with GCC; see the file COPYING3. #define SUBTARGET_EXTRA_SPECS \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* Provide a LINK_SPEC appropriate for a NetBSD/x86-64 ELF target. */ Index: ia64/netbsd.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/ia64/netbsd.h,v retrieving revision 1.5 diff -p -u -u -r1.5 netbsd.h --- ia64/netbsd.h 1 Jul 2016 14:48:51 -0000 1.5 +++ ia64/netbsd.h 9 Aug 2016 20:15:20 -0000 @@ -33,7 +33,8 @@ Boston, MA 02111-1307, USA. */ #define SUBTARGET_EXTRA_SPECS \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* Provide a LINK_SPEC appropriate for a NetBSD/ia64 ELF target. */ Index: m68k/netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h,v retrieving revision 1.9 diff -p -u -u -r1.9 netbsd-elf.h --- m68k/netbsd-elf.h 26 Jun 2016 15:46:42 -0000 1.9 +++ m68k/netbsd-elf.h 9 Aug 2016 20:15:20 -0000 @@ -56,7 +56,8 @@ along with GCC; see the file COPYING3. #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* Provide a CPP_SPEC appropriate for NetBSD m68k targets. Currently we Index: mips/netbsd.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/mips/netbsd.h,v retrieving revision 1.7 diff -p -u -u -r1.7 netbsd.h --- mips/netbsd.h 24 Jan 2016 09:43:33 -0000 1.7 +++ mips/netbsd.h 9 Aug 2016 20:15:20 -0000 @@ -163,7 +163,8 @@ along with GCC; see the file COPYING3. #define SUBTARGET_EXTRA_SPECS \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD. */ Index: or1k/netbsd.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/or1k/netbsd.h,v retrieving revision 1.2 diff -p -u -u -r1.2 netbsd.h --- or1k/netbsd.h 19 Sep 2014 00:24:28 -0000 1.2 +++ or1k/netbsd.h 9 Aug 2016 20:15:20 -0000 @@ -58,7 +58,8 @@ Boston, MA 02111-1307, USA. */ #define SUBTARGET_EXTRA_SPECS \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ - { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, + { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #undef TARGET_DEFAULT #define TARGET_DEFAULT \ Index: pa/pa-netbsd.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/pa/pa-netbsd.h,v retrieving revision 1.4 diff -p -u -u -r1.4 pa-netbsd.h --- pa/pa-netbsd.h 14 Mar 2016 07:33:27 -0000 1.4 +++ pa/pa-netbsd.h 9 Aug 2016 20:15:20 -0000 @@ -36,7 +36,8 @@ along with GCC; see the file COPYING3. #undef EXTRA_SPECS #define EXTRA_SPECS \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #define NETBSD_ENTRY_POINT "__start" Index: riscv/netbsd.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/riscv/netbsd.h,v retrieving revision 1.3 diff -p -u -u -r1.3 netbsd.h --- riscv/netbsd.h 1 Apr 2015 06:35:01 -0000 1.3 +++ riscv/netbsd.h 9 Aug 2016 20:15:20 -0000 @@ -67,7 +67,8 @@ Boston, MA 02111-1307, USA. */ #define SUBTARGET_EXTRA_SPECS \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ - { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, + { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #define SIG_ATOMIC_TYPE "int" Index: rs6000/netbsd.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd.h,v retrieving revision 1.10 diff -p -u -u -r1.10 netbsd.h --- rs6000/netbsd.h 24 Jan 2016 09:43:33 -0000 1.10 +++ rs6000/netbsd.h 9 Aug 2016 20:15:20 -0000 @@ -114,7 +114,8 @@ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ - { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, + { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* * Add NetBSD specific defaults: -mstrict-align Index: rs6000/netbsd64.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h,v retrieving revision 1.14 diff -p -u -u -r1.14 netbsd64.h --- rs6000/netbsd64.h 9 Jun 2016 23:28:22 -0000 1.14 +++ rs6000/netbsd64.h 9 Aug 2016 20:15:20 -0000 @@ -221,7 +221,8 @@ extern int dot_symbols; { "asm_spec32", ASM_SPEC32 }, \ { "asm_spec64", ASM_SPEC64 }, \ { "link_os_netbsd_spec32", LINK_OS_NETBSD_SPEC32 }, \ - { "link_os_netbsd_spec64", LINK_OS_NETBSD_SPEC64 }, + { "link_os_netbsd_spec64", LINK_OS_NETBSD_SPEC64 }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #undef MULTILIB_DEFAULTS #if DEFAULT_ARCH64_P Index: sh/netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/sh/netbsd-elf.h,v retrieving revision 1.1.1.3 diff -p -u -u -r1.1.1.3 netbsd-elf.h --- sh/netbsd-elf.h 24 Jan 2016 06:06:25 -0000 1.1.1.3 +++ sh/netbsd-elf.h 9 Aug 2016 20:15:20 -0000 @@ -24,7 +24,8 @@ along with GCC; see the file COPYING3. #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #define TARGET_OS_CPP_BUILTINS() \ Index: sparc/netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/sparc/netbsd-elf.h,v retrieving revision 1.10 diff -p -u -u -r1.10 netbsd-elf.h --- sparc/netbsd-elf.h 24 Jan 2016 09:43:34 -0000 1.10 +++ sparc/netbsd-elf.h 9 Aug 2016 20:15:20 -0000 @@ -211,7 +211,8 @@ along with GCC; see the file COPYING3. { "link_arch", LINK_ARCH_SPEC }, \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, /* Build a compiler that supports -m32 and -m64? */ Index: vax/netbsd-elf.h =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/config/vax/netbsd-elf.h,v retrieving revision 1.3 diff -p -u -u -r1.3 netbsd-elf.h --- vax/netbsd-elf.h 24 Jan 2016 09:43:34 -0000 1.3 +++ vax/netbsd-elf.h 9 Aug 2016 20:15:20 -0000 @@ -60,8 +60,9 @@ along with GCC; see the file COPYING3. #define LINK_SPEC NETBSD_LINK_SPEC_ELF #endif -#define EXTRA_SPECS \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, +#define EXTRA_SPECS \ + { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ + { "netbsd_link_ld_elf_so", NETBSD_LINK_LD_ELF_SO_SPEC }, #undef INTPTR_TYPE #define INTPTR_TYPE "long int"