diff options
author | Zhenghua Wang <zhenghua.wang@intel.com> | 2011-10-19 00:29:14 +0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2011-11-29 17:01:08 -0800 |
commit | 897815a1feff230be3ea42655a77dcbb9a8dcca9 (patch) | |
tree | e2cbe576afb2d97fbecaa59e1b4f8229d6aca00b /linker | |
parent | faa7c1d29f9ed0b3eb252bb0bd43e7596eed5d9c (diff) | |
download | bionic-897815a1feff230be3ea42655a77dcbb9a8dcca9.zip bionic-897815a1feff230be3ea42655a77dcbb9a8dcca9.tar.gz bionic-897815a1feff230be3ea42655a77dcbb9a8dcca9.tar.bz2 |
bionic: add machine type check
android linker doesn't check machine type, it may load some
libraries which it doesn't support sometimes.
Author: Zhenghua Wang <zhenghua.wang@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Diffstat (limited to 'linker')
-rw-r--r-- | linker/linker.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linker/linker.c b/linker/linker.c index e0a8a18..17008f8 100644 --- a/linker/linker.c +++ b/linker/linker.c @@ -707,7 +707,11 @@ verify_elf_object(void *base, const char *name) if (hdr->e_ident[EI_MAG3] != ELFMAG3) return -1; /* TODO: Should we verify anything else in the header? */ - +#ifdef ANDROID_ARM_LINKER + if (hdr->e_machine != EM_ARM) return -1; +#elif defined(ANDROID_X86_LINKER) + if (hdr->e_machine != EM_386) return -1; +#endif return 0; } |