From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6422CFC617E for ; Sat, 3 Jan 2026 14:07:34 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4dk2Sh3bjnz2yFk; Sun, 04 Jan 2026 01:07:32 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=63.228.1.57 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1767449252; cv=none; b=Zf1WMiBHJLMokjvUmRMofO5GqUoGKQXwNf8EdDlkJB+V1AZ0QDEQI+5jAt2yscfEVqyI3tOqGvwzGGB4WvN+A8V1nOl3aHUR6vHA2scHbZBHYuZK24ceiIWQZp+8aPaCYY+zio1prSPwmbA/cL4ilckCh6KB/X2AHfddV+j6PFILwjwlD/Cqizi1sB1axYzUZbFGijrWpa/A/CQIl/aJlm/ANwL7+5Nej40XYbnDE6Lumg0Dq7C54ryxIs+QDgN3cxyFs0dhGOmrNQOLM9gzvyHNG4/f5bqvsuANdL5R6869fEyY4w2kFQ9ghZ9C4bH8wWGcQ47f/mPHX+9TYb79Ug== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1767449252; c=relaxed/relaxed; bh=gPcIpdvOfHJ6rC9sFzXby3U4KzGXxS0/Yt+Xrq9Gwco=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HuvKGaSjfai2hWsrsopt4QgoUBdRFIK/kLgs//v6T4VdwSQuA9QmJ7sk9Y5xLWGSOh80YeleJovU7Rbql3RyfXb1JW4WYv9Prs9ZUeTDa/eWCalGVZFQwj3v+Y0XIrDjSWAPIuYTiCbIrDgPy6abjgf9Y8/NAFmVncAptsUh2XDq8iDQqfpO/hOariCziCjgEFNvu6if8yHaDtvdQijSyYQgcpB1Kn6np6yB8EL+kLkn++yq/WxhV+fj5XujOtoQLxhd4B2U/HE+iYzTOhQXU5jtA/9uEIO2kS5zep3M4t2ou69uhGFeWASExvnhmg7vC4sNv1MqrPkYDrdrJvW7iQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org; spf=pass (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=segher@kernel.crashing.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.crashing.org Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=segher@kernel.crashing.org; receiver=lists.ozlabs.org) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lists.ozlabs.org (Postfix) with ESMTP id 4dk2Sf6xcZz2yFd for ; Sun, 04 Jan 2026 01:07:25 +1100 (AEDT) Received: from gate.crashing.org (localhost [127.0.0.1]) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 603E6jce1357382; Sat, 3 Jan 2026 08:06:45 -0600 Received: (from segher@localhost) by gate.crashing.org (8.18.1/8.18.1/Submit) id 603E6gCl1357376; Sat, 3 Jan 2026 08:06:42 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Sat, 3 Jan 2026 08:06:42 -0600 From: Segher Boessenkool To: "Christophe Leroy (CS GROUP)" Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc: Implement ARCH_HAS_CC_CAN_LINK Message-ID: References: <20251230-cc-can-link-powerpc-v1-1-82298df6e3bf@linutronix.de> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hi! On Sat, Jan 03, 2026 at 11:39:12AM +0100, Christophe Leroy (CS GROUP) wrote: > Le 30/12/2025 à 08:06, Thomas Weißschuh a écrit : > > The generic CC_CAN_LINK detection does not handle different byte orders. > > This may lead to userprogs which are not actually runnable on the target > > kernel. > > Isn't the kernel supposed to handle any userland endianess ? Macro > SET_ENDIAN() is there for that as far as I understand. Yes, the kernel does not get much data out of data structures in memory in the first place :-) > And if you want to be complete, I think you should also check whether the > ELF ABI is v1 or v2. ELFv2 is version 1 of ELF, as wel as version 1 of its particular ABI. It is just a cutesy name. The thing now called "ELFv1" was called "PowerOpen", or simply "PowerPC 64-bit ELF", or one of a hundred other names :-) All of the ABIs we use with PowerPC (in trunk, anyway) work with either endianness (well, you need a userland built for it of course, and maybe AIX and/or Darwin have not actually been designed to work with wrong- endian as well). But powerpc-{elf,linux} and powerpcle-{elf,linux} work equivalently well, and so do both BE and LE versions of ELFv2 (yes, BE of that exists just as well, and some distros even ship it!) powerpc64-linux and powerpc64le-linux use different ABIs though (BE ELFv1 and LE ELFv2, resp.) Segher