From nobody Sat Sep 6 16:56:44 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=1756974158; cv=none; d=zohomail.com; s=zohoarc; b=hzXdyykwP+M7fvs9KxwrJ4JkjNBTe9gskUrg7i5irsaDb3DDBqJ57rle3BgGmeQYvARcUQjEdVK8IQt2h8E+fTULzujI8ifcBsAdCC1B1NdfjzTp4eAPXTOhx6degUsO3Bbj3RF8UDeXNKhLwQxthf3ER+Z21PkfKRs4DpivUts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756974158; h=Content-Transfer-Encoding:Cc:Cc: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; bh=dryPG5cdTvon401P43IQAncMYcpBnZGjJaBP50H9h5s=; b=lULFmyzzgR8xvGFEHQekVDldamPqHD+4diXj/PfhTsm7iBr+EN2Cv+zDpISUUx2f+nfCwBm01+dY8Xm4SIi6VP0kGWpU9fM3hb98Y6m8hTHiAIpNZ0GG7MXyYotDVKmZhK0dsrs0+C+mkZU18LrzI2SvqDG6brdQILje5QwUycw= 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 1756974158204217.26181680258708; Thu, 4 Sep 2025 01:22:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uu59b-0005Cj-L4; Thu, 04 Sep 2025 04:17:11 -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 1uu55D-0006hS-07 for qemu-devel@nongnu.org; Thu, 04 Sep 2025 04:12:44 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uu54d-0004EX-GL for qemu-devel@nongnu.org; Thu, 04 Sep 2025 04:12:38 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-afcb7322da8so151142766b.0 for ; Thu, 04 Sep 2025 01:12:02 -0700 (PDT) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aff12a6b404sm1395198066b.88.2025.09.04.01.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Sep 2025 01:11:55 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8A375601B3; Thu, 04 Sep 2025 09:11:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1756973521; x=1757578321; darn=nongnu.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=dryPG5cdTvon401P43IQAncMYcpBnZGjJaBP50H9h5s=; b=Z+VLcHiKE1AbteVM4e0xrE933CXRtp7Cd+3Dc52K669bV+8jEIQKbHzlOV8BnzMbOs YI0Y4pLm46aIKaqhnTwIJ5ZFtyyABlwzfm3lZzMzuR0ScA30jiniA/X03OLEBs0SkUM1 xR1TWu7yoaVRtd3UiFntzM3QMs0w4MEqsZq6H4h9Q+xUV2PVQluKFBVK+W7J0AJRjC3z uV54SnVNP91yeNL4bbBFWy20Ss4N9V9+qIfbQ1cJ7uCa157Gg824AwZtwHTjzBEiMNtd Sh394/TllXwDjQobOX3x/3Le3jq0Y7JEe9ZehXkkHQ4Iq94/gfULSpQ4aG6m+cxENQKl MziA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756973521; x=1757578321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dryPG5cdTvon401P43IQAncMYcpBnZGjJaBP50H9h5s=; b=f/Ukv4FHo/W6+WT+lUWEQ2/XIH6sdqhOyJJMMjJgxgdWuc3/DhsdvPxfd9ac33tvOw 40KxUpZcNcbm0YD6I5n9/7uTHVXyYKpppbEmNYbcJv4g+qgEhLagk2bdJbGZMiXqIGaD fYacViMFcUrVPtSCaJWWEpLPKFTB3rUAYXLLUCiZ7SK+3dikz021in40MGFc4R5zm1qF cGROoYZVZ9pbtuHtmnNCyJsihk+/04Z9wnNZPuMZA4vuBwI2uVhwuqyPq+OM4ujWEc3r CX8NJVQSh+2e8xctHnGOAxcrnpOPMcR4CVFtQpX6gPwB2BhYNW869EJ1+ZvsCR90aD/u 7EpA== X-Gm-Message-State: AOJu0YyG56gMbFxe30ZWsnIv4KKqezLO7SniVTOujusJlVkb4uotRLT8 CAhJWhyGOprqtXjwsDoiHxqesOMlJQZoJq0FWkJP/xeE2iVtffbvTgp0aSc2TWg77/l6I6e4RWT q/oht7nXEng== X-Gm-Gg: ASbGnctSlrR2PaXYvBCGBw43Mi9ZaCDEZKhrLjiSKtZsdafhy4K4md+vUSXzVvpSRCz 1++KVRTe/7JifLStJuBDABCbw+CusaRwdaSOj1+IMFBFs2qhORJGp/SKA4bfdAd5lLQYRf8/D2J JSKpzqvEJpoYk9Zq15g0mmw/MH8DBuz4lat6FGrYAF1ge3pJmu8JUxCXLmlolTGbNXLptGrHiNk 2+2ItDgDYP9ro3eHQ8qEBe4fdnVW+yu1Q+Y2Cg0GO2U/SRl55F5H7u7WE2r60M7X0suG+J1NWz0 ZMImaCZ9BSb6WfjBIiph9WDNkuXRgsZ3H2PYdrZgTNANovxp3WtxUQjrCzBZHqsx+ksY3YPc4QL +JB2gxYN9a4tOtg3Vk6mdq8A= X-Google-Smtp-Source: AGHT+IGDnb25U4p97OCHED0J2lFk0ur4/KBbXrud2PABbqZVX6GA8E6Xsu3KLiaHB+cjs0txk70Kjg== X-Received: by 2002:a17:907:7ea8:b0:b04:53cc:441c with SMTP id a640c23a62f3a-b0453cc4688mr868679666b.28.1756973521151; Thu, 04 Sep 2025 01:12:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Huacai Chen , Zhao Liu , Paolo Bonzini , Alistair Francis , qemu-arm@nongnu.org, Fam Zheng , Helge Deller , Matthew Rosato , Fabiano Rosas , qemu-rust@nongnu.org, Bibo Mao , qemu-riscv@nongnu.org, Thanos Makatos , Liu Zhiwei , Riku Voipio , Cameron Esfahani , Alexander Graf , Laurent Vivier , Harsh Prateek Bora , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-ppc@nongnu.org, Stafford Horne , Sunil Muthuswamy , Jagannathan Raman , Igor Mammedov , Brian Cain , Phil Dennis-Jordan , devel@lists.libvirt.org, Mads Ynddal , Elena Ufimtseva , Peter Xu , Jason Herne , Michael Rolnik , Weiwei Li , Laurent Vivier , Ilya Leoshkevich , qemu-block@nongnu.org, Peter Maydell , Kostiantyn Kostiuk , Kyle Evans , David Hildenbrand , "Edgar E. Iglesias" , Warner Losh , Daniel Henrique Barboza , John Snow , Yoshinori Sato , Aleksandar Rikalo , Alistair Francis , Marcelo Tosatti , Yonggang Luo , Radoslaw Biernacki , Artyom Tarasenko , Yanan Wang , Eduardo Habkost , Aurelien Jarno , Richard Henderson , qemu-s390x@nongnu.org, Alex Williamson , "Michael S. Tsirkin" , Ani Sinha , Roman Bolshakov , Manos Pitsidianakis , Chinmay Rath , Thomas Huth , Cleber Rosa , kvm@vger.kernel.org, Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Halil Pasic , Eric Farman , Palmer Dabbelt , Leif Lindholm , Christian Borntraeger , Michael Roth , Mauro Carvalho Chehab , Jiaxun Yang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Mark Cave-Ayland , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Nicholas Piggin , John Levon Subject: [PATCH v2 051/281] linux-user: Move ppc uabi/asm/elf.h workaround to osdep.h Date: Thu, 4 Sep 2025 09:07:25 +0100 Message-ID: <20250904081128.1942269-52-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250904081128.1942269-1-alex.bennee@linaro.org> References: <20250904081128.1942269-1-alex.bennee@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=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.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=unavailable 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: 1756974159130116600 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Move the workaround out of linux-user/elfload.c, so that we don't have to replicate it in many places. Place it immediately after the include of , which draws in the relevant symbols. Note that ARCH_DLINFO is not defined by the kernel header, and so there's no need to undef it either. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/qemu/osdep.h | 8 ++++++++ hw/core/loader.c | 4 ---- linux-user/elfload.c | 10 ---------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 96fe51bc390..be3460b32f2 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -133,6 +133,14 @@ QEMU_EXTERN_C int daemon(int, int); #include #include =20 +/* + * Avoid conflict with linux/arch/powerpc/include/uapi/asm/elf.h, included + * from , but we might as well do this unconditionally. + */ +#undef ELF_CLASS +#undef ELF_DATA +#undef ELF_ARCH + #ifdef CONFIG_IOVEC #include #endif diff --git a/hw/core/loader.c b/hw/core/loader.c index e7056ba4bd3..524af6f14a0 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -295,10 +295,6 @@ static void *load_at(int fd, off_t offset, size_t size) return ptr; } =20 -#ifdef ELF_CLASS -#undef ELF_CLASS -#endif - #define ELF_CLASS ELFCLASS32 #include "elf.h" =20 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index ea214105ff8..4ca8c39dc26 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -35,16 +35,6 @@ #include "target/arm/cpu-features.h" #endif =20 -#ifdef _ARCH_PPC64 -#undef ARCH_DLINFO -#undef ELF_PLATFORM -#undef ELF_HWCAP -#undef ELF_HWCAP2 -#undef ELF_CLASS -#undef ELF_DATA -#undef ELF_ARCH -#endif - #ifndef TARGET_ARCH_HAS_SIGTRAMP_PAGE #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 0 #endif --=20 2.47.2