From 0cf91fc14f4a183b2c252a8e276133be9895d121 Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Wed, 27 Feb 2013 03:09:40 +0100 Subject: [PATCH] runtime_loader: randomize position of relocatable images Use B_RANDOMIZED_BASE for creating areas for relocatable segments. --- src/system/runtime_loader/images.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/runtime_loader/images.cpp b/src/system/runtime_loader/images.cpp index 6c6c460285..d7323aa2d3 100644 --- a/src/system/runtime_loader/images.cpp +++ b/src/system/runtime_loader/images.cpp @@ -173,7 +173,7 @@ get_image_region_load_address(image_t* image, uint32 index, int32 lastDelta, if (index == 0) { // but only the first segment gets a free ride loadAddress = RLD_PROGRAM_BASE; - addressSpecifier = B_BASE_ADDRESS; + addressSpecifier = B_RANDOMIZED_BASE_ADDRESS; } else { loadAddress = image->regions[index].vmstart + lastDelta; addressSpecifier = B_EXACT_ADDRESS; @@ -298,7 +298,7 @@ map_image(int fd, char const* path, image_t* image, bool fixed) addr_t loadAddress; size_t reservedSize = 0; size_t length = 0; - uint32 addressSpecifier = B_ANY_ADDRESS; + uint32 addressSpecifier = B_RANDOMIZED_ANY_ADDRESS; for (uint32 i = 0; i < image->num_regions; i++) { // for BeOS compatibility: if we load an old BeOS executable, we