boot: remove check against large gaps between elf segments
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 <[email protected]>
This commit is contained in:
@@ -273,19 +273,10 @@ ELFLoader<Class>::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;
|
||||
|
||||
Reference in New Issue
Block a user