Skip to content

Commit

Permalink
Enable real addressing by disabling PIE
Browse files Browse the repository at this point in the history
  • Loading branch information
vasi committed Dec 28, 2015
1 parent a89bb77 commit 4b5f3bd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions BasiliskII/src/Unix/Darwin/lowmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ void pagezero_32(struct mach_header *machhead)
/* change the permissions */
sc_cmd->maxprot = target_uint32(VM_PROT_ALL);
sc_cmd->initprot = target_uint32(VM_PROT_ALL);

#ifdef MH_PIE
/* disable pie in header */
machhead->flags = target_uint32(target_uint32(machhead->flags) & ~MH_PIE);
#endif
}

#if defined(MH_MAGIC_64)
Expand Down
12 changes: 12 additions & 0 deletions SheepShaver/src/Unix/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,18 @@ AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_mmap_vm,

fi dnl HAVE_MMAP_VM

dnl Check if we can disable position-independent code
AC_CACHE_CHECK([how to disable position-independent code],
ac_cv_no_pie, [
ac_cv_no_pie='-Wl,-no_pie'
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $ac_cv_no_pie"
AC_TRY_LINK(,,,[ac_cv_no_pie="cannot"])
if [[ "$ac_cv_no_pie" = "cannot" ]]; then
LDFLAGS="$saved_LDFLAGS"
fi
])

dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x3000],
ac_cv_pagezero_hack, [
Expand Down

0 comments on commit 4b5f3bd

Please sign in to comment.