Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Visibility of ELF symbols not taken into account by certain GDB commands?
@ 2013-02-22 15:10 Alfonso Acosta
  2013-02-25 18:09 ` Doug Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Alfonso Acosta @ 2013-02-22 15:10 UTC (permalink / raw)
  To: gdb

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


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

end of thread, other threads:[~2013-03-15 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22 15:10 Visibility of ELF symbols not taken into account by certain GDB commands? Alfonso Acosta
2013-02-25 18:09 ` Doug Evans
2013-03-15 15:32   ` Tom Tromey

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