From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 62B113858413 for ; Mon, 14 Feb 2022 13:35:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62B113858413 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-177-hwQigVNMPx-X5Zdsq1eJcA-1; Mon, 14 Feb 2022 08:35:15 -0500 X-MC-Unique: hwQigVNMPx-X5Zdsq1eJcA-1 Received: by mail-wr1-f70.google.com with SMTP id i10-20020adfaaca000000b001e4b2db0303so4953859wrc.23 for ; Mon, 14 Feb 2022 05:35:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=M68qbem1k9HNkWOWngOQ9cXUlT74z/UkNxijxYYVNWo=; b=iN7ImwiBjCOFYXDSkYD8W31NtrYnYUSatrLDGieJman3Auy69SGcU6PJvuDZ7wkc6r JZcY8NPaECZHTd3waTW05t0WaSZ1KOP0GH01Hv77J0vnXt3TFnIKUUS/ah49tAoPTzuv ZfeeoXSCZljyVUNPFWZpyDnVkCC5rcolE7hBPUAXYb266i/T0PBGSy8iVxGUhDXrBIen 9LHO6+nwbx85Up7XcZsGRowpfu55OE6z9ADsaJkmp7pzhlOnImUxZPnUeUUBirzHdP6f R2d/xNs3r8G1M2J6xYdplkm6yxddtwwydJa5A/LvwBxcMuhyQkI40BC6nacLDtMtWlil slEQ== X-Gm-Message-State: AOAM533yQntlpUms/DqQT3mKDioRDb+FqhxrbxUcDeBJuXPGe15VJ7uh qSUIpJ9GRtmKx0Br0D3ssh9pcl+a1AX0UJup9XkAePtsmvQ/wJn2XVhVR5cgVqp7pVJPNUZ70IQ V9c9kCGOrVjbqFuyHnQ== X-Received: by 2002:a05:6000:1c1d:: with SMTP id ba29mr8732781wrb.573.1644845714480; Mon, 14 Feb 2022 05:35:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAoingxweonT+eiY4lkLcdKJvUP32OxajnEwTwakISHqWwyPegy/s/ekaBiWNg+GZgY6Mc4A== X-Received: by 2002:a05:6000:1c1d:: with SMTP id ba29mr8732770wrb.573.1644845714280; Mon, 14 Feb 2022 05:35:14 -0800 (PST) Received: from [192.168.1.6] (adsl-2-solo-173-39.claranet.co.uk. [80.168.173.39]) by smtp.gmail.com with ESMTPSA id i9sm7923332wrf.79.2022.02.14.05.35.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 05:35:13 -0800 (PST) Message-ID: <84567b31-7ed1-a377-7d05-8b6596871ae7@redhat.com> Date: Mon, 14 Feb 2022 13:35:13 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: Jan Beulich Cc: Binutils References: <2b85b841-e617-618c-9a3d-50101faded80@suse.com> From: Nick Clifton Subject: Re: Arm64: assembling adrp with operand involving . In-Reply-To: <2b85b841-e617-618c-9a3d-50101faded80@suse.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2022 13:35:18 -0000 Hi Jan, > I would expect these two > > adrp x0, . > 1: adrp x0, 1b > > to assemble to the same encoding with similar attached relocations. Me too. > The first, however, appears to have evaluation of . deferred until the > end of assembly, i.e. the resulting operand depends on the number of > subsequent insns in the same source file. At a guess this is fallout > from eac4eb8ecb26 "Fix a problem assembling AArch64 sources when a > relocation is generated against a..." (for some reason the title is > truncated). That is because I put the rest of the description on a second line, sorry. The second line reads: generated against a symbol that has a defined value. The patch was created as a fix for PR 27217. > According to my observations other insns aren't affected, > yet the change to parse_adrp() doesn't really stand out in said commit. > Hence I'm neither really certain that's the one, nor how a possible fix > could look like. Do you have any thoughts? Well the change added a new argument to the ...get_expression() function, so all callers were updated. There was no specific intention to change parse_adrp for some other reason. Anyway - this does look like a bug, although I think that it might be restricted to just an unadorned reference to dot. ie: adrp x0, . 1: adrp x0, 1b adrp x0, . - 8 When assembled and then dumped, gives: 0000000000000000 <.text>: 0: 90000000 adrp x0, 0 <.text> 0: R_AARCH64_ADR_PREL_PG_HI21 .text+0xc 4: 90000000 adrp x0, 0 <.text> 4: R_AARCH64_ADR_PREL_PG_HI21 .text+0x4 8: 90000000 adrp x0, 0 <.text> 8: R_AARCH64_ADR_PREL_PG_HI21 .text+0x4 So the ". - 8" expression has evaluated correctly, but the "." expression has not. Would you care to open a BZ for this ? Cheers Nick