Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] solib do not add ldd if in libc
Date: Tue, 21 Jul 2009 15:40:00 -0000	[thread overview]
Message-ID: <4A65DAB3.1040803@qnx.com> (raw)
In-Reply-To: <h301hr$dlb$1@ger.gmane.org>

Pedro, I am copying your reply here since my reply to myself 
contains better while loop which I actually wanted you to 
see. (and I'm replying to you below).

> Aleksandar Ristovski wrote:
>> 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.
>>
> 
> This time with the right patch.
> 
> 
> 

Pedro Alves wrote:
 > On Tuesday 07 July 2009 17:11:21, Aleksandar Ristovski wrote:
 >
 > [This is not a formal review, just a quick note: ] did 
you post the
 > patch you intended to post?  That while loop looks wrong.
 >
 > I note that solib_svr4_r_ldsomap's describing comment 
seems to
 > indicate that a fix there would fit better with its design.
 >
 > /* Find the link map for the dynamic linker (if it is not 
in the
 >    normal list of loaded shared objects).  */
 >
 > static CORE_ADDR
 > solib_svr4_r_ldsomap (struct svr4_info *info)
 > {
 >

Our r_debug is version 2 and we do have r_ldsomap member. We 
set it to our dynamic linker which coincides with libc. My 
patch loops through the list of so-s and looks for already 
added object; if found, then resets ldsomap to prevent outer 
loop from doing another iteration.

I, unfortunately, can not verify that it doesn't break 
solaris... I think it doesn't, but I couldn't test it 
(AFAIK, solaris has dynamic linker in a separate shared 
library and so it should not be found in the so list, but I 
don't have Solaris to verify this).


Thanks,

-- 
Aleksandar Ristovski
QNX Software Systems


  reply	other threads:[~2009-07-21 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07 16:11 Aleksandar Ristovski
2009-07-07 17:44 ` Aleksandar Ristovski
2009-07-21 15:40   ` Aleksandar Ristovski [this message]
2009-07-21 18:13     ` Daniel Jacobowitz
2009-07-20 14:09 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A65DAB3.1040803@qnx.com \
    --to=aristovski@qnx.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox