Fix linker's _r_debug (gdb) info

 * Initialize the exe's l_ld correctly, and initialize its l_addr field
   earlier.

 * Copy the phdr/phnum fields from the linker's temporary soinfo to its
   final soinfo. This change ensures that dl_iterate_phdr shows the phdr
   table for the linker.

 * Change init_linker_info_for_gdb a little: use an soinfo's fields to
   init the soinfo::link_map_head field, then reuse the new
   init_link_map_head function to handle the linker and the executable.

Test: manual
Test: bionic-unit-tests
Bug: https://issuetracker.google.com/112627083
Bug: http://b/110967431
Change-Id: I40fad2c4d48f409347aaa1ccb98d96db89da1dfe
diff --git a/linker/linker.h b/linker/linker.h
index 260c89d..7aa7e5f 100644
--- a/linker/linker.h
+++ b/linker/linker.h
@@ -99,9 +99,7 @@
 
 void count_relocation(RelocationKind kind);
 
-soinfo* get_libdl_info(const char* linker_path,
-                       const soinfo& linker_si,
-                       const link_map& linker_map);
+soinfo* get_libdl_info(const char* linker_path, const soinfo& linker_si);
 
 soinfo* find_containing_library(const void* p);