Merge "Clarify which linker we are."

This commit is contained in:
Elliott Hughes 2016-01-05 19:38:47 +00:00 committed by Gerrit Code Review
commit c6c3b47be2
1 changed files with 14 additions and 4 deletions

View File

@ -3267,7 +3267,7 @@ bool soinfo::prelink_image() {
/* We can't log anything until the linker is relocated */ /* We can't log anything until the linker is relocated */
bool relocating_linker = (flags_ & FLAG_LINKER) != 0; bool relocating_linker = (flags_ & FLAG_LINKER) != 0;
if (!relocating_linker) { if (!relocating_linker) {
INFO("[ linking %s ]", get_realpath()); INFO("[ Linking '%s' ]", get_realpath());
DEBUG("si->base = %p si->flags = 0x%08x", reinterpret_cast<void*>(base), flags_); DEBUG("si->base = %p si->flags = 0x%08x", reinterpret_cast<void*>(base), flags_);
} }
@ -3954,17 +3954,27 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(
g_ld_debug_verbosity = atoi(LD_DEBUG); g_ld_debug_verbosity = atoi(LD_DEBUG);
} }
#if defined(__LP64__)
INFO("[ Android dynamic linker (64-bit) ]");
#else
INFO("[ Android dynamic linker (32-bit) ]");
#endif
// These should have been sanitized by __libc_init_AT_SECURE, but the test // These should have been sanitized by __libc_init_AT_SECURE, but the test
// doesn't cost us anything. // doesn't cost us anything.
const char* ldpath_env = nullptr; const char* ldpath_env = nullptr;
const char* ldpreload_env = nullptr; const char* ldpreload_env = nullptr;
if (!getauxval(AT_SECURE)) { if (!getauxval(AT_SECURE)) {
ldpath_env = getenv("LD_LIBRARY_PATH"); ldpath_env = getenv("LD_LIBRARY_PATH");
if (ldpath_env != nullptr) {
INFO("[ LD_LIBRARY_PATH set to '%s' ]", ldpath_env);
}
ldpreload_env = getenv("LD_PRELOAD"); ldpreload_env = getenv("LD_PRELOAD");
if (ldpreload_env != nullptr) {
INFO("[ LD_PRELOAD set to '%s' ]", ldpreload_env);
}
} }
INFO("[ android linker & debugger ]");
soinfo* si = soinfo_alloc(&g_default_namespace, args.argv[0], nullptr, 0, RTLD_GLOBAL); soinfo* si = soinfo_alloc(&g_default_namespace, args.argv[0], nullptr, 0, RTLD_GLOBAL);
if (si == nullptr) { if (si == nullptr) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -4213,7 +4223,7 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) {
args.abort_message_ptr = &g_abort_message; args.abort_message_ptr = &g_abort_message;
ElfW(Addr) start_address = __linker_init_post_relocation(args, linker_addr); ElfW(Addr) start_address = __linker_init_post_relocation(args, linker_addr);
INFO("[ jumping to _start ]"); INFO("[ Jumping to _start (%p)... ]", reinterpret_cast<void*>(start_address));
// Return the address that the calling assembly stub should jump to. // Return the address that the calling assembly stub should jump to.
return start_address; return start_address;