From 279eeb199a20812068d4091be0652c8ba85fcba5 Mon Sep 17 00:00:00 2001 From: johannst Date: Wed, 5 May 2021 21:54:27 +0200 Subject: 04: dynld, map initial SO region with MAP_NONE --- 04_dynld_nostd/dynld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '04_dynld_nostd') diff --git a/04_dynld_nostd/dynld.c b/04_dynld_nostd/dynld.c index 5193761..4de9ed5 100644 --- a/04_dynld_nostd/dynld.c +++ b/04_dynld_nostd/dynld.c @@ -324,7 +324,7 @@ static Dso map_dependency(const char* dependency) { addr_end = (addr_end + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1); // Reserve region big enough to map all `PT_LOAD` sections of `dependency`. - uint8_t* map = mmap(0 /* addr */, addr_end - addr_start /* len */, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + uint8_t* map = mmap(0 /* addr */, addr_end - addr_start /* len */, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1 /* fd */, 0 /* file offset */); ERROR_ON(map == MAP_FAILED, "Failed to mmap address space for dependency '%s'\n", dependency); -- cgit v1.2.3