From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from 6.mo576.mail-out.ovh.net (6.mo576.mail-out.ovh.net [46.105.50.107]) by sourceware.org (Postfix) with ESMTPS id F1EB93858D39 for ; Wed, 6 Dec 2023 15:03:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F1EB93858D39 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=microej.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=microej.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F1EB93858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=46.105.50.107 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701874988; cv=none; b=YPtZ3nYS7LxdDY42HkUyz1mB4gV5Ask8E0cgyZHbUHTq0eVs1qMuUAkgHC5tzums8xfOp8C6l5Qv3Ryef+QSW3kpdcRCKIDJ/qYIrEaukV6vYtnJI3y3CEps9nzCwiknoWO717FKq3qhXCO/NErIG69OfqZpzSMtMatFq0kwLL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701874988; c=relaxed/simple; bh=Z/7RbbjA4SdIpknJP0L1gAxOzRihAkvt88X67gKHfD0=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=MpRSnHzhrfkzg6M5PR8dxnikh68B9HLF8ZEfIJNAD7gmYDKmYmrsyun6BcLzX0rOj6C6xK2XsveKNH3eYLl5G1SNOxLMnXuMs891jmFgyMDfVZu5BLib92lfj+DG8gBvG+GgA+QWIjxFmnLHzZeknginS+wgIWM7ixM1Qh2LTw8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from director4.ghost.mail-out.ovh.net (unknown [10.109.143.24]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 31B0B2D6A2 for ; Wed, 6 Dec 2023 15:03:03 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-k474b (unknown [10.108.4.11]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 0B101200AE; Wed, 6 Dec 2023 15:02:39 +0000 (UTC) Received: from microej.com ([37.59.142.102]) by ghost-submission-6684bf9d7b-k474b with ESMTPSA id 9csAABCNcGXy4wAALpJeWw (envelope-from ); Wed, 06 Dec 2023 15:02:39 +0000 Authentication-Results:garm.ovh; auth=pass (GARM-102R0049cc0f877-a3d6-48db-9864-a5955ef196f9, 51DDBF92C313336E30EE07866D3E4A42CBE0B09F) smtp.auth=frederic.riviere@microej.com X-OVh-ClientIp:92.154.86.223 Message-ID: <54acf602-44ed-4bc8-8652-5feb450195ee@microej.com> Date: Wed, 6 Dec 2023 16:02:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: load of in-place relocation addend in AArch64 Content-Language: en-US To: Nick Clifton References: <2747d24e-1331-4970-8660-421f4479dc62@redhat.com> From: =?UTF-8?B?RnLDqWTDqXJpYyBSaXZpw6hyZQ==?= Autocrypt: addr=frederic.riviere@microej.com; keydata= xsFNBFuDri0BEADAe942XdjQtiUKT0359QcDfvgXnoeHeIZDBoqPKQhBoX4oPW2FvlZ0iz6V vVD/EzQI4QCMWixEHmMaGKSKHwV9k5UVC55l9UNLO0biDuXUeZ4u4AtW4bV0kVoILdk2dR/o brd6zi71vrUlvmM+m9RSHzMaZocbnOpgI1zRP0Wf4Zwb/srG8jvrGD++rFvUtzphJUzjfSM+ 1FDRK9PS4W6wTdQobfIEffQKnHpT2ZrgR1gX0fHmWkaecMXn6cJv8BX5nPyGSgXYl/dwT93U 9KOtPWmEWShTKVoUbS6VwZKdKmflvuwkALY1ogSxzHteLIEt/IJFP4YY1JopEC4IK8tuv5wK QsReJI89vKlP2JZIv9h20jkzaVgZiAZ6UtzKk55rrYNA/idNX4p3M+1I6xZGOOYj/mTLD/AL FvjzQjSIx8ieGE8PcjvOeP74ce2ZaW85BuUC6mxZK67O6iZ0b/dg1TwZhQijCPPs3BAvMjCc lJBH8jkdmaeOZvBTXneNa5TB0juYffVkm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3f2UxRKvLNihJPAnjgilV8t/FNMtxUB0815ZuAPkm7l5/NbebyDuckqjt2 lp5z4Z3+s1ZH5fuD4uz1wC4jC79Uwr0EiN1FNUoPmpALaLjSdFn8AZ1NGYxGxdfU9gvKT6// o7/X8uoBE23fhG/tBgPcg6Kztml7Qx7Ox9MqKtvMJir8zdscb6LLaOzflmOk+ov8D5paiLoo pv57ay7oHet8kssho7V/oCV2JteKt5+W3WguQUZIpRr+dSjeQUoFZK570ZHS0DgKZoZDjK+j 2Ph3q2GwWnQFxgBEaEloR9R1r3qT33o= Cc: binutils@sourceware.org In-Reply-To: <2747d24e-1331-4970-8660-421f4479dc62@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 10164624362713718548 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrudektddgjeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhvegjtgfgsehtkeertddtvdejnecuhfhrohhmpefhrhorugorrhhitgcutfhivhhiqohrvgcuoehfrhgvuggvrhhitgdrrhhivhhivghrvgesmhhitghrohgvjhdrtghomheqnecuggftrfgrthhtvghrnhepteetteetgeeuteevjedvtdehkeejgeffffelveegffejieekgeetudejffduieeknecukfhppeduvdejrddtrddtrddupdelvddrudehgedrkeeirddvvdefpdefjedrheelrddugedvrddutddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeofhhrvgguvghrihgtrdhrihhvihgvrhgvsehmihgtrhhovghjrdgtohhmqedpnhgspghrtghpthhtohepuddprhgtphhtthhopegsihhnuhhtihhlshesshhouhhrtggvfigrrhgvrdhorhhgpdfovfetjfhoshhtpehmohehjeeipdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,BODY_8BITS,KAM_DMARC_STATUS,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Nick, Thanks for the quick reply. My compiler generates REL relocations because I was just naively following the official AArch64 ABI. I understand that RELA is more easy to manage since there is no need to retrieve the source section for getting the addend. However, I believe that ld AArch64 should not support REL entries at all (with a clear error message) instead of silently generating a wrong object file. Finally, I just updated my compiler to generate RELA and now it works fine. Best regards, --Frédéric On 12/6/2023 12:14 PM, Nick Clifton wrote: > Hi Frédéric, > >> My compiler generates REL relocations with an in-place addend but the >> addend is not taken into account for computing the final relocated >> symbol address (S+A). > > Is there any particular reason for this ? > > Ie, if your compiler generated RELA relocations then all of your problems > with the binutils should go away... > >> So it seems the that I'm the first one that generates REL relocations >> for AArch64 target. > > True. > >> However, I don't see any limitation on using REL relocations in the >> AARCH64 ABI. > > Correct.  There are - in theory - allowed. > >> I would appreciate any comment/feedback that would help me >> understanding the reasons behind that. > > As a general rule RELA relocations are preferable in that they > are simpler - it is easier to extract the addend - and in theory > they have the possibility to express a wider range of addends > than would be available to REL relocations. > > Have you tried modifying the AArch64 code in the BFD library to > support REL relocations ?  In theory all that you need to do is > to change a few lines in bfd/elfnn-aarch64.c: > >   #define elf_backend_may_use_rel_p      0 > > and maybe: > >   #define elf_backend_may_use_rela_p     1 >   #define elf_backend_default_use_rela_p 1 >   #define elf_backend_rela_normal     1 > > In practice I am pretty sure that there will be assumptions of RELA > relocs elsewhere in the AArch64 specific code, so I doubt it will be > as simple as I have suggested. > > Cheers >   Nick