diff options
author | Dimitry Ivanov <dimitry@google.com> | 2016-02-17 15:25:25 -0800 |
---|---|---|
committer | Dimitry Ivanov <dimitry@google.com> | 2016-02-17 15:25:25 -0800 |
commit | f3064e4bc7f4dee351bc2eb9272db3e9792dc683 (patch) | |
tree | db7ac4e4bb00dfdfe691897b13c91f8683557ab3 | |
parent | c347a107602f3011b393f2b2407425b5d668e14e (diff) | |
download | bionic-f3064e4bc7f4dee351bc2eb9272db3e9792dc683.tar.gz |
Use insert_link_map_into_debug_map for executable
Use insert_link_map_into_debug_map to insert the main
executable's link_map to r_debug
Change-Id: I0eacb3f030ea3eb16ed50ad2011d604beece2d03
-rw-r--r-- | linker/linker.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index fbb9f11eb..872d81d06 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -214,21 +214,21 @@ static pthread_mutex_t g__r_debug_mutex = PTHREAD_MUTEX_INITIALIZER; static r_debug _r_debug = {1, nullptr, reinterpret_cast<uintptr_t>(&rtld_db_dlactivity), r_debug::RT_CONSISTENT, 0}; -static link_map* r_debug_tail = 0; +static link_map* r_debug_tail = nullptr; static void insert_link_map_into_debug_map(link_map* map) { // Stick the new library at the end of the list. // gdb tends to care more about libc than it does // about leaf libraries, and ordering it this way // reduces the back-and-forth over the wire. - if (r_debug_tail) { + if (r_debug_tail != nullptr) { r_debug_tail->l_next = map; map->l_prev = r_debug_tail; - map->l_next = 0; + map->l_next = nullptr; } else { _r_debug.r_map = map; - map->l_prev = 0; - map->l_next = 0; + map->l_prev = nullptr; + map->l_next = nullptr; } r_debug_tail = map; } @@ -4000,11 +4000,7 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW( map->l_addr = 0; map->l_name = args.argv[0]; - map->l_prev = nullptr; - map->l_next = nullptr; - - _r_debug.r_map = map; - r_debug_tail = map; + insert_link_map_into_debug_map(map); init_linker_info_for_gdb(linker_base); |