Patchwork [6/9] Specs cleanup: -r* for linker

login
register
mail settings
Submitter Joseph S. Myers
Date Dec. 2, 2010, 4:36 p.m.
Message ID <Pine.LNX.4.64.1012021635490.26340@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/73993/
State New
Headers show

Comments

Joseph S. Myers - Dec. 2, 2010, 4:36 p.m.
Some linker specs do %{!r*:...}.  The contents appear to be setting an
entry point - that is, something it is indeed appropriate to disable
for -r (relocatable link).  But -r is an option with no argument and
it is not appropriate to catch other options such as -rdynamic here.
This patch restricts those specs to catching -r only.

2010-12-02  Joseph Myers  <joseph@codesourcery.com>

	* config/i386/openbsdelf.h (LINK_SPEC): Use %{r:} not %{r*:}.
	* config/mips/openbsd.h (LINK_SPEC): Use %{r:} not %{r*:}.
	* config/netbsd-aout.h (NETBSD_LINK_SPEC_AOUT): Use %{r:} not
	%{r*:}.
	* config/netbsd-elf.h (NETBSD_LINK_SPEC_ELF): Use %{r:} not
	%{r*:}.
	* config/sparc/openbsd64.h (LINK_SPEC): Use %{r:} not %{r*:}.
	* config/vax/netbsd-elf.h (LINK_SPEC): Use %{r:} not %{r*:}.
Joseph S. Myers - Dec. 9, 2010, 11:30 a.m.
Ping.  This patch 
<http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00193.html> is pending 
review.
Richard Guenther - Dec. 9, 2010, 12:51 p.m.
On Thu, Dec 9, 2010 at 12:30 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> Ping.  This patch
> <http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00193.html> is pending
> review.

Ok.

Thanks,
Richard.

> --
> Joseph S. Myers
> joseph@codesourcery.com
>

Patch

diff -rupN --exclude=.svn gcc-mainline-5/gcc/config/i386/openbsdelf.h gcc-mainline/gcc/config/i386/openbsdelf.h
--- gcc-mainline-5/gcc/config/i386/openbsdelf.h	2010-12-01 17:33:46.000000000 -0800
+++ gcc-mainline/gcc/config/i386/openbsdelf.h	2010-12-01 17:28:57.000000000 -0800
@@ -124,7 +124,7 @@  along with GCC; see the file COPYING3.  
 
 #undef LINK_SPEC
 #define LINK_SPEC \
-  "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
+  "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \
    %{shared:-shared} %{R*} \
    %{static:-Bstatic} \
    %{!static:-Bdynamic} \
diff -rupN --exclude=.svn gcc-mainline-5/gcc/config/mips/openbsd.h gcc-mainline/gcc/config/mips/openbsd.h
--- gcc-mainline-5/gcc/config/mips/openbsd.h	2010-12-01 17:33:46.000000000 -0800
+++ gcc-mainline/gcc/config/mips/openbsd.h	2010-12-01 17:29:12.000000000 -0800
@@ -83,7 +83,7 @@  along with GCC; see the file COPYING3.  
    %{call_shared} %{no_archive} %{exact_version} \
    %{!shared: %{!non_shared: %{!call_shared: -non_shared}}} \
    -dynamic-linker /usr/libexec/ld.so \
-   %{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp \
+   %{!nostdlib:%{!r:%{!e*:-e __start}}} -dc -dp \
    %{static:-Bstatic} %{!static:-Bdynamic} %{assert*}"
 
 /* -G is incompatible with -KPIC which is the default, so only allow objects
diff -rupN --exclude=.svn gcc-mainline-5/gcc/config/netbsd-aout.h gcc-mainline/gcc/config/netbsd-aout.h
--- gcc-mainline-5/gcc/config/netbsd-aout.h	2010-10-24 09:33:03.000000000 -0700
+++ gcc-mainline/gcc/config/netbsd-aout.h	2010-12-01 17:28:17.000000000 -0800
@@ -57,7 +57,7 @@  along with GCC; see the file COPYING3.  
   "%{nostdlib:-nostdlib}		\
    %{!shared:				\
      %{!nostdlib:			\
-       %{!r*:				\
+       %{!r:				\
 	 %{!e*:-e start}}}		\
      -dc -dp				\
      %{static:-Bstatic}}		\
diff -rupN --exclude=.svn gcc-mainline-5/gcc/config/netbsd-elf.h gcc-mainline/gcc/config/netbsd-elf.h
--- gcc-mainline-5/gcc/config/netbsd-elf.h	2010-12-01 17:33:46.000000000 -0800
+++ gcc-mainline/gcc/config/netbsd-elf.h	2010-12-01 17:28:26.000000000 -0800
@@ -73,7 +73,7 @@  along with GCC; see the file COPYING3.  
    %{!shared: \
      -dc -dp \
      %{!nostdlib: \
-       %{!r*: \
+       %{!r: \
 	 %{!e*:-e %(netbsd_entry_point)}}} \
      %{!static: \
        %{rdynamic:-export-dynamic} \
diff -rupN --exclude=.svn gcc-mainline-5/gcc/config/sparc/openbsd64.h gcc-mainline/gcc/config/sparc/openbsd64.h
--- gcc-mainline-5/gcc/config/sparc/openbsd64.h	2010-12-01 17:33:46.000000000 -0800
+++ gcc-mainline/gcc/config/sparc/openbsd64.h	2010-12-01 17:29:28.000000000 -0800
@@ -72,7 +72,7 @@  along with GCC; see the file COPYING3.  
 
 #undef LINK_SPEC
 #define LINK_SPEC \
-  "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
+  "%{!shared:%{!nostdlib:%{!r:%{!e*:-e __start}}}} \
    %{shared:-shared} %{R*} \
    %{static:-Bstatic} \
    %{!static:-Bdynamic} \
diff -rupN --exclude=.svn gcc-mainline-5/gcc/config/vax/netbsd-elf.h gcc-mainline/gcc/config/vax/netbsd-elf.h
--- gcc-mainline-5/gcc/config/vax/netbsd-elf.h	2009-10-07 09:35:30.000000000 -0700
+++ gcc-mainline/gcc/config/vax/netbsd-elf.h	2010-12-01 17:29:44.000000000 -0800
@@ -1,6 +1,6 @@ 
 /* Definitions of target machine for GNU compiler,
    for NetBSD/vax ELF systems.
-   Copyright (C) 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -52,7 +52,7 @@  along with GCC; see the file COPYING3.  
    %{!shared: \
      -dc -dp \
      %{!nostdlib: \
-       %{!r*: \
+       %{!r: \
 	 %{!e*:-e %(netbsd_entry_point)}}} \
      %{!static:-static} \
      %{static:-static}}"