ldso: use get_page_size_log2 instead of "12"

Ref #1941
This commit is contained in:
Martin Stein 2016-04-18 16:00:51 +02:00 committed by Christian Helmuth
parent d5d891a227
commit 9508f397a2
2 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,7 @@ SRC_CC = main.cc test.cc exception.cc file.cc dependency.cc debug.cc \
shared_object.cc
SRC_S = jmp_slot.s
INC_DIR += $(DIR)/include
INC_DIR += $(BASE_DIR)/src/include
LD_OPT += -Bsymbolic-functions --version-script=$(DIR)/symbol.map
ifneq ($(filter linux, $(SPECS)),)

View File

@ -12,6 +12,7 @@
*/
#include <linker.h>
#include <base/internal/page_size.h>
#include <base/allocator_avl.h>
#include <os/attached_rom_dataspace.h>
@ -82,8 +83,12 @@ class Linker::Rm_area : public Rm_connection
if (addr && (_range.alloc_addr(size, addr).is_error()))
throw Region_conflict();
else if (!addr && _range.alloc_aligned(size, (void **)&addr, 12).is_error())
else if (!addr &&
_range.alloc_aligned(size, (void **)&addr,
get_page_size_log2()).is_error())
{
throw Region_conflict();
}
return addr;
}