Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec92c4fc authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am 8e274f34: Merge "make libacc run with execute stack protections enabled." into kraken

parents 1166c9b6 8e274f34
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -23,10 +23,7 @@

#include <cutils/hashmap.h>

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


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

        void release() {
            if (pProgramBase != 0) {
                free(pProgramBase);
                munmap(pProgramBase, mSize);
                pProgramBase = 0;
            }
        }
@@ -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;
        }