From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27440 invoked by alias); 30 Aug 2010 17:12:03 -0000 Received: (qmail 27409 invoked by uid 22791); 30 Aug 2010 17:11:57 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Aug 2010 17:11:52 +0000 Received: by wyb36 with SMTP id 36so8250378wyb.0 for ; Mon, 30 Aug 2010 10:11:49 -0700 (PDT) Received: by 10.227.145.203 with SMTP id e11mr5284116wbv.134.1283188309280; Mon, 30 Aug 2010 10:11:49 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk [82.133.89.107]) by mx.google.com with ESMTPS id a1sm6694177wbb.8.2010.08.30.10.11.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 30 Aug 2010 10:11:46 -0700 (PDT) From: Richard Sandiford To: "Maciej W. Rozycki" Mail-Followup-To: "Maciej W. Rozycki" ,binutils@sourceware.org, Catherine Moore , gnu-mips-sgxx@codesourcery.com, rdsandiford@googlemail.com Cc: binutils@sourceware.org, Catherine Moore , gnu-mips-sgxx@codesourcery.com Subject: Re: [PATCH 2/4] GAS: Make new fake labels when cloning a symbol References: <87wrscdo34.fsf@firetop.home> Date: Mon, 30 Aug 2010 17:53:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Fri, 27 Aug 2010 10:28:32 +0100 (BST)") Message-ID: <87tymct48i.fsf@firetop.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-08/txt/msg00375.txt.bz2 > @@ -645,18 +645,23 @@ symbol_clone_if_forward_ref (symbolS *sy > > /* Re-using sy_resolving here, as this routine cannot get called from > symbol resolution code. */ > - if (symbolP->bsym->section == expr_section && !symbolP->sy_resolving) > + if ((symbolP->bsym->section == expr_section > + || (!is_deferred && symbolP->sy_forward_ref)) > + && !symbolP->sy_resolving) Is the idea that if is_deferred is true, this function will be called again each time symbolP is used in another (non-deferred) expression, at which point the necessary cloning will happen? If so, why do we need to clone _any_ symbols in the deferred case? I.e. for: .eqv s2,s1 .eqv s3,s2 .eqv s4,s3 ... it seems that you're cloning: - s2, but not s1, for s3 - s3, but not s2, for s4 and so on. Couldn't we simply avoid calling symbol_clone_if_forward_ref in the deferred case, and leave all cloning to the point of use? The answer may well be "no". :-) I'm just trying to understand the reasoning. Whatever the answer is, I think it needs a comment. The first patch looks generally good otherwise, so hopefully any changes are just a mopping-up exercise. I'm still uneasy about the second patch though. Can you justify why the new test for "." is safe? An alternative might be to model "." as a single forward-reference symbol whose value is redefined before each instruction. I think that's what its semantics actually are. There would then be a single global symbol that represents ".", and that is marked as a forward reference. symbol_clone_if_forward_ref would return symbol_temp_new_now for that symbol, rather than go through the usual cloning process. Richard