Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] solib do not add ldd if in libc
@ 2009-07-07 16:11 Aleksandar Ristovski
  2009-07-07 17:44 ` Aleksandar Ristovski
  2009-07-20 14:09 ` Pedro Alves
  0 siblings, 2 replies; 5+ messages in thread
From: Aleksandar Ristovski @ 2009-07-07 16:11 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

Hello,

On systems (QNX) that have ldd residing in libc, 
svr4_current_sos will add libc twice. Once while walking the 
linkmap and second time from r_ldsomap.

This patch adds check if ldsolib has already been added and 
if so, prevents adding duplicate entry.


Tested on linux - i386, no regressions; however, it would be 
good if someone could test for regressions on Solaris.


Thanks,

-- 
Aleksandar Ristovski
QNX Software Systems



* solib-svr4.c (svr4_current_sos): Do not add dynamic linker 
to solist
if already added.


[-- Attachment #2: solib-svr4-ldsomap-20090707.diff --]
[-- Type: text/x-patch, Size: 899 bytes --]

Index: gdb/solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.104
diff -u -p -r1.104 solib-svr4.c
--- gdb/solib-svr4.c	2 Jul 2009 17:25:58 -0000	1.104
+++ gdb/solib-svr4.c	7 Jul 2009 16:04:04 -0000
@@ -1125,7 +1125,20 @@ svr4_current_sos (void)
 	 symbol information for the dynamic linker is quite crucial
 	 for skipping dynamic linker resolver code.  */
       if (lm == 0 && ldsomap == 0)
-	lm = ldsomap = solib_svr4_r_ldsomap (info);
+	{
+	  struct so_list *so = head;
+
+	  lm = ldsomap = solib_svr4_r_ldsomap (info);
+
+	  /* On some other systems, dynamic linker resides in libc.
+	     Make sure we do not add duplicated entry for it.  */
+	  while (so)
+	    {
+	      if (so->lm_info->lm_addr == lm)
+		lm = ldsomap = 0;
+	      break;
+	    }
+	}
 
       discard_cleanups (old_chain);
     }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-21 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-07 16:11 [patch] solib do not add ldd if in libc Aleksandar Ristovski
2009-07-07 17:44 ` Aleksandar Ristovski
2009-07-21 15:40   ` Aleksandar Ristovski
2009-07-21 18:13     ` Daniel Jacobowitz
2009-07-20 14:09 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox