Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Alfonso Acosta <alfonso.acosta@gmail.com>
To: gdb@sourceware.org
Subject: Visibility of ELF symbols not taken into account by certain GDB commands?
Date: Fri, 22 Feb 2013 15:10:00 -0000	[thread overview]
Message-ID: <CAFmMash2M7KwbW=HSOOWVgNmK91qz4znDUFL-KRSFbycGnd+Cw@mail.gmail.com> (raw)

Hi,

I have observed that certain commands, ("print" and "info symbol" at
least) pick only one symbol in case of multible definitions (e.g.
malloc is defined in ls.so and libc.so, but only one of them is
picked).

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


Should this be considered a bug?


At the very least, it seems very counterintuitive to me. I would had
expected either using all occurrences of the symbol or picking the
visible one.

This issue is well covered by I question I made in Stackoverflow [1].
Here is an example of what I mean:

(gdb) info symbol malloc
malloc in section .text of /lib64/ld-linux-x86-64.so.2
(gdb) p malloc
$1 = {void *(size_t)} 0x7ffff7df0930 <malloc>
(gdb) info symbol 0x7ffff7df0930
malloc in section .text of /lib64/ld-linux-x86-64.so.2
(gdb) b malloc
Breakpoint 2 at 0x7ffff7df0930: malloc. (2 locations)
(gdb) info breakpoints
Num     Type           Disp Enb Address            What
2       breakpoint     keep y   <MULTIPLE>
2.1                         y     0x00007ffff7df0930 in malloc at
dl-minimal.c:95
2.2                         y     0x00007ffff7a9f9d0 in
__GI___libc_malloc at malloc.c:2910
(gdb)


Thanks,

Alfonso Acosta


PS: I am running  "GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02".

[1] http://stackoverflow.com/questions/14867024/duplicated-memory-management-symbols-in-libc-so-and-ld-linux-so/15008471#15008471


             reply	other threads:[~2013-02-22 15:10 UTC|newest]

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

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='CAFmMash2M7KwbW=HSOOWVgNmK91qz4znDUFL-KRSFbycGnd+Cw@mail.gmail.com' \
    --to=alfonso.acosta@gmail.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