Fill l_ld of linkmaps with value from soinfo::dynamic.
GDB will try to read l_ld of linkmaps and compare the value to vma of
.dynamic sections from shared objects. Since linker does not assign l_ld,
GDB will complain about and re-compute l_addr from l_ld. And, GDB will get a
wrong value.
diff --git a/linker/linker.c b/linker/linker.c
index 789a828..27fe9d7 100644
--- a/linker/linker.c
+++ b/linker/linker.c
@@ -152,6 +152,7 @@
map = &(info->linkmap);
map->l_addr = info->base;
map->l_name = (char*) info->name;
+ map->l_ld = (uintptr_t)info->dynamic;
/* Stick the new library at the end of the list.
* gdb tends to care more about libc than it does