diff options
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r-- | linker/linker.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index eedce7029..e09b2a4c8 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -1503,7 +1503,16 @@ static bool load_library(android_namespace_t* ns, // Open the file. int fd = open_library(ns, zip_archive_cache, name, needed_by, &file_offset, &realpath); if (fd == -1) { - DL_OPEN_ERR("library \"%s\" not found", name); + if (task->is_dt_needed()) { + if (needed_by->is_main_executable()) { + DL_OPEN_ERR("library \"%s\" not found: needed by main executable", name); + } else { + DL_OPEN_ERR("library \"%s\" not found: needed by %s in namespace %s", name, + needed_by->get_realpath(), task->get_start_from()->get_name()); + } + } else { + DL_OPEN_ERR("library \"%s\" not found", name); + } return false; } @@ -3162,7 +3171,10 @@ bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& r TRACE_TYPE(RELO, "RELO IRELATIVE %16p <- %16p\n", reinterpret_cast<void*>(reloc), reinterpret_cast<void*>(load_bias + addend)); - { + // In the linker, ifuncs are called as soon as possible so that string functions work. + // We must not call them again. (e.g. On arm32, resolving an ifunc changes the meaning of + // the addend from a resolver function to the implementation.) + if (!is_linker()) { #if !defined(__LP64__) // When relocating dso with text_relocation .text segment is // not executable. We need to restore elf flags for this |