diff options
author | johannst <johannes.stoelp@gmail.com> | 2021-05-05 21:54:27 +0200 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2021-05-05 21:54:27 +0200 |
commit | 279eeb199a20812068d4091be0652c8ba85fcba5 (patch) | |
tree | 9a95fb4e3c589e0e9bb829dffaea6e142659c872 /04_dynld_nostd | |
parent | ad221d0a353cf3c9e7d660dd1a64aea7dd906cd0 (diff) | |
download | dynld-279eeb199a20812068d4091be0652c8ba85fcba5.tar.gz dynld-279eeb199a20812068d4091be0652c8ba85fcba5.zip |
04: dynld, map initial SO region with MAP_NONE
Diffstat (limited to '04_dynld_nostd')
-rw-r--r-- | 04_dynld_nostd/dynld.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |