summaryrefslogtreecommitdiffstats
path: root/linker/linker_phdr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linker/linker_phdr.cpp')
-rw-r--r--linker/linker_phdr.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 5f2b2c1..4884364 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -202,13 +202,13 @@ bool ElfReader::VerifyElfHeader() {
}
if (header_.e_machine !=
-#ifdef ANDROID_ARM_LINKER
+#if defined(__arm__)
EM_ARM
-#elif defined(ANDROID_MIPS_LINKER)
- EM_MIPS
-#elif defined(ANDROID_X86_LINKER)
+#elif defined(__i386__)
EM_386
-#elif defined(ANDROID_X86_64_LINKER)
+#elif defined(__mips__)
+ EM_MIPS
+#elif defined(__x86_64__)
EM_X86_64
#endif
) {
@@ -321,10 +321,6 @@ bool ElfReader::ReserveAddressSpace() {
return true;
}
-// Map all loadable segments in process' address space.
-// This assumes you already called phdr_table_reserve_memory to
-// reserve the address space range for the library.
-// TODO: assert assumption.
bool ElfReader::LoadSegments() {
for (size_t i = 0; i < phdr_num_; ++i) {
const Elf_Phdr* phdr = &phdr_table_[i];
@@ -513,7 +509,7 @@ int phdr_table_protect_gnu_relro(const Elf_Phdr* phdr_table, size_t phdr_count,
return _phdr_table_set_gnu_relro_prot(phdr_table, phdr_count, load_bias, PROT_READ);
}
-#ifdef ANDROID_ARM_LINKER
+#if defined(__arm__)
# ifndef PT_ARM_EXIDX
# define PT_ARM_EXIDX 0x70000001 /* .ARM.exidx segment */
@@ -550,7 +546,7 @@ int phdr_table_get_arm_exidx(const Elf_Phdr* phdr_table, size_t phdr_count,
*arm_exidx_count = 0;
return -1;
}
-#endif /* ANDROID_ARM_LINKER */
+#endif
/* Return the address and size of the ELF file's .dynamic section in memory,
* or NULL if missing.