From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by sourceware.org (Postfix) with ESMTPS id 0BE21384C002 for ; Thu, 9 Sep 2021 07:18:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0BE21384C002 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=denx.de Received: from ktm (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1E9A0822D7; Thu, 9 Sep 2021 09:18:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1631171892; bh=Jv7kZ0FvcCoj98X3zL3/0ATtJG1vzbERtH6C5t0FQMg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Pavnpr7X5P7O8tOlz02xVKtIuUE6W3UyFZS/vnylx9UmARudC2O6X5xZSFytguMz8 eSau1IS76QiVqBKcOyuMC99fG7JTTpYfGfi6OUQzhblH06HqXf/MR6Xpy2psv8l85P i5DAc2YYu3PNnbq/L0UcQW9JsKiUe+4+geZ6UFdeO+k2S7eZ1+Sw/8N3xXrFzcy1Q/ NxGneKuYEpAMtf3UEQdZXLt356PO9ShNNuZ1ytki3QLEDPAd+1PkkUC4dj3QQ1G/Yy ANG9DPPYkyakFLfLCmBOgYodLGZ1kQ6PDT37yT3VtpZIbm35pbUkGiX8ZLJDKUhk8x 0xwNUNGltayaw== Date: Thu, 9 Sep 2021 09:18:06 +0200 From: Lukasz Majewski To: Adhemerval Zanella Cc: Florian Weimer , libc-alpha , Joseph Myers Subject: Re: [PATCH] dl: Use "adr" assembler command to get proper load address Message-ID: <20210909091806.25d6ac87@ktm> In-Reply-To: <20210908223421.3befe316@ktm> References: <20210907131616.23472-1-lukma@denx.de> <20210907164906.yt6nonvfyhvbrx6p@google.com> <20210907193227.6047f9cc@ktm> <20210907174417.sctsswphsyae4mpc@google.com> <20210908170524.4be44bf0@ktm> <16812ef5-e21b-ba69-7ee7-a0c5a094ad01@linaro.org> <20210908223421.3befe316@ktm> Organization: denx.de X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Nd8ok1IAVotYPGd7T4uRm/0"; protocol="application/pgp-signature" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 07:18:16 -0000 --Sig_/Nd8ok1IAVotYPGd7T4uRm/0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 8 Sep 2021 22:34:21 +0200 Lukasz Majewski wrote: > Hi Adhemerval, >=20 > > On 08/09/2021 12:05, Lukasz Majewski wrote: =20 > > >=20 > > > The r1 gets the 0xffffee80 (negative offset) value. It is then > > > added to pc and used to calculate r2. > > >=20 > > > For working code (with this patch applied) - there are NO such > > > large values (like aforementioned 0xffffee80). The arithmetic is > > > done on=20 > > >=20 > > > 1690: 00000020 .word 0x00000020 > > > 1694: 0002be7e .word 0x0002be7e > > >=20 > > > which seems to work. > > >=20 > > > This shouldn't be a problem as with U2 the arithmetic shall work. > > > However, I've noticed (with passing LD_DEBUG=3Dall) that the > > > ld-linux-armhf.so.3 (and init) are relocated twice before > > > execution. > > >=20 > > > Why do we need to relocate it? > > >=20 > > > Another question is why on this particular case the large (i.e. > > > negative) offset matters? =20 > >=20 > > I think it is highly unlikely the negative offset plays any role > > here. Do you have a working example to trigger this issue? =20 >=20 > I'm just using QEMU (runqemu -d y2038-image-devel nographic) from > meta-y2038 build. >=20 > Recent versions:=20 > poky: SHA1: 1e2e9a84d6dd81d7f6dd69c0d119d0149d10ade1 > qemu_6.0.0 > binutils_2.37 > gcc_11.2 >=20 > The QEMU board uses Cortex-A9 core. I've updated the poky to be the newest -master: master:50293eec9a7d0602b748220ab100b070b8d3432a No change. I will try the same setup with Cortex-A5 core - maybe there is some kind of subtle handling of such emulation in qemu? >=20 > > I am currently > > testing arm for different compilers (gcc 6.2, gcc 10, gcc 11) and > > with different configurations (armv5, armv6, armv7, with and without > > thumb) and I haven't see any issue so far. > >=20 > > It might binutils related, which version are you using? =20 >=20 >=20 >=20 >=20 > Best regards, >=20 > Lukasz Majewski >=20 > -- >=20 > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: > lukma@denx.de Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/Nd8ok1IAVotYPGd7T4uRm/0 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmE5tS4ACgkQAR8vZIA0 zr1Qmgf9EjubaiAY3UHqtLdcu9cKXL92CD0w+PygxjT9UAbFdnFRN06a1dr2vA3g JJHtycw/IpesLzD/EX3LugNc/jsK+GqJXOqOru7Y28OrLPiS7Ztv/5NPp1gS/A/z rCFGMtymUSIitzQiBg9DbBVGtZRy5mO8F1IyQHmjQcc810DjcUx0joukOvuULH5i PWCxOLml6s/JRa0gm4+Al/ExWW0yLqF4TEO6lAfawDKYZ/8IXOrRCIj5pDKM9jpY 5kZ3iOnqZ9qNBi6rkq/nqjOZLWLsJtZ8vIGSzwfp8d6p9x6x4cKEv4bpdBgs9R4F 8bd7OWpKaHVeVblU4VA2+wqSLGxpTg== =Ns5e -----END PGP SIGNATURE----- --Sig_/Nd8ok1IAVotYPGd7T4uRm/0--