From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11602 invoked by alias); 11 May 2011 12:31:16 -0000 Received: (qmail 11588 invoked by uid 22791); 11 May 2011 12:31:15 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 May 2011 12:31:00 +0000 Received: (qmail 31059 invoked from network); 11 May 2011 12:30:59 -0000 Received: from unknown (HELO ?84.152.216.116?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 May 2011 12:30:59 -0000 Message-ID: <4DCA815E.7000803@codesourcery.com> Date: Wed, 11 May 2011 12:31:00 -0000 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110505 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: binutils@sources.redhat.com, Paul Brook , "Joseph S. Myers" Subject: Re: Fix ld testcases on c6x References: <4DCA6E9F.3030409@codesourcery.com> <20110511115605.GF3625@bubble.grove.modra.org> In-Reply-To: <20110511115605.GF3625@bubble.grove.modra.org> Content-Type: multipart/mixed; boundary="------------080206030901040900080309" 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: 2011-05/txt/msg00148.txt.bz2 This is a multi-part message in MIME format. --------------080206030901040900080309 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 718 On 05/11/2011 01:56 PM, Alan Modra wrote: > On Wed, May 11, 2011 at 01:10:23PM +0200, Bernd Schmidt wrote: >> +if { ![ld_assemble $as "$as_opt $srcdir/$subdir/tbss.s" tmpdir/tbss.o ] >> + || ![ld_assemble $as "$as_opt $srcdir/$subdir/frame.s" tmpdir/frame.o] } > > Passing options like this in the "source" parameter of ld_assemble > isn't the cleanest way. I just followed lib/ld-lib.exp. I must say I dislike using ASFLAGS as in ld-frv/tls.exp; it seems more error-prone since it has to be restored at every return. So I went the other route and added a ld_assemble_flags function. I'll give you some time to object to this version and check it in as preapproved later today if I don't hear otherwise. Bernd --------------080206030901040900080309 Content-Type: text/plain; name="as-flags.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="as-flags.diff" Content-length: 5563 * config/default.exp (ld_assemble): Pass flags parameter to default_ld_assemble. (ld_assemble_flags): New function. * ld-elf/frame.exp: Pass -mpic and -mpid flags to the assembler on tic6x. * ld-elf/exclude.exp: Likewise. * lib/ld-lib.exp (default_ld_assemble): Take extra argument in_flags and pass it to the assembler. Index: ld/testsuite/config/default.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/config/default.exp,v retrieving revision 1.15 diff -c -p -r1.15 default.exp *** ld/testsuite/config/default.exp 2 Sep 2009 07:25:37 -0000 1.15 --- ld/testsuite/config/default.exp 11 May 2011 12:26:58 -0000 *************** proc ld_compile { cc source object } { *** 205,211 **** # assemble a file # proc ld_assemble { as source object } { ! default_ld_assemble $as $source $object } # --- 205,219 ---- # assemble a file # proc ld_assemble { as source object } { ! default_ld_assemble $as "" $source $object ! } ! ! # ! # ld_assemble_flags ! # assemble a file with extra flags ! # ! proc ld_assemble_flags { as flags source object } { ! default_ld_assemble $as $flags $source $object } # Index: ld/testsuite/ld-elf/exclude.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-elf/exclude.exp,v retrieving revision 1.7 diff -c -p -r1.7 exclude.exp *** ld/testsuite/ld-elf/exclude.exp 2 Sep 2009 07:25:39 -0000 1.7 --- ld/testsuite/ld-elf/exclude.exp 11 May 2011 12:26:58 -0000 *************** if { [istarget "mcore-*-*"] } { *** 31,36 **** --- 31,44 ---- return } + set as_opt "" + + # This target requires extra as options when building code for shared + # libraries. + if { [istarget "tic6x-*-*"] } { + set as_opt "-mpic -mpid=near" + } + global ar global as global ld *************** set test7 "ld exclude symbols from archi *** 47,54 **** set test8 "ld exclude symbols from archive - --exclude-libs foo,libexclude.a" set test9 "ld don't exclude symbols from archive - --exclude-libs foo:bar" ! if { ![ld_assemble $as $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ] ! || ![ld_assemble $as $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } { unresolved $test1 return } --- 55,62 ---- set test8 "ld exclude symbols from archive - --exclude-libs foo,libexclude.a" set test9 "ld don't exclude symbols from archive - --exclude-libs foo:bar" ! if { ![ld_assemble_flags $as $as_opt $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ] ! || ![ld_assemble_flags $as $as_opt $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } { unresolved $test1 return } Index: ld/testsuite/ld-elf/frame.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-elf/frame.exp,v retrieving revision 1.8 diff -c -p -r1.8 frame.exp *** ld/testsuite/ld-elf/frame.exp 2 Sep 2009 07:25:39 -0000 1.8 --- ld/testsuite/ld-elf/frame.exp 11 May 2011 12:26:58 -0000 *************** if { [istarget "hppa64-*-*"] || [istarge *** 44,57 **** return } set test1 "read-only .eh_frame section" set test2 "read-only .gcc_except_table section" global as global ld ! if { ![ld_assemble $as $srcdir/$subdir/tbss.s tmpdir/tbss.o ] ! || ![ld_assemble $as $srcdir/$subdir/frame.s tmpdir/frame.o] } { unresolved "$test1" return } --- 44,65 ---- return } + set as_opt "" + + # This target requires extra as options when building code for shared + # libraries. + if { [istarget "tic6x-*-*"] } { + set as_opt "-mpic -mpid=near" + } + set test1 "read-only .eh_frame section" set test2 "read-only .gcc_except_table section" global as global ld ! if { ![ld_assemble_flags $as $as_opt $srcdir/$subdir/tbss.s tmpdir/tbss.o ] ! || ![ld_assemble_flags $as $as_opt $srcdir/$subdir/frame.s tmpdir/frame.o] } { unresolved "$test1" return } *************** if { [ld_simple_link $ld tmpdir/frame.so *** 66,72 **** } } ! if ![ld_assemble $as $srcdir/$subdir/table.s tmpdir/table.o ] { unresolved "$test2" return } --- 74,80 ---- } } ! if ![ld_assemble_flags $as $as_opt $srcdir/$subdir/table.s tmpdir/table.o ] { unresolved "$test2" return } Index: ld/testsuite/lib/ld-lib.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v retrieving revision 1.80 diff -c -p -r1.80 ld-lib.exp *** ld/testsuite/lib/ld-lib.exp 6 Apr 2011 17:09:56 -0000 1.80 --- ld/testsuite/lib/ld-lib.exp 11 May 2011 12:26:59 -0000 *************** proc default_ld_compile { cc source obje *** 295,308 **** # Assemble a file. # ! proc default_ld_assemble { as source object } { global ASFLAGS global host_triplet if ![info exists ASFLAGS] { set ASFLAGS "" } set flags [big_or_little_endian] ! set exec_output [run_host_cmd "$as" "$flags $ASFLAGS -o $object $source"] set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { return 1 --- 295,308 ---- # Assemble a file. # ! proc default_ld_assemble { as in_flags source object } { global ASFLAGS global host_triplet if ![info exists ASFLAGS] { set ASFLAGS "" } set flags [big_or_little_endian] ! set exec_output [run_host_cmd "$as" "$flags $in_flags $ASFLAGS -o $object $source"] set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { return 1 --------------080206030901040900080309--