Skip to contentSkip to conversation

Fix layout1 test on x86_64 x32.

PATCH In review Andrew Stubbs 2 participants 2 messages Dec 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix layout1 test on x86_64 x32.

Hi Mark,

The layout1 test case currently fails for x32 because there is insufficient address space for all the libraries.

There's two ways to fix this:

1. Increase mmap_end such that there's more space.

2. Reduce max_page_size so that less space is wasted.

I'm not sure what the implications of option 2 would be, so the attached patch implements option 1.

This still limits the number of possible libraries somewhat severely, but it's more than enough to pass the layout1 test.

Andrew

From 6c8aec5590ba9ba93e6cbb458c34ead0481b0b7c Mon Sep 17 00:00:00 2001
From: Andrew Stubbs <[email protected]>
Date: Fri, 16 Dec 2016 14:08:28 +0000
Subject: [PATCH] Fix x32 layout1 test.

2016-12-16 Andrew Stubbs <[email protected]>

* src/arch-x86_64.c (PL_ARCH(x32)): Set mmap_end to 0x60000000.

---
 src/arch-x86_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/arch-x86_64.c +1 -1
index 6a97370..5c95f47 100644
@@ -595,7 +595,7 @@ PL_ARCH(x32) = {
      Also, if this guard area isn't too small, typically
      even dlopened libraries will get the slots they desire.  */
   .mmap_base = 0x41000000,
-  .mmap_end =  0x50000000,
+  .mmap_end =  0x60000000,
   .max_page_size = 0x200000,
   .page_size = 0x1000
 };
Signature · 1 line
2.8.1
#1 lore raw

Thank you.

I've added this to the TODO set, and will hopefully have it (and the previous one) staged very soon.

--Mark

Quoted 19 lines · Andrew Stubbs

Hi Mark,

The layout1 test case currently fails for x32 because there is insufficient address space for all the libraries.

There's two ways to fix this:

1. Increase mmap_end such that there's more space.

2. Reduce max_page_size so that less space is wasted.

I'm not sure what the implications of option 2 would be, so the attached patch implements option 1.

This still limits the number of possible libraries somewhat severely, but it's more than enough to pass the layout1 test.

Andrew