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 10 Aug 2016 04:49:56 -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,12 +87,25 @@ 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 }, \ + { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, + +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS + + /* Use --as-needed -lgcc_s for eh support. */ #ifdef HAVE_LD_AS_NEEDED #define USE_LD_AS_NEEDED 1 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 10 Aug 2016 04:49:56 -0000 @@ -41,11 +41,8 @@ along with GCC; see the file COPYING3. #define CPP_SPEC NETBSD_CPP_SPEC #undef EXTRA_SPECS -#define EXTRA_SPECS \ - { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ - { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, - +#define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS +#undef SUBTARGET_EXTRA_SPECS /* 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 10 Aug 2016 04:49:56 -0000 @@ -93,14 +93,13 @@ #define SUBTARGET_EXTRA_SPECS \ { "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \ { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \ - { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ { "linker_eabi_suffix", TARGET_LINKER_EABI_SUFFIX }, \ { "linker_emulation", TARGET_LINKER_EMULATION }, \ { "linker_big_emulation", TARGET_LINKER_BIG_EMULATION }, \ { "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_SUBTARGET_EXTRA_SPECS #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 10 Aug 2016 04:49:56 -0000 @@ -75,13 +75,6 @@ "%{mhard-float:%{!mfpu=*:-mfpu=vfp}} \ %{mfloat-abi=hard:%{!mfpu=*:-mfpu=vfp}}" -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "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 }, - #define NETBSD_ENTRY_POINT "__start" #undef LINK_SPEC 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 10 Aug 2016 04:49:56 -0000 @@ -27,14 +27,6 @@ along with GCC; see the file COPYING3. while (0) -/* Extra specs needed for NetBSD/i386 ELF. */ - -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, - - /* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target. */ #undef LINK_SPEC 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 10 Aug 2016 04:49:56 -0000 @@ -27,15 +27,6 @@ along with GCC; see the file COPYING3. while (0) -/* Extra specs needed for NetBSD/x86-64 ELF. */ - -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ - { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, - - /* Provide a LINK_SPEC appropriate for a NetBSD/x86-64 ELF target. */ #undef LINK_SPEC 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 10 Aug 2016 04:49:56 -0000 @@ -27,15 +27,6 @@ Boston, MA 02111-1307, USA. */ while (0) -/* Extra specs needed for NetBSD/ia-64 ELF. */ - -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ - { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, - - /* Provide a LINK_SPEC appropriate for a NetBSD/ia64 ELF target. */ #undef LINK_SPEC 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 10 Aug 2016 04:49:56 -0000 @@ -53,11 +53,6 @@ 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 }, - /* Provide a CPP_SPEC appropriate for NetBSD m68k targets. Currently we deal with the GCC option '-posix', as well as an indication as to 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 10 Aug 2016 04:49:56 -0000 @@ -158,13 +158,6 @@ along with GCC; see the file COPYING3. while (0) -/* Extra specs we need. */ -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ - { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, - /* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD. */ #undef SUBTARGET_CPP_SPEC 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 10 Aug 2016 04:49:56 -0000 @@ -54,12 +54,6 @@ Boston, MA 02111-1307, USA. */ #undef NETBSD_ENTRY_POINT #define NETBSD_ENTRY_POINT "_start" -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ - { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, - #undef TARGET_DEFAULT #define TARGET_DEFAULT \ (/*MASK_HARD_FLOAT |*/ MASK_DOUBLE_FLOAT \ 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 10 Aug 2016 04:49:56 -0000 @@ -35,8 +35,8 @@ along with GCC; see the file COPYING3. "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}" #undef EXTRA_SPECS -#define EXTRA_SPECS \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, +#define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS +#undef SUBTARGET_EXTRA_SPECS #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 10 Aug 2016 04:49:56 -0000 @@ -63,12 +63,6 @@ Boston, MA 02111-1307, USA. */ #undef NETBSD_ENTRY_POINT #define NETBSD_ENTRY_POINT "_start" -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, \ - { "netbsd_endfile_spec", NETBSD_ENDFILE_SPEC }, - #define SIG_ATOMIC_TYPE "int" #define INT8_TYPE "signed char" 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 10 Aug 2016 04:49:56 -0000 @@ -112,9 +112,7 @@ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "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_SUBTARGET_EXTRA_SPECS /* * Add NetBSD specific defaults: -mstrict-align 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 10 Aug 2016 04:49:56 -0000 @@ -20,13 +20,6 @@ along with GCC; see the file COPYING3. /* Run-time Target Specification. */ -/* Extra specs needed for NetBSD SuperH ELF targets. */ - -#undef SUBTARGET_EXTRA_SPECS -#define SUBTARGET_EXTRA_SPECS \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, - - #define TARGET_OS_CPP_BUILTINS() \ do \ { \ 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 10 Aug 2016 04:49:56 -0000 @@ -209,9 +209,7 @@ along with GCC; see the file COPYING3. { "link_arch64", LINK_ARCH64_SPEC }, \ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \ { "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_SUBTARGET_EXTRA_SPECS /* 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 10 Aug 2016 04:49:56 -0000 @@ -43,25 +43,11 @@ along with GCC; see the file COPYING3. #define NETBSD_ENTRY_POINT "__start" #undef LINK_SPEC -#if 0 -/* FIXME: We must link all executables statically until PIC support - is added to the compiler. */ -#define LINK_SPEC \ - "%{assert*} %{R*} %{rpath*} \ - %{shared:%ethe -shared option is not currently supported for VAX ELF} \ - %{!shared: \ - -dc -dp \ - %{!nostdlib: \ - %{!r: \ - %{!e*:-e %(netbsd_entry_point)}}} \ - %{!static:-static} \ - %{static:-static}}" -#else #define LINK_SPEC NETBSD_LINK_SPEC_ELF -#endif -#define EXTRA_SPECS \ - { "netbsd_entry_point", NETBSD_ENTRY_POINT }, +#undef EXTRA_SPECS +#define EXTRA_SPECS NETBSD_SUBTARGET_EXTRA_SPECS +#undef SUBTARGET_EXTRA_SPECS #undef INTPTR_TYPE #define INTPTR_TYPE "long int"