Merge "Set linux 32bit personality for 32 bit processes"

This commit is contained in:
Dmitriy Ivanov
2015-01-08 00:46:48 +00:00
committed by Gerrit Code Review
3 changed files with 41 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
#include <string.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/personality.h>
#include <unistd.h>
#include <new>
@@ -2663,6 +2664,12 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(
ldpreload_env = linker_env_get("LD_PRELOAD");
}
#if !defined(__LP64__)
if (personality(PER_LINUX32) == -1) {
__libc_fatal("error setting PER_LINUX32 personality: %s", strerror(errno));
}
#endif
INFO("[ android linker & debugger ]");
soinfo* si = soinfo_alloc(args.argv[0], nullptr, 0, RTLD_GLOBAL);