From nobody Sat Nov 15 08:32:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1753835261; cv=none; d=zohomail.com; s=zohoarc; b=FQDHWGl/eGLyTYmu/Aj7hnP1R0/LT/L31x57JOlDAOZiyxJTTAOJCoenJ6Ie9Rs/UAzFjPUYRgtCkfxNEqLW7YOwgfkRCLxzvUJifhUrV+ZdEWr69KfPUd3IuUaZxz5vcy1TVcJhaYP+tYs3Rq//io+Emtq9HtrCiZ3XwXm7mLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753835261; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Ou0kAUGugQfCRFzNodYkOh/ttxE7MkU3L6icCkiDZak=; b=fBP5e52H1iTNFRx2FHo+9zd0of/GBxzTjCaGWpScsEigco3RdxgC2v8w+zdhxlycf79aFi+zgkHEwVZhyIdh4WYhOKxsTxAk+PMX5pnWzJh7emCI0DAt+ugNDk7Qlt2MckKEfoGuydDUcasRIs1GsUq9gxOcih5fS85hJWs9KtQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1753835261113736.8061014784921; Tue, 29 Jul 2025 17:27:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uguRc-00024i-Im; Tue, 29 Jul 2025 20:13:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uguFL-0001q1-IJ for qemu-devel@nongnu.org; Tue, 29 Jul 2025 20:00:42 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uguFJ-00043q-Ps for qemu-devel@nongnu.org; Tue, 29 Jul 2025 20:00:39 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-748d982e97cso5672595b3a.1 for ; Tue, 29 Jul 2025 17:00:37 -0700 (PDT) Received: from localhost.localdomain (syn-098-150-199-049.res.spectrum.com. [98.150.199.49]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-764090e178bsm9026087b3a.62.2025.07.29.17.00.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 17:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1753833636; x=1754438436; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Ou0kAUGugQfCRFzNodYkOh/ttxE7MkU3L6icCkiDZak=; b=Uz9iRuN8cXEEo4x4LF5ZUMN6Lf6dN/M4not/cdsTWVuNk1Brk9hYBDg32FmUr3NvwG 3P5w8znILjCJfj7kK9Bk449qhE0HkFbj9A3kTlJPb/TiKM2xfi2RIBOAUxNrZ3ge/hWH 6j6WSqHcOW7NHWSfEt2VsSnQRliWgCeb6CwokmNPJiIJd1qxEGK8s8xbeGeQmrRdH2TS SldbuzRGmGwfHnp0HbUGb9BT4PyniLNO94zshvE94daeTJJi3yJM+gMTfYX0lGOsDgCq AytNOvIzgcn/pqOixqlhMBf/y+qJbHYqvSHlk+kwDgwixi//UpvV+asb7Rr7uq0Jh5F/ dSXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753833636; x=1754438436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ou0kAUGugQfCRFzNodYkOh/ttxE7MkU3L6icCkiDZak=; b=JZZqFfspys6a1GOpnIkv3h+RzKNrqtjk1iXQXxfst8zAAnzpqP6BjRsQOoe8GUUFFu 8AwR5FQoX+wzGY5MuDwyGO4SdYHHuini6Y94I6VpNSuFxi5MUJaI8z8tpUUL7hqnRwKg a8ya+FTOJtFFtUrL8MCaX4TftWDygQm2izvd/ST/mGHGU06zQsL5DDsAmfzj4aOpgHgT 1STGOAAuCFK0l67pa5a/SPFJyoy2MlEC3VkJJORI96xXobNpAWLF5vGtXFpagUglS9cx r24euBjJqBWxOFTt62jezCkWdcc4wRcQHHtundxlk9yUfrGwgUszC9yr+yO08aWZMfC6 hjgA== X-Gm-Message-State: AOJu0YxYDDRu8Zb5TjiWsWQ3M/shObXf9l6mgfCYBndXczDQC0MtJzsR cv2rQuOB5OKOm/2gvrXNNKF24nON6uFAAQvGjeak5QWPyWhIb4gPybO6jc1LM0cY37XgKQxbcWv KE4Gb X-Gm-Gg: ASbGncuDRZpfsuPuCjT++l5lyffJUcQiuDSspDTSrUXNJ0faWvOIOMyCfWg3pOP4pgV RV0aP/i3BWNT/+FLyWdo7L2vXgPclIhmouiAxnfL3JzxzObTX/KEcxvaIWMC5oVpAOM+L1Ion57 Kev852duY7Fcz0AderiCiLK7WYt+oBNOmS7qmA2nroYcpSsTf8rPFEsUYdGROpjm/hcCvJyotlM Dk4sF64XKWeJYuce5jJlA64EwWuWpBtqO2TNq0b9VF1tHxZf7+sLLwqvH6Qw62GUMpxf6WdLEIE Xw0IRmP4ZAvsd4bJj2zP4aMi36F0mWbeywXm8p0+NUPrmZJ35yz9LGvLhssMKAHzt2lYCoJqF5N RM7JxhA6vYyak3qYazzngw4WgFktRcws1TDB2mCQDESokbw926ai0gxacBgM+IoaRPANSpHuPbd /EyD8Cz5EXsw== X-Google-Smtp-Source: AGHT+IFWStu+lsZ3Lfc88xYCtlXhNEEybv7WVpUcsJOyWsKnT/UcftMd0cGzK7jsGwtO5Os3p/g0/g== X-Received: by 2002:a05:6a00:398b:b0:757:ca2b:48a3 with SMTP id d2e1a72fcca58-76ab161afcbmr1818616b3a.9.1753833635200; Tue, 29 Jul 2025 17:00:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/89] linux-user: Remove ELF_PLATFORM Date: Tue, 29 Jul 2025 13:58:51 -1000 Message-ID: <20250730000003.599084-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250730000003.599084-1-richard.henderson@linaro.org> References: <20250730000003.599084-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1753835262872116600 Content-Type: text/plain; charset="utf-8" All real definitions of ELF_PLATFORM are now identical, and the stub definitions are NULL. Provide a weak stub as a fallback definition. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- linux-user/elfload.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 58f4b642a5..7e218e8cec 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -37,7 +37,6 @@ =20 #ifdef _ARCH_PPC64 #undef ARCH_DLINFO -#undef ELF_PLATFORM #undef ELF_CLASS #undef ELF_DATA #undef ELF_ARCH @@ -156,8 +155,6 @@ typedef abi_int target_pid_t; =20 #ifdef TARGET_I386 =20 -#define ELF_PLATFORM get_elf_platform(thread_cpu) - #ifdef TARGET_X86_64 #define ELF_CLASS ELFCLASS64 #define ELF_ARCH EM_X86_64 @@ -316,8 +313,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *re= gs, const CPUX86State *en =20 #ifdef TARGET_ARM =20 -#define ELF_PLATFORM get_elf_platform(thread_cpu) - #ifndef TARGET_AARCH64 /* 32 bit ARM definitions */ =20 @@ -672,8 +667,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *re= gs, #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 -#define ELF_PLATFORM get_elf_platform(thread_cpu) - #endif /* TARGET_LOONGARCH64 */ =20 #ifdef TARGET_MIPS @@ -853,8 +846,6 @@ static void elf_core_copy_regs(target_elf_gregset_t *re= gs, (*regs)[33] =3D tswapreg(cpu_get_sr(env)); } =20 -#define ELF_PLATFORM NULL - #endif /* TARGET_OPENRISC */ =20 #ifdef TARGET_SH4 @@ -1053,7 +1044,6 @@ static inline void init_thread(struct target_pt_regs = *regs, =20 #define ELF_CLASS ELFCLASS32 #define ELF_ARCH EM_PARISC -#define ELF_PLATFORM get_elf_platform(thread_cpu) #define STACK_GROWS_DOWN 0 #define STACK_ALIGNMENT 64 =20 @@ -1189,10 +1179,6 @@ static inline void init_thread(struct target_pt_regs= *regs, #define ELF_BASE_PLATFORM (NULL) #endif =20 -#ifndef ELF_PLATFORM -#define ELF_PLATFORM (NULL) -#endif - #ifndef ELF_MACHINE #define ELF_MACHINE ELF_ARCH #endif @@ -1243,6 +1229,11 @@ abi_ulong __attribute__((weak)) get_elf_hwcap(CPUSta= te *cs) return 0; } =20 +const char * __attribute__((weak)) get_elf_platform(CPUState *cs) +{ + return NULL; +} + #include "elf.h" =20 /* We must delay the following stanzas until after "elf.h". */ @@ -1712,7 +1703,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int a= rgc, int envc, } =20 u_platform =3D 0; - k_platform =3D ELF_PLATFORM; + k_platform =3D get_elf_platform(thread_cpu); if (k_platform) { size_t len =3D strlen(k_platform) + 1; if (STACK_GROWS_DOWN) { --=20 2.43.0