From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6815A30C62A for ; Sat, 3 Jan 2026 14:11:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.228.1.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767449502; cv=none; b=TIc2pNa0QUT35gbCAfmaQPcbHHfWzZnU8Ni9IgFBK3rp9bDv/i+pmFt/jj0cDu5HFCdHiVLl79bWPTW5Y7EfaNzWFUBk/2FrFnFjr3peeUZJkLIhBhLS92eKXsB39QeY7Q3D5KQW5gQ/CDVG1Neg60jOHje3/g7zz6aC4fW0Opw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767449502; c=relaxed/simple; bh=gqMZBFB7ACVZoNWAaIefEV8j8sv+5FqBHhQABaKngTI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aXDQ1Jskuv801wkhE/nC07nlZkmDSAOo6S5zBmiAiG6NRytHkFhfXW8b/xx4/sMTqrwia0JngPUzHUAKhc6QV0PX1dbtrbF8fBbWJeo5xfutbspJWBfcmEpZ7OPZpDAnI0E8jepUxiUYwjxv2NBHFYiNpA2Igqw0ln6KzEkLmDg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org; spf=pass smtp.mailfrom=kernel.crashing.org; arc=none smtp.client-ip=63.228.1.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.crashing.org 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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