]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user: Move ppc uabi/asm/elf.h workaround to osdep.h
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 29 Jul 2025 23:40:15 +0000 (13:40 -1000)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 27 Aug 2025 20:39:25 +0000 (06:39 +1000)
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 <signal.h>, 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 <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
hw/core/loader.c
include/qemu/osdep.h
linux-user/elfload.c

index e7056ba4bd3b79a0c292ff79696e1d8230dcac4b..524af6f14a095fd5b7ab33cdb9cc45c7e3be32c2 100644 (file)
@@ -295,10 +295,6 @@ static void *load_at(int fd, off_t offset, size_t size)
     return ptr;
 }
 
-#ifdef ELF_CLASS
-#undef ELF_CLASS
-#endif
-
 #define ELF_CLASS   ELFCLASS32
 #include "elf.h"
 
index 96fe51bc390464eca4756d330a4c9e3e8bf83fd7..be3460b32f2d86e6c080b81a98beadf54e5af981 100644 (file)
@@ -133,6 +133,14 @@ QEMU_EXTERN_C int daemon(int, int);
 #include <setjmp.h>
 #include <signal.h>
 
+/*
+ * Avoid conflict with linux/arch/powerpc/include/uapi/asm/elf.h, included
+ * from <asm/sigcontext.h>, but we might as well do this unconditionally.
+ */
+#undef ELF_CLASS
+#undef ELF_DATA
+#undef ELF_ARCH
+
 #ifdef CONFIG_IOVEC
 #include <sys/uio.h>
 #endif
index ea214105ff86b78d209ac0eb19abf9889d79d280..4ca8c39dc26b2d5cc86daa28320f098545d57e04 100644 (file)
 #include "target/arm/cpu-features.h"
 #endif
 
-#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