From nobody Mon Feb 9 06:25:18 2026 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D46740758E for ; Wed, 4 Feb 2026 12:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770209178; cv=none; b=hseXNyK/R7j4vz0sB3e1iSDsG9Vlw+HDBf7eIpGlMKLvgIy0sBg0VPkhwQuD1eiMeZCWr+vs0RKAEoHk3HIkuZuj3P6CUdhujC4Uw+CjU7snzakvowXWAjLTramTb+qZazHaXl4qnqRn0Qk+6Qk13MURLccD9iklUKgjBiI1bAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770209178; c=relaxed/simple; bh=BzOAuOajeDnSciuB6ybBotlmKkP4pxYFjxloaZ0n+8I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FSJSCvc2GFq3cGa2ss2YxGt1AiyAQqH6JQRfVJur9BhrNAxJTEB/8hJ6iwWr1QqhB7s7ojMr93Vhv6UrqZdGjrWcYZ9aMIkiSRjIX6K/UhdbueFsi3zRXmxR4ImLaJoA6Z2xlUOMZto6QP1C9T3utsTV2Iuu6hXaPbg9RIU3sPQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=thingy.jp; spf=pass smtp.mailfrom=0x0f.com; dkim=pass (1024-bit key) header.d=thingy.jp header.i=@thingy.jp header.b=cOinF57k; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=thingy.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=0x0f.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thingy.jp header.i=@thingy.jp header.b="cOinF57k" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-3532aa9a77eso3195906a91.0 for ; Wed, 04 Feb 2026 04:46:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thingy.jp; s=google; t=1770209178; x=1770813978; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+SuVf7XciEfxkw0e3JqAh6PJ8tv0hya9bYr584kpMko=; b=cOinF57ksVfD94tZ3s6NEFshS2JpWYBDrPmvvSxHq9D/u/E7fORo3wyEOQKiLQenGE 5b1z7P36Vc1c76xM7qOGBLyfcwuADqAmrIyPWpM8qJiBJxfnE2vb0b/AEFtgqOIjLT1u QY9adkt+P/yz47VdNWvvRCeIwo5kDYTNwrfCA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770209178; x=1770813978; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+SuVf7XciEfxkw0e3JqAh6PJ8tv0hya9bYr584kpMko=; b=JpRZSRRPfgvCuAgHxX25JQPU5GDRTj9tqAFpvoXf0ZMNehZmW8SHl2RcwJneAlFPGs gdNq4NoY6h7EuNQXXQjhmZ+tqMt94/xgzNUZyNx3+XY0dA2zOP4RtBVT+H0uszytWwzO brJfdBe3bPssDyAf27V326AvCiF8vv8OnoHI3hnf3163PGDyjfTdHEYjv8Bb9RZXwotM uX6z6ubxRt//YzXKQwFhoDyRi0HswTCQKj/Hc9RGJWT39IQlBsj6icS1ZwPFkvrvEaUI BJpPnFXneBq16vtFk4u+S+i1AmxxlQ6iH6EGaTIfj29+T0438x81wTy9gIAIZspSGzcm bf4A== X-Gm-Message-State: AOJu0YyFGwQJvbQXOOVxSi1RHAlAJymVLrWPKHUi1Ui7lRuBc21Fztaf slwiCKSE8lQ3XnXoQdF8gT6CkNjX7C4RI7rxIDxhBf69XsPdZiOxeft0XTIBwtkhkZg= X-Gm-Gg: AZuq6aLO4CMWMJfPB32TjkZmwEp+LUlmD69KKMWvdZuk7k93QY09NU7xXBvYcMafKNP JGN3rUZGvb9yIlRVtM01zocUWDJvCVNzdTL22Q/74oRDLNGRFxaALhs2fc03FXPc9FuP1UkJpQk /8bMz6UuDa8sYppdIJ/qcxBuZSEyo+MkzMVNA/Ck40S3S8dvfD8I/1L56zBBHQaylmVc0sFd/FP d44/AKnB6QPQRc1msvwoZGKZ8v703/nPQhKymTwypz/OznoWtPu+gj+FMfrOurEwARfN5uUAM2d sdKaY95T/Yv09pvRogcBPlJeshtJDntnQXWeG4B8nFN91aaAv+cMXpz2UcpeHI6HKHUpif438oD +baemOdeh2NmBU9ewljgUFI+Ol2LdbELE51OKcnIacX7rVDifHXnAQgvezcneywc1Y2ftH0kBoa 4FfoILH9QJiqrDeboArAy6FIQ3rXcjadIqhEpMNanBBRAponsx806RktBxIoHNa4IpMj24YZmUq kMa X-Received: by 2002:a17:90b:510f:b0:341:194:5e7d with SMTP id 98e67ed59e1d1-35487195256mr2466403a91.24.1770209177887; Wed, 04 Feb 2026 04:46:17 -0800 (PST) Received: from kinako.work.home.arpa (p1490223-ipxg00b01sizuokaden.shizuoka.ocn.ne.jp. [153.223.134.223]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-354862effa6sm2378920a91.9.2026.02.04.04.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 04:46:17 -0800 (PST) From: Daniel Palmer To: w@1wt.eu, linux@weissschuh.net Cc: linux-kernel@vger.kernel.org, Daniel Palmer Subject: [RFC PATCH v2 09/10] tools/nolibc: ppc: Add relocation support Date: Wed, 4 Feb 2026 21:45:41 +0900 Message-ID: <20260204124542.523567-10-daniel@thingy.jp> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260204124542.523567-1-daniel@thingy.jp> References: <20260204124542.523567-1-daniel@thingy.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add relocation support for 32bit and 64bit ppc. Signed-off-by: Daniel Palmer --- tools/include/nolibc/arch-powerpc.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/include/nolibc/arch-powerpc.h b/tools/include/nolibc/arc= h-powerpc.h index e0c7e0b81f7c..a23c41b51cf7 100644 --- a/tools/include/nolibc/arch-powerpc.h +++ b/tools/include/nolibc/arch-powerpc.h @@ -7,8 +7,16 @@ #ifndef _NOLIBC_ARCH_POWERPC_H #define _NOLIBC_ARCH_POWERPC_H =20 +#include "elf.h" + +#define _NOLIBC_ARCH_HAS_RELOC +#ifndef __powerpc64__ +#define _NOLIBC_ARCH_ELF32 +#endif + #include "compiler.h" #include "crt.h" +#include "reloc.h" =20 /* Syscalls for PowerPC : * - stack is 16-byte aligned @@ -184,6 +192,22 @@ #endif /* !__powerpc64__ */ =20 #ifndef NOLIBC_NO_RUNTIME + +#ifdef NOLIBC_WANT_RELOC +static __inline__ int __relocate_rela(unsigned long base, _nolibc_elf_rela= *entry) +{ + switch (_nolibc_elf_r_type(entry->r_info)) { + case R_PPC_RELATIVE: + __relocate_rela_relative(base, entry); + break; + default: + return -1; + } + + return 0; +} +#endif /* NOLIBC_WANT_RELOC */ + /* startup code */ void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protec= tor _start(void) { --=20 2.51.0