am 125a10b8: am b6964524: Merge "Remove support for non-PIE executables"

* commit '125a10b8e25c5cf37b744f2181d30a64b500624a':
  Remove support for non-PIE executables
This commit is contained in:
Dmitriy Ivanov 2014-05-08 20:58:40 +00:00 committed by Android Git Automerger
commit 4a9e8a9ab7

View File

@ -2071,6 +2071,12 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(
si->dynamic = NULL; si->dynamic = NULL;
si->ref_count = 1; si->ref_count = 1;
ElfW(Ehdr)* elf_hdr = reinterpret_cast<ElfW(Ehdr)*>(si->base);
if (elf_hdr->e_type != ET_DYN) {
__libc_format_fd(2, "error: only position independent executables (PIE) are supported.\n");
exit(EXIT_FAILURE);
}
// Use LD_LIBRARY_PATH and LD_PRELOAD (but only if we aren't setuid/setgid). // Use LD_LIBRARY_PATH and LD_PRELOAD (but only if we aren't setuid/setgid).
parse_LD_LIBRARY_PATH(ldpath_env); parse_LD_LIBRARY_PATH(ldpath_env);
parse_LD_PRELOAD(ldpreload_env); parse_LD_PRELOAD(ldpreload_env);