diff --git a/src/system/runtime_loader/elf_load_image.cpp b/src/system/runtime_loader/elf_load_image.cpp index 2ccabe46a9..b9801adb74 100644 --- a/src/system/runtime_loader/elf_load_image.cpp +++ b/src/system/runtime_loader/elf_load_image.cpp @@ -505,7 +505,7 @@ load_image(char const* name, image_type type, const char* rpath, goto err2; } - status = map_image(fd, path, image, type == B_APP_IMAGE); + status = map_image(fd, path, image); if (status < B_OK) { FATAL("%s: Could not map image: %s\n", image->path, strerror(status)); status = B_ERROR; diff --git a/src/system/runtime_loader/images.cpp b/src/system/runtime_loader/images.cpp index 3bbe34bde2..754ed1193c 100644 --- a/src/system/runtime_loader/images.cpp +++ b/src/system/runtime_loader/images.cpp @@ -166,9 +166,9 @@ topological_sort(image_t* image, uint32 slot, image_t** initList, */ static void get_image_region_load_address(image_t* image, uint32 index, long lastDelta, - bool fixed, addr_t& loadAddress, uint32& addressSpecifier) + addr_t& loadAddress, uint32& addressSpecifier) { - if (image->dynamic_ptr != 0 && !fixed) { + if (image->dynamic_ptr != 0) { // relocatable image... we can afford to place wherever if (index == 0) { // but only the first segment gets a free ride @@ -283,7 +283,7 @@ put_image(image_t* image) status_t -map_image(int fd, char const* path, image_t* image, bool fixed) +map_image(int fd, char const* path, image_t* image) { // cut the file name from the path as base name for the created areas const char* baseName = strrchr(path, '/'); @@ -301,16 +301,10 @@ map_image(int fd, char const* path, image_t* image, bool fixed) 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 - // have to relocate it, if possible - we recognize it because the - // vmstart is set to 0 (hopefully always) - if (fixed && image->regions[i].vmstart == 0) - fixed = false; - uint32 regionAddressSpecifier; get_image_region_load_address(image, i, i > 0 ? loadAddress - image->regions[i - 1].vmstart : 0, - fixed, loadAddress, regionAddressSpecifier); + loadAddress, regionAddressSpecifier); if (i == 0) { reservedAddress = loadAddress; addressSpecifier = regionAddressSpecifier; @@ -342,7 +336,7 @@ map_image(int fd, char const* path, image_t* image, bool fixed) baseName, i, (image->regions[i].flags & RFLAG_RW) ? "rw" : "ro"); get_image_region_load_address(image, i, - i > 0 ? image->regions[i - 1].delta : 0, fixed, loadAddress, + i > 0 ? image->regions[i - 1].delta : 0, loadAddress, addressSpecifier); // If the image position is arbitrary, we must let it point to the start diff --git a/src/system/runtime_loader/images.h b/src/system/runtime_loader/images.h index a929040b42..7a309bb6c8 100644 --- a/src/system/runtime_loader/images.h +++ b/src/system/runtime_loader/images.h @@ -50,7 +50,7 @@ void delete_image_struct(image_t* image); void delete_image(image_t* image); void put_image(image_t* image); -status_t map_image(int fd, char const* path, image_t* image, bool fixed); +status_t map_image(int fd, char const* path, image_t* image); void unmap_image(image_t* image); void remap_images();