From: Richard Henderson Date: Mon, 28 Jul 2025 19:00:52 +0000 (-1000) Subject: linux-user/loongarch64: Create get_elf_platform X-Git-Tag: v10.2.0-rc1~121^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=084b3247a08da16c541efba059c308b0d9299bdc;p=thirdparty%2Fqemu.git linux-user/loongarch64: Create get_elf_platform Move the string literal to a new function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 0e41737cf1b..9d61feae301 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -665,7 +665,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 -#define ELF_PLATFORM "loongarch" +#define ELF_PLATFORM get_elf_platform(thread_cpu) #endif /* TARGET_LOONGARCH64 */ diff --git a/linux-user/loongarch64/elfload.c b/linux-user/loongarch64/elfload.c index ee4a85b8d6c..911352840f7 100644 --- a/linux-user/loongarch64/elfload.c +++ b/linux-user/loongarch64/elfload.c @@ -56,3 +56,8 @@ abi_ulong get_elf_hwcap(CPUState *cs) return hwcaps; } + +const char *get_elf_platform(CPUState *cs) +{ + return "loongarch"; +} diff --git a/linux-user/loongarch64/target_elf.h b/linux-user/loongarch64/target_elf.h index 037740d36f2..eb179273255 100644 --- a/linux-user/loongarch64/target_elf.h +++ b/linux-user/loongarch64/target_elf.h @@ -7,5 +7,6 @@ #define LOONGARCH_TARGET_ELF_H #define HAVE_ELF_HWCAP 1 +#define HAVE_ELF_PLATFORM 1 #endif