summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: df7436e)
raw | patch | inline | side by side (parent: df7436e)
author | Christopher Ferris <cferris@google.com> | |
Tue, 20 Aug 2013 00:45:09 +0000 (17:45 -0700) | ||
committer | Christopher Ferris <cferris@google.com> | |
Fri, 6 Sep 2013 16:53:54 +0000 (09:53 -0700) |
Bug: 8410085
Merge from internal master.
(cherry-picked from cb491bc66dc0abc145930b09086eb9189a30f6c2)
Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
Merge from internal master.
(cherry-picked from cb491bc66dc0abc145930b09086eb9189a30f6c2)
Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk
index e87ef38030aaba0e7bfe79220935dea2579f3ebf..5f2443f9aaeeec7ce4bc0eab9e6313d9a3b47384 100644 (file)
--- a/libc/arch-arm/arm.mk
+++ b/libc/arch-arm/arm.mk
# These are used by the static and dynamic versions of the libc
# respectively.
_LIBC_ARCH_STATIC_SRC_FILES := \
- arch-arm/bionic/exidx_static.c
+ arch-arm/bionic/exidx_static.c \
+ bionic/dl_iterate_phdr_static.c \
_LIBC_ARCH_DYNAMIC_SRC_FILES := \
- arch-arm/bionic/exidx_dynamic.c
+ arch-arm/bionic/exidx_dynamic.c \
# Remove the C++ fortify function implementations for which there is an
# arm assembler version.
diff --git a/libc/include/link.h b/libc/include/link.h
index 842b4483d322069921c28c9d88574bbe91162fa7..0edf5df9a1d99c45a696b4a60803de20f2545711 100644 (file)
--- a/libc/include/link.h
+++ b/libc/include/link.h
ElfW(Half) dlpi_phnum;
};
+int dl_iterate_phdr(int (*cb)(struct dl_phdr_info*, size_t, void*), void*);
+
#ifdef __arm__
typedef long unsigned int* _Unwind_Ptr;
_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount);
-#else
-int dl_iterate_phdr(int (*cb)(struct dl_phdr_info*, size_t, void*), void*);
#endif
__END_DECLS
diff --git a/libdl/libdl.c b/libdl/libdl.c
index 378f521b6ab1f3f4c65864ae69f5ba3220a5652b..548364cba4f6991d09a3dce2430a984d41b77c72 100644 (file)
--- a/libdl/libdl.c
+++ b/libdl/libdl.c
void *dl_unwind_find_exidx(void *pc, int *pcount) { return 0; }
-#elif defined(__i386__) || defined(__mips__)
+#endif
/* we munge the cb definition so we don't have to include any headers here.
* It won't affect anything since these are just symbols anyway */
int dl_iterate_phdr(int (*cb)(void *info, void *size, void *data), void *data) { return 0; }
-
-#else
-#error Unsupported architecture. Only mips, arm and x86 are supported.
-#endif
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index 638164d688800dc10575f460be6839e763b266b4..946f79eb7d76d5eb14ec36561ded25c8686cecf4 100644 (file)
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
}
#if defined(ANDROID_ARM_LINKER)
-// 0000000 00011111 111112 22222222 2333333 3333444444444455555555556666666 6667
-// 0123456 78901234 567890 12345678 9012345 6789012345678901234567890123456 7890
+// 0000000 00011111 111112 22222222 2333333 3333444444444455555555556666666 6667777777777888 8888888
+// 0123456 78901234 567890 12345678 9012345 6789012345678901234567890123456 7890123456789012 3456789
#define ANDROID_LIBDL_STRTAB \
- "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0android_update_LD_LIBRARY_PATH\0dl_unwind_find_exidx\0"
-
+ "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0android_update_LD_LIBRARY_PATH\0dl_iterate_phdr\0dl_unwind_find_exidx\0"
#elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER)
// 0000000 00011111 111112 22222222 2333333 3333444444444455555555556666666 6667
// 0123456 78901234 567890 12345678 9012345 6789012345678901234567890123456 7890
ELF32_SYM_INITIALIZER(21, &dlerror, 1),
ELF32_SYM_INITIALIZER(29, &dladdr, 1),
ELF32_SYM_INITIALIZER(36, &android_update_LD_LIBRARY_PATH, 1),
-#if defined(ANDROID_ARM_LINKER)
- ELF32_SYM_INITIALIZER(67, &dl_unwind_find_exidx, 1),
-#elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER)
ELF32_SYM_INITIALIZER(67, &dl_iterate_phdr, 1),
+#if defined(ANDROID_ARM_LINKER)
+ ELF32_SYM_INITIALIZER(83, &dl_unwind_find_exidx, 1),
#endif
};
// Note that adding any new symbols here requires
// stubbing them out in libdl.
static unsigned gLibDlBuckets[1] = { 1 };
+#if defined(ANDROID_ARM_LINKER)
+static unsigned gLibDlChains[9] = { 0, 2, 3, 4, 5, 6, 7, 8, 0 };
+#else
static unsigned gLibDlChains[8] = { 0, 2, 3, 4, 5, 6, 7, 0 };
+#endif
// This is used by the dynamic linker. Every process gets these symbols for free.
soinfo libdl_info = {
strtab: ANDROID_LIBDL_STRTAB,
symtab: gLibDlSymtab,
- nbucket: 1,
- nchain: 8,
+ nbucket: sizeof(gLibDlBuckets)/sizeof(unsigned),
+ nchain: sizeof(gLibDlChains)/sizeof(unsigned),
bucket: gLibDlBuckets,
chain: gLibDlChains,
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 623be29f307bc5d9cf569f303aeec8cc6e4b5835..0f201815f5813e588de178927dc0aab756a707db 100644 (file)
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
return NULL;
}
-#elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER)
+#endif
/* Here, we only have to provide a callback to iterate across all the
* loaded libraries. gcc_eh does the rest. */
return rv;
}
-#endif
-
static Elf32_Sym* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name) {
Elf32_Sym* symtab = si->symtab;
const char* strtab = si->strtab;