This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gold patch committed: Fix test for gcc < 4.3


Constructor/destructor priorities were introduced in gcc 4.3.  gold
will work if built with gcc 4.2, but the test for constructor
priorities will not.  I committed this patch to disable the test if
building with a version of gcc before 4.3.  This also fixes the file
comment.

Ian


2009-09-26  Ian Lance Taylor  <iant@google.com>

	* testsuite/initpri1.c: Don't try to use constructor priorities if
	compiling with gcc before 4.3.


Index: testsuite/initpri1.c
===================================================================
RCS file: /cvs/src/src/gold/testsuite/initpri1.c,v
retrieving revision 1.3
diff -u -r1.3 initpri1.c
--- testsuite/initpri1.c	9 Dec 2008 16:03:47 -0000	1.3
+++ testsuite/initpri1.c	27 Sep 2009 05:18:39 -0000
@@ -1,6 +1,6 @@
 /* initpri1.c -- test constructor priorities.
 
-   Copyright 2007, 2008 Free Software Foundation, Inc.
+   Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
    Copied from the gcc testsuite, where the test was contributed by
    Mark Mitchell <mark@codesourcery.com>.
 
@@ -19,14 +19,16 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-   MA 02110-1301, USA.
+   MA 02110-1301, USA.  */
 
-   This is a test of a common symbol in the main program and a
-   versioned symbol in a shared library.  The common symbol in the
-   main program should override the shared library symbol.  */
+/* This tests that the linker handles constructor and destructor
+   priorities correctly.  */
 
 #include <stdlib.h>
 
+/* Constructor priorities in attributes were added in gcc 4.3.  */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)
+
 int i;
 int j;
 
@@ -93,3 +95,11 @@
     abort ();
   return 0;
 }
+
+#else /* !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) */
+
+int main (void) {
+  exit (0);
+}
+
+#endif /* !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]