summary refs log tree commit diff stats
path: root/linux-user/arm/elfload.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-07-29 09:33:51 -1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-30 07:04:04 +1000
commit71cc79a4a172d28638ad27a4e6327a4ce1bcdf2b (patch)
tree2e9edd56291248b6b34d03d665ce2acf356b1ea1 /linux-user/arm/elfload.c
parent6e1c4ec4582814537c9a2b4700ff32da44fb27af (diff)
downloadfocaccia-qemu-71cc79a4a172d28638ad27a4e6327a4ce1bcdf2b.tar.gz
focaccia-qemu-71cc79a4a172d28638ad27a4e6327a4ce1bcdf2b.zip
linux-user: Move get_vdso_image_info to arm/elfload.c
Rename from vdso_image_info to avoid a symbol clash.
Define HAVE_VDSO_IMAGE_INFO to signal the external definition exists.
Provide fallback versions for other targets.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/arm/elfload.c')
-rw-r--r--linux-user/arm/elfload.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/linux-user/arm/elfload.c b/linux-user/arm/elfload.c
index 1205687976..308ed23fcb 100644
--- a/linux-user/arm/elfload.c
+++ b/linux-user/arm/elfload.c
@@ -7,6 +7,7 @@
 #include "target_elf.h"
 #include "target/arm/cpu-features.h"
 #include "target_elf.h"
+#include "elf.h"
 
 
 const char *get_elf_cpu_model(uint32_t eflags)
@@ -255,3 +256,22 @@ void elf_core_copy_regs(target_elf_gregset_t *r, const CPUARMState *env)
     r->pt.cpsr = tswapal(cpsr_read((CPUARMState *)env));
     r->pt.orig_r0 = tswapal(env->regs[0]); /* FIXME */
 }
+
+#if TARGET_BIG_ENDIAN
+# include "vdso-be8.c.inc"
+# include "vdso-be32.c.inc"
+#else
+# include "vdso-le.c.inc"
+#endif
+
+const VdsoImageInfo *get_vdso_image_info(uint32_t elf_flags)
+{
+#if TARGET_BIG_ENDIAN
+    return (EF_ARM_EABI_VERSION(elf_flags) >= EF_ARM_EABI_VER4
+            && (elf_flags & EF_ARM_BE8)
+            ? &vdso_be8_image_info
+            : &vdso_be32_image_info);
+#else
+    return &vdso_image_info;
+#endif
+}