qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] linux-user: elfload: Still use TARGET_PAGE_SIZE for


From: gchen gchen
Subject: [Qemu-devel] [PATCH] linux-user: elfload: Still use TARGET_PAGE_SIZE for i386 guest
Date: Wed, 12 Aug 2015 14:03:48 +0800

Under Alpha host, for ubuntu12.04.5 i386 guest, it will cause failure:
"Invalid ELF image for this architecture".

The related issue commit is "a70daba linux-user: Tell guest about big
host page sizes".

Signed-off-by: Chen Gang <address@hidden>
---
 linux-user/elfload.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 1788368..f4cf9b6 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1614,7 +1614,11 @@ static abi_ulong create_elf_tables(abi_ulong p, int 
argc, int envc,
     NEW_AUX_ENT(AT_PHDR, (abi_ulong)(info->load_addr + exec->e_phoff));
     NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr)));
     NEW_AUX_ENT(AT_PHNUM, (abi_ulong)(exec->e_phnum));
+#ifdef TARGET_I386
+    NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)TARGET_PAGE_SIZE);
+#else
     NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)(MAX(TARGET_PAGE_SIZE, getpagesize())));
+#endif
     NEW_AUX_ENT(AT_BASE, (abi_ulong)(interp_info ? interp_info->load_addr : 
0));
     NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0);
     NEW_AUX_ENT(AT_ENTRY, info->entry);
--
1.9.1
                                          

reply via email to

[Prev in Thread] Current Thread [Next in Thread]