From ece6f8ba5d9b1cfc56ffaa2d74bcfbd697dd0f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Sat, 6 Sep 2014 19:38:13 +0200 Subject: [PATCH] boot: remove check against large gaps between elf segments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed on the ML the limitation of the gap between segments imposed by this check is completely artifical and pointless. Signed-off-by: Paweł Dziepak --- src/system/boot/loader/elf.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/system/boot/loader/elf.cpp b/src/system/boot/loader/elf.cpp index ef0609730e..266fec8657 100644 --- a/src/system/boot/loader/elf.cpp +++ b/src/system/boot/loader/elf.cpp @@ -273,19 +273,10 @@ ELFLoader::Load(int fd, preloaded_image* _image) secondRegion = &image->text_region; } - // Check whether the segments have an unreasonable amount of unused space - // inbetween. - totalSize = secondRegion->start + secondRegion->size - firstRegion->start; - if (totalSize > image->text_region.size + image->data_region.size - + 32 * 1024) { - dprintf("Too much space between segments %" B_PRIuSIZE "!\n", totalSize); - status = B_BAD_DATA; - goto error1; - } - // The kernel and the modules are relocatable, thus AllocateRegion() // can automatically allocate an address, but shall prefer the specified // base address. + totalSize = secondRegion->start + secondRegion->size - firstRegion->start; if (Class::AllocateRegion(&firstRegion->start, totalSize, B_READ_AREA | B_WRITE_AREA, &mappedRegion) != B_OK) { status = B_NO_MEMORY;