From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2298 invoked by alias); 19 Sep 2012 02:51:50 -0000 Received: (qmail 2289 invoked by uid 22791); 19 Sep 2012 02:51:48 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ie0-f169.google.com (HELO mail-ie0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Sep 2012 02:51:34 +0000 Received: by ied10 with SMTP id 10so927393ied.0 for ; Tue, 18 Sep 2012 19:51:34 -0700 (PDT) Received: by 10.50.190.230 with SMTP id gt6mr1686157igc.49.1348023093970; Tue, 18 Sep 2012 19:51:33 -0700 (PDT) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPS id cu10sm2633498igc.9.2012.09.18.19.51.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 19:51:33 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 376C2EA337A; Wed, 19 Sep 2012 12:21:28 +0930 (CST) Date: Wed, 19 Sep 2012 02:51:00 -0000 From: Alan Modra To: Andrew Burgess Cc: binutils@sourceware.org Subject: Re: [PATCH] Re: Linker script values as absolute / relative / number confusion Message-ID: <20120919025127.GB3194@bubble.grove.modra.org> Mail-Followup-To: Andrew Burgess , binutils@sourceware.org References: <5053596A.9080506@broadcom.com> <5053B555.7070108@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5053B555.7070108@broadcom.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-09/txt/msg00231.txt.bz2 On Fri, Sep 14, 2012 at 11:53:09PM +0100, Andrew Burgess wrote: > 2012-09-14 Andrew Burgess > > * ld-scripts/assign-loc.d: New file. Test for assigning absolute > symbol to location counter. > * ld-scripts/assign-loc.t: New file. Linker script for above > test. > * ld-scripts/expr.exp: Add new assignment test. Tests like this one need a little more work to ensure they pass on targets other than i686-linux. Applied as follows. Index: ld/testsuite/ld-scripts/assign-loc.d =================================================================== RCS file: ld/testsuite/ld-scripts/assign-loc.d diff -N ld/testsuite/ld-scripts/assign-loc.d --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld/testsuite/ld-scripts/assign-loc.d 19 Sep 2012 02:46:53 -0000 @@ -0,0 +1,11 @@ +#ld: -T assign-loc.t +#source: data.s +#nm: -n +#notarget: rs6000-*-aix* +#... +0+0100 A HEAP_SIZE +#... +0+2000 [AB] _start +#... +0+2100 [AB] _end +#pass Index: ld/testsuite/ld-scripts/assign-loc.t =================================================================== RCS file: ld/testsuite/ld-scripts/assign-loc.t diff -N ld/testsuite/ld-scripts/assign-loc.t --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld/testsuite/ld-scripts/assign-loc.t 19 Sep 2012 02:46:53 -0000 @@ -0,0 +1,17 @@ +SECTIONS +{ + . = 0x2000 ; + + _start = .; + + HEAP_SIZE = 0x100; + + .heap : { + . = HEAP_SIZE; + . = ALIGN(4); + } + + _end = .; + + /DISCARD/ : { *(*) } +} Index: ld/testsuite/ld-scripts/expr.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-scripts/expr.exp,v retrieving revision 1.4 diff -u -p -r1.4 expr.exp --- ld/testsuite/ld-scripts/expr.exp 23 Jan 2011 03:29:29 -0000 1.4 +++ ld/testsuite/ld-scripts/expr.exp 19 Sep 2012 02:46:53 -0000 @@ -23,3 +23,4 @@ run_dump_test expr1 run_dump_test expr2 run_dump_test sane1 +run_dump_test assign-loc -- Alan Modra Australia Development Lab, IBM