From nobody Mon Feb 9 04:12:35 2026 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 ED16630E0F6 for ; Sat, 31 Jan 2026 07:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769845488; cv=none; b=EzYRK/yPXba6M4bkFMZyjpbziUDASbBjKAMeFsdBH82zc1hBw35kcYU1kk0QMoRWibOMEooT00hByuonN6wNXPmvGs6e+FkHWDUfBJaPOUa4AgIySqUXqvL02iHQmMT8CEVFNCqPN3hmdFbS/1aX3C4rUSH/Gm5NRWj3c0XwXeQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769845488; c=relaxed/simple; bh=K1HB1drOWj5j33NGKYCuiSya0F7BuXnyoBGH67Q5AGw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tkpVVdEUPVGHzInPY3bopnZ94nkhuOXnGSxXcW8zQiO+jOOFRmNtQcwuU5j9IDC5ayB7tc7uB/Tk2E7ozvPYLzUvyU9oF0XEoJOBTpXyRGZw0j0ESWrocRM+cDtW6SpQh/I+XW6WjkmfuwXT3x8tdCgJBI1lPg5npyn9KOb9IYU= 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=l07ne8fd; arc=none smtp.client-ip=209.85.210.181 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="l07ne8fd" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-82361bcbd8fso1709261b3a.0 for ; Fri, 30 Jan 2026 23:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thingy.jp; s=google; t=1769845486; x=1770450286; 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=OvIzJVD0f/EAs0vOP9AMWUz0tgYOHLh4UNVtG/HHyO4=; b=l07ne8fdI0hSM7eLPYDDO0ApaPINAaV+ajiwieUnpKb+ygD4UHXsl8aQCPAI3QVpQx eznLibgJdJTxVkDY2Kcryqo37j19kJqo6zA9h3aAC7h3zNqEQar9f52ZiubDBXce7Lkf BhCAJQ6H76uIh3elYu29klAQd4N4MFhlq8Bto= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769845486; x=1770450286; 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=OvIzJVD0f/EAs0vOP9AMWUz0tgYOHLh4UNVtG/HHyO4=; b=SeSPwdj3MWnGg92CERzPtlFi5Es6RtNoJguYmEv+mRvrHyhXtA+ewxEqT5Wf9zrmIi /LdrrDqQ/Oi7v2/GR9bE19dQiw/RVC//5fAQQ59x5YogYCf37D68cYeghiJj+FbmvQbW J/BAmjPM9TsTbQvl50IxOjWtu7zAIA4YpYH3hRJZSyfvzZSZ1Q0KHB+wUu9BnwJcYj/Z Jj8GlMzEZvGKaYy13TdRCvCfBTIhuCGWxokrMhRb834eqQsc/xQJ9XO4tPXZg2D8yaeI ADLS+EaRDeajIlOblil51l0unuJc5PopT2rT0mQBxqjurmFWijOj6XghL3o2Em8opjMf Dcaw== X-Forwarded-Encrypted: i=1; AJvYcCUiGrtodTEsrmgqKoZ8U1podkwDOTDX4FsaDevVYXEvWiN9sYHH7XBLfSwHxqc3vcI88G0t5qTiMXMA9MA=@vger.kernel.org X-Gm-Message-State: AOJu0YyvgEeqXwkvfLx5TFq8w3THemlGkSXis2ntIL+yJ6Pd1iXtcljj sQJMC9Yv3wzZM77Vg52zKbAtjE2amUvDsa1eaDYxSbPZVFNDSWEbVixwMQcENH8WT+U= X-Gm-Gg: AZuq6aK4y7Y+ZeDcUeXugc6J1sRQVuzBOumVmrRyeuAJukyMW+51XcpeN1SGeEH1e2t fg5hrH6knRiObzQBEF/DmiFHc2W3CMUkegm1VmgfWS+0fcKoeCUqKhmrM+vv8KxtA8B4x9nVj8Y ZQruo4qPHJGCCFkKR1l6rqw1L3SUdhba9n91xhp6Yjgm4g72GGXciblAFnVr5vj29xE3bFD+PuK CDP0xec34vAlAGSi3//YwkicaTQ4UjthJgEoxGUuWbhBrzx7jCLzOkf7UrC+NjRhDW99nnS+5pA F9bPAyfG4MLSVpzI6AErdfWXO6ZMBdtiWCiJOQschMgc0AXu4R4IEBG6B7R8W8S1O45GlY8qAq/ mkh0naXxUQo2cjUXv8tWzr1zqP0SE0KBXtt6DT2kghXs/doxlMYzjTWKG7jZVkWjj9PdmjUZD38 WVRGey1+O1nKBp2hfNOFnsyLHTtotzYqXIlNzG+vxfY0N/7Q4BmLlUoFww3dpVTirbUzAmO3IyF q/R X-Received: by 2002:a05:6a00:1808:b0:81f:852b:a91e with SMTP id d2e1a72fcca58-823ab96e83amr5403880b3a.59.1769845486250; Fri, 30 Jan 2026 23:44:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 23:44:45 -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 1/9] elf: Add relocation types used by nolibc Date: Sat, 31 Jan 2026 16:44:32 +0900 Message-ID: <20260131074440.732588-2-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" nolibc based programs are gaining the ability to relocate themselves so that they can support PIE without needing a linker or special crt from the toolchain. Add the required relocation types. Signed-off-by: Daniel Palmer --- include/uapi/linux/elf-r.h | 27 +++++++++++++++++++++++++++ include/uapi/linux/elf.h | 1 + 2 files changed, 28 insertions(+) create mode 100644 include/uapi/linux/elf-r.h diff --git a/include/uapi/linux/elf-r.h b/include/uapi/linux/elf-r.h new file mode 100644 index 000000000000..a1dce23104a7 --- /dev/null +++ b/include/uapi/linux/elf-r.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _LINUX_ELF_R_H +#define _LINUX_ELF_R_H + +/* These constants define various ELF relocation types */ +#define R_386_RELATIVE 8 + +#define R_68K_RELATIVE 22 + +#define R_AARCH64_RELATIVE 1027 + +#define R_AMD64_RELATIVE 8 + +#define R_ARM_RELATIVE 23 + +#define R_LARCH_RELATIVE 3 + +#define R_PPC_RELATIVE 22 + +#define R_RISCV_RELATIVE 3 + +#define R_SH_RELATIVE 165 + +#define R_SPARC_NONE 0 +#define R_SPARC_RELATIVE 22 + +#endif /* _LINUX_ELF_R_H */ diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index 819ded2d39de..3d18543d5460 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h @@ -4,6 +4,7 @@ =20 #include #include +#include =20 /* 32-bit ELF base types. */ typedef __u32 Elf32_Addr; --=20 2.51.0