From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17773 invoked by alias); 5 Mar 2020 00:49:26 -0000 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 Received: (qmail 17760 invoked by uid 89); 5 Mar 2020 00:49:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=learning, HX-Languages-Length:773, our X-HELO: mail-pl1-f181.google.com Received: from mail-pl1-f181.google.com (HELO mail-pl1-f181.google.com) (209.85.214.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Mar 2020 00:49:24 +0000 Received: by mail-pl1-f181.google.com with SMTP id j20so1437963pll.6 for ; Wed, 04 Mar 2020 16:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Qpfn2fgVlVJMvNuGXhswch7ZevtrAq8QkVwfT8ivAY8=; b=jnro3P0WvNEsjZsZ+Sqpq2tf+H1eKZIfqDCiEmVE7slJ6Y9ZUQqygh5CrbxijajHeE l809f9GZErGMaNX8yLrrlWlPCdwSVZR+xXm8nyqc4wM+SXd+ePwk/fHmQdSGUb+ES+t4 rtwt0ZhjmsVRlIqX3ko55h4JjoB9nHUJJ8iSfDJfoOrvctUldEc61jT8bv6tYR/bpiSP TSaHdZ21JFmQjt2Bvpi0zQz7wjWhms8mn3vQh4GrhSL3aPSf6RvWGIEgtg/n9oxztsSN kgppm6cYw5FqPQCwHXEsOUMR3f/YJsKaTFqNaXhHcnLSw+olLaxO9C6fBCqmSotv3jaG e8+Q== Return-Path: Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:984a:84b1:7f51:cff7]) by smtp.gmail.com with ESMTPSA id i5sm11221606pfo.173.2020.03.04.16.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 16:49:22 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 142A080D59; Thu, 5 Mar 2020 11:19:19 +1030 (ACDT) Date: Thu, 05 Mar 2020 00:49:00 -0000 From: Alan Modra To: William Tambe Cc: Binutils Subject: Re: GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix() Message-ID: <20200305004918.GZ5384@bubble.grove.modra.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00109.txt On Tue, Mar 03, 2020 at 11:02:55PM -0500, William Tambe wrote: > In our Binutils port, GAS relaxing is done implementing md_relax_frag() > such that the displacement used to generate the growth amount to return > is computed using: > ((S_GET_VALUE (symbolP) + fragP->fr_offset) - > (fragP->fr_address + fragP->fr_fix)); > > However, during md_apply_fix(), the same displacement value is greatly > different, causing it not to fit in the relocation fix estimated > during md_relax_frag(). > > Any idea what could explain it ? A debugger is a great learning tool. Especially one with watchpoints. Use gdb to see where and how parts of fragP change. -- Alan Modra Australia Development Lab, IBM