[PATCH] Use generic NetBSD LINK_SPEC for NetBSD SPARC targets
Jason R Thorpe
thorpej@wasabisystems.com
Sat Jun 8 09:30:00 GMT 2002
It turns out that, by an accident of history, LINK_SPEC was wrong
on sparc-netbsdelf and sparc64-netbsd all this time, but we got
lucky for most uses. "oops." I'll cook up a patch for the 3.1
branch shortly.
Committed to trunk.
* config/sparc/netbsd-elf.h (LINK_ARCH32_SPEC): Only specify
linker emulation.
(LINK_ARCH64_SPEC): Likewise.
(LINK_SPEC, NETBSD_ENTRY_POINT): Define.
(SUBTARGET_EXTRA_SPECS): Add netbsd_link_spec and netbsd_entry_point.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: config/sparc/netbsd-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/netbsd-elf.h,v
retrieving revision 1.9
diff -c -r1.9 netbsd-elf.h
*** config/sparc/netbsd-elf.h 29 May 2002 23:50:56 -0000 1.9
--- config/sparc/netbsd-elf.h 8 Jun 2002 16:19:22 -0000
***************
*** 197,231 ****
/* Make sure we use the right output format. Pick a default and then
make sure -m32/-m64 switch to the right one. */
! #define LINK_ARCH32_SPEC \
! "%-m elf32_sparc \
! %{assert*} %{R*} %{V} %{v:%{!V:-V}} \
! %{shared:-shared} \
! %{!shared: \
! -dp \
! %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
! %{!static: \
! -dy %{rdynamic:-export-dynamic} \
! %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
! %{static:-static}}"
!
! #define LINK_ARCH64_SPEC \
! "%-m elf64_sparc \
! %{assert*} %{R*} %{V} %{v:%{!V:-V}} \
! %{shared:-shared} \
! %{!shared: \
! -dp \
! %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
! %{!static: \
! -dy %{rdynamic:-export-dynamic} \
! %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
! %{static:-static}}"
!
! #define LINK_ARCH_SPEC "\
! %{m32:%(link_arch32)} \
! %{m64:%(link_arch64)} \
! %{!m32:%{!m64:%(link_arch_default)}} \
! "
#if DEFAULT_ARCH32_P
#define LINK_ARCH_DEFAULT_SPEC LINK_ARCH32_SPEC
--- 197,218 ----
/* Make sure we use the right output format. Pick a default and then
make sure -m32/-m64 switch to the right one. */
! #define LINK_ARCH32_SPEC "-m elf32_sparc"
!
! #define LINK_ARCH64_SPEC "-m elf64_sparc"
!
! #define LINK_ARCH_SPEC \
! "%{m32:%(link_arch32)} \
! %{m64:%(link_arch64)} \
! %{!m32:%{!m64:%(link_arch_default)}}"
!
! #undef LINK_SPEC
! #define LINK_SPEC \
! "%(link_arch) \
! %{!mno-relax:%{!r:-relax}} \
! %(netbsd_link_spec)"
!
! #define NETBSD_ENTRY_POINT "__start"
#if DEFAULT_ARCH32_P
#define LINK_ARCH_DEFAULT_SPEC LINK_ARCH32_SPEC
***************
*** 240,246 ****
{ "link_arch64", LINK_ARCH64_SPEC }, \
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC }, \
! { "netbsd_cpp_spec", NETBSD_CPP_SPEC },
/* What extra switches do we need? */
--- 227,235 ----
{ "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 },
/* What extra switches do we need? */
More information about the Gcc-patches
mailing list