From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by sourceware.org (Postfix) with ESMTPS id 1BA543858C2C for ; Thu, 9 Sep 2021 09:49:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1BA543858C2C 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 2A5FB83208; Thu, 9 Sep 2021 11:49:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1631180985; bh=6irfa1zGkRcDc91zxsJvA4lCkpYfbyrqKvIIQPauZ+o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ro6t7cZy61ShkRW4ruXwTD/MntmKj8Ql8HJGRzMS6sGgMBYH3+aa8ZfjeeGSsUjmu F11NwuIKv1NK+NmeBHumONCyb3CNkdn+l0z1KZWJtQZEASZmNcaCxMT64VEzJlMG3U QH7YQpZ3jwmd865qQ88ctvs1ec5T8vljB2nqSiEa0FoLgEJXpkYDeMdz9EvFPaMo1v G2Q+sZbns6vM88jwyupQi0W3shHD6U/GzbHSF/tmzwi/sVv3IEhvq8oC/FDQSGqeXd KOYcHTljpgeaQopFaC9szAzS32IdcHqjKbmNF1EFtpvwZdtU34lGBH2qD2hREbckjR t9o7jfAq9ZkVw== Date: Thu, 9 Sep 2021 11:49:36 +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: <20210909114936.318c22c8@ktm> In-Reply-To: <20210909091806.25d6ac87@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> <20210909091806.25d6ac87@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_/fjM/KAxGj7bOVwHUUhfUvWY"; 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=-3.3 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 09:49:50 -0000 --Sig_/fjM/KAxGj7bOVwHUUhfUvWY Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 9 Sep 2021 09:18:06 +0200 Lukasz Majewski wrote: > On Wed, 8 Sep 2021 22:34:21 +0200 > Lukasz Majewski wrote: >=20 > > 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. =20 >=20 > I've updated the poky to be the newest -master: > master:50293eec9a7d0602b748220ab100b070b8d3432a >=20 > No change. >=20 > I will try the same setup with Cortex-A5 core - maybe there is some > kind of subtle handling of such emulation in qemu? No change. On the qemuarm yocto/OE MACHINE the same situation is observed. After applying this patch the board works without issues. >=20 > > =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 =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_/fjM/KAxGj7bOVwHUUhfUvWY Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmE52LAACgkQAR8vZIA0 zr28JQf/c1SZBYOzVL1XicfoZ03k48XUaBQpwT5LdW4VkHPMcBaEV8pVLPC8oLd4 iI44mndctBqPinoCc+rixwgN8cU6d9spwae+4/jQEPInIpvTQEEF5eidYrJcr2pO S8VFu2VISBCx1KP9GRefW8YOnFNIrfQxeflwuT+zFfJ23LVOqaq5+FS6HEiHPtA1 uaCwLGYU0ZmkSTinn6O4OSrDeF+LfTq/6PIi/JoPRhG89MCNRswBwHcUsPuS3mtF zBj6L2zU6XPMd3fArHvn2BDStTfjWTxEQHXEAdir0FSIVYruBVS+1qn41nwGIizP lM3Uv2tcXahvTOBztjckpBKCPuhsEA== =PZZx -----END PGP SIGNATURE----- --Sig_/fjM/KAxGj7bOVwHUUhfUvWY--