Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Doug Evans <dje@google.com>
Cc: Alfonso Acosta <alfonso.acosta@gmail.com>, gdb <gdb@sourceware.org>
Subject: Re: Visibility of ELF symbols not taken into account by certain GDB commands?
Date: Fri, 15 Mar 2013 15:32:00 -0000	[thread overview]
Message-ID: <87wqt81xy6.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CADPb22QEPneO9JwbJMS4_v9EhKBPjTMikONrAq6oD_hgSh8AcQ@mail.gmail.com>	(Doug Evans's message of "Mon, 25 Feb 2013 10:09:14 -0800")

Alfonso> During that selection, visibility is not taken into account (e.g. the
Alfonso> ld.so malloc symbol is used although the globally visible one, from
Alfonso> the dynamic loaders point of view, is the one in libc.so)

Alfonso> Should this be considered a bug?

Doug> 1) ELF symbol visibility doesn't really enter the picture.
Doug> Sometimes you don't want it to.  Though I can see a usefulness in
Doug> having knobs to control this, I'm not aware of any (could just be my
Doug> bad memory :-)) or any plans to add them.

Yeah, I don't know about plans to deal with visibility, but there are
some open bugs about how gdb doesn't respect ELF semantics, and so you
can sometimes write expressions that don't give the same result as the
same expression in the source.

E.g., there's a couple of bugs related to copy relocations.

Doug> What happens, in a nutshell, is gdb looks up the symbol in the current
Doug> context (whatever that is), and then does a search over all contexts.
Doug> This involves doing a linear search over the binary and all shared
Doug> libraries and using the first one found.  In this case it's the one in
Doug> ld.so.

... there's also a tweak here to try to reproduce ELF semantics.  I
found elf_lookup_lib_symbol and the corresponding target_so_ops method,
but I thought there was some other hook too... can't find it right now.

Tom


      reply	other threads:[~2013-03-15 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 15:10 Alfonso Acosta
2013-02-25 18:09 ` Doug Evans
2013-03-15 15:32   ` Tom Tromey [this message]

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=87wqt81xy6.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=alfonso.acosta@gmail.com \
    --cc=dje@google.com \
    --cc=gdb@sourceware.org \
    /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