linker: don't pass dlextinfo to dependent loads

Don't pass the parent load's dlextinfo to dependent loads, since this
causes the linker to try to load the dependencies using the same
addresses/relro/fds/etc as the main library, which is never going to
work. This was how it worked before ae69a95 which broke this.

Bug: http://b/23742664
Bug: http://b/20948231
Bug: http://b/20841817
Change-Id: I340ebae1127666d5c6c6f9c6521b89fb93f15bdd
This commit is contained in:
Dmitriy Ivanov
2015-09-02 16:32:02 -07:00
parent cc25196662
commit edfc9f63a2
3 changed files with 19 additions and 2 deletions

View File

@@ -1525,13 +1525,16 @@ static bool find_libraries(soinfo* start_with,
for (LoadTask::unique_ptr task(load_tasks.pop_front());
task.get() != nullptr; task.reset(load_tasks.pop_front())) {
soinfo* needed_by = task->get_needed_by();
bool is_dt_needed = needed_by != nullptr && (needed_by != start_with || add_as_children);
soinfo* si = find_library_internal(load_tasks, task->get_name(), needed_by,
rtld_flags, extinfo);
rtld_flags,
is_dt_needed ? nullptr : extinfo);
if (si == nullptr) {
return false;
}
if (needed_by != nullptr && (needed_by != start_with || add_as_children)) {
if (is_dt_needed) {
needed_by->add_child(si);
}