From nobody Sun Feb 8 20:32:57 2026 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 EB43334106D for ; Sat, 31 Jan 2026 07:44:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769845497; cv=none; b=hm8UdNyKJ4DYnQM6P+EQs5UhL0CoDE5BAk0vchZ+i545vLVVWpUr4qfQLKb2n42PzSEIDwkfaBa5xV3dSg2kGZIO9LTJZpXxI3sUPTiX32Bo9xy0W2y7GOK8NUOjM/Ilqbynzaxr72AxdhLeJcp5U0E7RKUehWuDvmdvhXtERX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769845497; c=relaxed/simple; bh=2drNagYZn8sXSOhnFoDR5bZ17WlMszbj62j7wXdpzLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fy5//RApQLiVSr9xd1itEI7JJWqKkQXqYOiv32lPTW5Mtab6ivpRaATYCM4fxeRRFSUc7XERLgf/+imOT3PQsNsiCepdLC9/1UtEDEmgt/eVR8prbmcOFVXFXC7r1iqMF3xQQ/EU5x1qLpmhmQfj9AIBMkEQ9lkilio5DC67poY= 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=pFKUXbM6; arc=none smtp.client-ip=209.85.215.179 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="pFKUXbM6" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-c2af7d09533so1789485a12.1 for ; Fri, 30 Jan 2026 23:44:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thingy.jp; s=google; t=1769845495; x=1770450295; 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=Dwe6qAYf6eb5SHIHBnic/5w5omJ38zNZIf8veh5Ymg4=; b=pFKUXbM6KDOTyl3bEPUqyDPLlNikpzX9jDZJrifqI+xQaXIyPL1dTFY1pP3i2EIiM4 H74Me7OeVMwE9saclyA2FjmsRJhUcxYd4qvc7IygF0W+XI/lfdXfYgteAbJBE/AdBeCa /Ibv8uljhdvppU1NO7uUh3lYvB+kFWWhfdmyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769845495; x=1770450295; 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=Dwe6qAYf6eb5SHIHBnic/5w5omJ38zNZIf8veh5Ymg4=; b=oEVKRXgd9eKrcq6/uC494xMV6Eo+Epcwc8PK/FS7RY24F3Q/cqpTZHCUDYoCS20oOD O1jdH8CXnskiR0xtpPj/QJ4YXXppQn3pOe+dxtyyxWIc+S/iSppDZ8tS4qPBI7v0LkB+ ZkaOXPBACHr2zBu+Z74k8xxQqRlC0O8VmOm9lV6QIt3Cq/N+EEGq3YNWz0mSqUTZ77C5 LvEWtoe4LEliSwlzURiHBhKhV2sLh3AP0tM6HITy/xq/WXjGbP8nJ4aCCc67xtLfOnhs yqvbzHov/Bo9gXrWY+rOBHajpHVNxxv2WKDeqfRJx9qyXkjj9OPs5AZDjYBCsoJSh+P/ VfSg== X-Forwarded-Encrypted: i=1; AJvYcCVErLTESeRGXKK68WxazZ1+gpdHMd6atZSmWiIqVIYbnePA51Yo1j9m9i+CVwJdt7yV7j9nZ7pGG6qqgZE=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0SRt99s2DGDBhI1/48eGff7gweCBTJxTPpn+3LcK+KFUEuhJR 47I+xhYsm+frAtkJja3KmRuKg27y8+7sVWY3Hmnya27OopH/GsUQkukji5r4eUk4f20= X-Gm-Gg: AZuq6aLXy+hV8V1ObpI2LSYJhL9dlIKUeIOkQ2Brcn2aclUU4nnE7QtJ89rcPC8y4ne ayM4x2AroozOFBjSkfx7+ftgvJ93TxEIjMGzXd1PxnJ0Ev8et4bXno3+RgoQsNx1gOTbHEvX7g0 yPTZA8RAiWoNKmZLsDRbm4P8DB4uODP6K8rUvU1nEPHtTXWyZtvrtYz50wyULQGcLuLnSkW2pR8 gTWAQX21TKGXpCmtAhpw8l0cwBpjXZNv0gjJtRquGSFNzJLgGQx6MfEu069N4vCcJsCdZ14q/Op zDkvypwflj7X1hlZq9lWqx1U4QGjy5g3U0UiWWkeNZFknqTrJ7v6Jx4cjyJhvMEj4aj/61b4PD1 rEHrM79hXPEQUOXrVtbLeqblwXfrrhEnfqhh6ZprXF1y/3r842CH6KdjxX6rKhV2uLaXvpsCFk9 Qp5vUUEBM9cC3vawdaYJKUnyF6xboYW11+mfH6AGURNgBI/knAJl0hgU9vl6gcQ1JkObjVamhac 4za X-Received: by 2002:a05:6a20:6a0c:b0:390:ca32:da2c with SMTP id adf61e73a8af0-392e0054779mr5605198637.24.1769845495368; Fri, 30 Jan 2026 23:44:55 -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 41be03b00d2f7-c642a9f539dsm8866928a12.26.2026.01.30.23.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 23:44:55 -0800 (PST) From: Daniel Palmer To: linux@weissschuh.net, w@1wt.eu Cc: kees@kernel.org, linux-kernel@vger.kernel.org, Daniel Palmer Subject: [RFC PATCH 7/9] tools/nolibc: arm: Add relocation support Date: Sat, 31 Jan 2026 16:44:38 +0900 Message-ID: <20260131074440.732588-8-daniel@thingy.jp> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260131074440.732588-1-daniel@thingy.jp> References: <20260131074440.732588-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 arm. Signed-off-by: Daniel Palmer --- tools/include/nolibc/arch-arm.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/include/nolibc/arch-arm.h b/tools/include/nolibc/arch-ar= m.h index 251c42579028..7f69761eeab1 100644 --- a/tools/include/nolibc/arch-arm.h +++ b/tools/include/nolibc/arch-arm.h @@ -7,6 +7,10 @@ #ifndef _NOLIBC_ARCH_ARM_H #define _NOLIBC_ARCH_ARM_H =20 +#define NOLIBC_ARCH_HAS_RELOC +#define NOLIBC_ARCH_ELF32 +#define NOLIBC_ARCH_ELF_REL + #include "compiler.h" #include "crt.h" =20 @@ -185,6 +189,19 @@ }) =20 #ifndef NOLIBC_NO_RUNTIME +static int __relocate_rel(unsigned long base, elf_rel *entry) +{ + switch (elf_r_type(entry->r_info)) { + case R_ARM_RELATIVE: + __relocate_rel_relative(base, entry); + break; + default: + return -1; + } + + return 0; +} + /* startup code */ void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protec= tor _start(void) { --=20 2.51.0