summary refs log tree commit diff stats
path: root/linux-user
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-07-28 09:00:52 -1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-28 06:39:25 +1000
commit084b3247a08da16c541efba059c308b0d9299bdc (patch)
tree2649db44b532c6d36d57dc6a288e290ff29d8459 /linux-user
parentd6b8c5dbd9b0fd05c3f8ac9427729082eecb9fbb (diff)
downloadfocaccia-qemu-084b3247a08da16c541efba059c308b0d9299bdc.tar.gz
focaccia-qemu-084b3247a08da16c541efba059c308b0d9299bdc.zip
linux-user/loongarch64: Create get_elf_platform
Move the string literal to a new function.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/elfload.c2
-rw-r--r--linux-user/loongarch64/elfload.c5
-rw-r--r--linux-user/loongarch64/target_elf.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 0e41737cf1..9d61feae30 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 ee4a85b8d6..911352840f 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 037740d36f..eb17927325 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