Skip to content

Commit

Permalink
Merge "make libacc run with execute stack protections enabled." into …
Browse files Browse the repository at this point in the history
…kraken
  • Loading branch information
nickkral authored and Android (Google) Code Review committed Apr 26, 2010
2 parents ecf835e + 093ba25 commit 8e274f3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libacc/acc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@

#include <cutils/hashmap.h>

#if defined(__i386__)
#include <sys/mman.h>
#endif


#if defined(__arm__)
#define DEFAULT_ARM_CODEGEN
Expand Down Expand Up @@ -230,7 +227,7 @@ class Compiler : public ErrorSink {

void release() {
if (pProgramBase != 0) {
free(pProgramBase);
munmap(pProgramBase, mSize);
pProgramBase = 0;
}
}
Expand Down Expand Up @@ -263,7 +260,9 @@ class Compiler : public ErrorSink {
virtual void init(int size) {
release();
mSize = size;
pProgramBase = (char*) calloc(1, size);
pProgramBase = (char*) mmap(NULL, size,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
ind = pProgramBase;
}

Expand Down

0 comments on commit 8e274f3

Please sign in to comment.