OSDN Git Service

Fill l_ld of linkmaps with value from soinfo::dynamic.
authorThinker K.F Li <thinker@branda.to>
Fri, 3 Jul 2009 11:40:32 +0000 (19:40 +0800)
committerJean-Baptiste Queru <jbq@google.com>
Wed, 16 Sep 2009 00:05:55 +0000 (17:05 -0700)
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.

linker/linker.c

index 789a828..27fe9d7 100644 (file)
@@ -152,6 +152,7 @@ static void insert_soinfo_into_debug_map(soinfo * info)
     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