On 30/9/23 04:15, Richard Henderson wrote:
The vdso image will be pre-processed into a C data array, with
a simple list of relocations to perform, and identifying the
location of signal trampolines.

Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
  linux-user/elfload.c | 90 +++++++++++++++++++++++++++++++++++++++-----
  1 file changed, 81 insertions(+), 9 deletions(-)


@@ -3691,7 +3759,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct 
image_info *info)
       * and let elf_load_image do any swapping that may be required.
       */
      struct elfhdr ehdr;
-    struct image_info interp_info;
+    struct image_info interp_info, vdso_info;
      char *elf_interpreter = NULL;
      char *scratch;
@@ -3772,10 +3840,13 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
      }
/*
-     * TODO: load a vdso, which would also contain the signal trampolines.
-     * Otherwise, allocate a private page to hold them.
+     * Load a vdso if available, which will amongst other things contain the
+     * signal trampolines.  Otherwise, allocate a separate page for them.
       */
-    if (TARGET_ARCH_HAS_SIGTRAMP_PAGE) {
+    const VdsoImageInfo *vdso = vdso_image_info();

Declare in prologue? Otherwise,

Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>

+    if (vdso) {
+        load_elf_vdso(&vdso_info, vdso);
+    } else if (TARGET_ARCH_HAS_SIGTRAMP_PAGE) {
          abi_long tramp_page = target_mmap(0, TARGET_PAGE_SIZE,
                                            PROT_READ | PROT_WRITE,
                                            MAP_PRIVATE | MAP_ANON, -1, 0);


Reply via email to