diff options
author | Steven Laver <lavers@google.com> | 2019-11-14 08:37:29 -0800 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2019-11-14 08:37:29 -0800 |
commit | 8f54dd5edaa4ba55451f3602e5890b6f1ab807e6 (patch) | |
tree | 709208dd25e59100a8d3d9a7038a5c7ee1c8a50b /linker/linker.cpp | |
parent | 19c0c9cd4892927004dac3252b67aac89e462c5c (diff) | |
parent | cb88137aebba97024bee4fff130f131924556ee5 (diff) |
Merge RP1A.191114.001
Change-Id: I19fb768a647d471d430af4b5c3f519d4125fdeee
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 |