From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20797 invoked by alias); 21 Oct 2010 18:21:48 -0000 Received: (qmail 20787 invoked by uid 22791); 21 Oct 2010 18:21:46 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.accesssoftek.com (HELO mail.accesssoftek.com) (63.145.236.71) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Oct 2010 18:21:36 +0000 Received: from [192.168.159.184] (172.16.0.1) by mail.accesssoftek.com (172.16.0.71) with Microsoft SMTP Server id 8.2.254.0; Thu, 21 Oct 2010 11:21:34 -0700 Subject: Re: [GOLD][PATCH] Fix a sort order breakage of the zero-length script output sections. From: Viktor Kutuzov Reply-To: To: Ian Lance Taylor CC: binutils In-Reply-To: References: <1286572778.1642.3200.camel@dp690-dev5v11.accesssoftek.com> Content-Type: multipart/mixed; boundary="=-yWoG+/bmXd2x8NRQK4QC" Date: Thu, 21 Oct 2010 18:21:00 -0000 Message-ID: <1287685291.1648.31.camel@dp690-dev5v11.accesssoftek.com> MIME-Version: 1.0 Received-SPF: None (mail.accesssoftek.com: vkutuzov@accesssoftek.com does not designate permitted sender hosts) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00350.txt.bz2 --=-yWoG+/bmXd2x8NRQK4QC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 2522 Hi Ian, we should move the gcctestdir/ld rule from NATIVE_LINKER section to have a chance to use the tested linker outside of this section (with script_test_10 in our case). I guess that a place within NATIVE_OR_CROSS_LINKER will be optimal for this rule to make it available for the both cases. I have attached a patch with these changes. Thanks. -Viktor. * testsuite/Makefile.am: Move gcctestdir/ld rule to NATIVE_OR_CROSS_LINKER. * testsuite/Makefile.in: Regenerate. On Tue, 2010-10-12 at 12:24 -0700, Ian Lance Taylor wrote: > Viktor Kutuzov writes: > > > * configure.ac: Add NATIVE_OR_CROSS_LINKER condition macro. > > * configure: Regenerate. > > * testsuite/Makefile.am: Wrap the cross linker tests and the common > > tests into NATIVE_OR_CROSS_LINKER; > > Add the script section order test. > > * testsuite/Makefile.in: Regenerate. > > * testsuite/script_test_10.sh: New test. Test script section > > order. > > * testsuite/script_test_10.t: Likewise. > > * testsuite/script_test_10.s: Likewise. > > * script-sections.h (Script_sections): Sections_elements as public; > > Add a new member to save a list of the section elements. > > (Sort_output_sections::ctor): Add new parameter to pass a list > > of the section elements. > > * script-sections.cc (Sort_output_sections::swap): New method. > > Approved and applied with some changes to script-sections.cc and > testsuite/Makefile.am, as follows. > > Thanks. > > Ian > > > 2010-10-12 Viktor Kutuzov > > * script-sections.h (class Script_sections): Make > Sections_elements typedef public. > * script-sections.cc (class Sort_output_sections): Add elements_ > field. Add constructor which sets it; change all callers. > (Sort_output_sections::is_before): New function. > (Sort_output_sections::operator()): Call is_before. > * configure.ac (NATIVE_OR_CROSS_LINKER): New automake > conditional. > * testsuite/script_test_10.sh: New test. Test script section > order. > * testsuite/script_test_10.t: Likewise. > * testsuite/script_test_10.s: Likewise. > * testsuite/Makefile.am: Wrap the cross linker tests and the > common tests into NATIVE_OR_CROSS_LINKER. > (check_SCRIPTS): Add script_test_10.sh. > (check_DATA): Add script_test_10.stdout. > (script_test_10.o, script_test_10): New targets. > (script_test_10.stdout): New target. > * configure, testsuite/Makefile.in: Regenerate. > > --=-yWoG+/bmXd2x8NRQK4QC Content-Disposition: attachment; filename="binutils-gold-testsuite-gcctestdir-ld-fix.patch" Content-Type: text/x-patch; name="binutils-gold-testsuite-gcctestdir-ld-fix.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 3481 Index: gold/testsuite/Makefile.am =================================================================== RCS file: /cvs/src/src/gold/testsuite/Makefile.am,v retrieving revision 1.151 diff -u -r1.151 Makefile.am --- gold/testsuite/Makefile.am 16 Oct 2010 00:37:25 -0000 1.151 +++ gold/testsuite/Makefile.am 21 Oct 2010 17:32:19 -0000 @@ -71,6 +71,17 @@ # The unittests themselves if NATIVE_OR_CROSS_LINKER +if GCC + +# Infrastucture needed for the unittests: a directory where the linker +# is named 'ld'. This is because the -B flag appends 'ld' to its arg. +gcctestdir/ld: ../ld-new + test -d gcctestdir || mkdir -p gcctestdir + rm -f gcctestdir/ld + (cd gcctestdir && $(LN_S) ../../ld-new ld) + +endif GCC + check_PROGRAMS += object_unittest object_unittest_SOURCES = object_unittest.cc @@ -91,13 +102,6 @@ if NATIVE_LINKER if GCC -# Infrastucture needed for the unittests: a directory where the linker -# is named 'ld'. This is because the -B flag appends 'ld' to its arg. -gcctestdir/ld: ../ld-new - test -d gcctestdir || mkdir -p gcctestdir - rm -f gcctestdir/ld - (cd gcctestdir && $(LN_S) ../../ld-new ld) - # Each of these .o's is a useful, small complete program. They're # particularly useful for making sure ld-new's flags do what they're # supposed to (hence their names), but are used for many tests that Index: gold/testsuite/Makefile.in =================================================================== RCS file: /cvs/src/src/gold/testsuite/Makefile.in,v retrieving revision 1.160 diff -u -r1.160 Makefile.in --- gold/testsuite/Makefile.in 16 Oct 2010 00:37:25 -0000 1.160 +++ gold/testsuite/Makefile.in 21 Oct 2010 17:32:22 -0000 @@ -48,8 +48,6 @@ $(am__EXEEXT_16) $(am__EXEEXT_17) $(am__EXEEXT_18) \ $(am__EXEEXT_19) $(am__EXEEXT_20) $(am__EXEEXT_21) \ $(am__EXEEXT_22) - -# The unittests themselves @NATIVE_OR_CROSS_LINKER_TRUE@am__append_1 = object_unittest \ @NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest @@ -3760,6 +3758,15 @@ recheck recheck-html tags uninstall uninstall-am +# The unittests themselves + +# Infrastucture needed for the unittests: a directory where the linker +# is named 'ld'. This is because the -B flag appends 'ld' to its arg. +@GCC_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@gcctestdir/ld: ../ld-new +@GCC_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ test -d gcctestdir || mkdir -p gcctestdir +@GCC_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ rm -f gcctestdir/ld +@GCC_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ (cd gcctestdir && $(LN_S) ../../ld-new ld) + # --------------------------------------------------------------------- # These tests test the output of gold (end-to-end tests). In # particular, they make sure that gold can link "difficult" object @@ -3769,13 +3776,6 @@ # tests. We use the gcc-specific flag '-B' to use our linker instead # of the default linker, which is why we only run our tests under gcc. -# Infrastucture needed for the unittests: a directory where the linker -# is named 'ld'. This is because the -B flag appends 'ld' to its arg. -@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir/ld: ../ld-new -@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d gcctestdir || mkdir -p gcctestdir -@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f gcctestdir/ld -@GCC_TRUE@@NATIVE_LINKER_TRUE@ (cd gcctestdir && $(LN_S) ../../ld-new ld) - # Each of these .o's is a useful, small complete program. They're # particularly useful for making sure ld-new's flags do what they're # supposed to (hence their names), but are used for many tests that --=-yWoG+/bmXd2x8NRQK4QC--