diff options
Diffstat (limited to 'rts/Linker.c')
-rw-r--r-- | rts/Linker.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index c84cfe27ba..57c76510d7 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -45,6 +45,8 @@ #include <sys/types.h> #endif +#include <fcntl.h> +#include <unistd.h> #include <inttypes.h> #include <stdlib.h> #include <string.h> @@ -1327,10 +1329,10 @@ void freeObjectCode (ObjectCode *oc) oc->sections[i].mapped_size, "freeObjectCode"); break; +#endif case SECTION_M32: // Freed by m32_allocator_free break; -#endif case SECTION_MALLOC: IF_DEBUG(zero_on_gc, memset(oc->sections[i].start, @@ -1373,7 +1375,7 @@ void freeObjectCode (ObjectCode *oc) ocDeinit_ELF(oc); #endif -#if RTS_LINKER_USE_MMAP == 1 +#if defined(NEED_M32) m32_allocator_free(oc->rx_m32); m32_allocator_free(oc->rw_m32); #endif @@ -1451,7 +1453,7 @@ mkOc( ObjectType type, pathchar *path, char *image, int imageSize, oc->mark = object_code_mark_bit; oc->dependencies = allocHashSet(); -#if RTS_LINKER_USE_MMAP +#if defined(NEED_M32) oc->rw_m32 = m32_allocator_new(false); oc->rx_m32 = m32_allocator_new(true); #endif @@ -1788,7 +1790,7 @@ int ocTryLoad (ObjectCode* oc) { // We have finished loading and relocating; flush the m32 allocators to // setup page protections. -#if RTS_LINKER_USE_MMAP +#if defined(NEED_M32) m32_allocator_flush(oc->rx_m32); m32_allocator_flush(oc->rw_m32); #endif |