public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/9807] New: _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving
@ 2009-02-02 14:26 jan dot kratochvil at redhat dot com
  2009-02-02 19:08 ` [Bug symtab/9807] " drow at false dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-02-02 14:26 UTC (permalink / raw)
  To: gdb-prs

GDB testsuite reported a regression on:
gdb.mi/mi2-disassemble.exp: data-disassemble range assembly mixed

It was due to unfortunate prelink address and a bogus _SDA_BASE_ address:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf
Al
  [21] .bss              NOBITS          00028a60 018960 000030 00  WA  0   0 
4
0x00028a60 + 0x000030 == 0x28a90
  [18] .sdata            PROGBITS        00028530 018530 000430 00  WA  0   0 
8
Symbol table '.symtab' contains 723 entries:
   600: 00030530     0 OBJECT  LOCAL  DEFAULT   18 _SDA_BASE_

0x30530 > 0x28a90 - symbol being behind the end of file.
In fact it should not be out of the range of its section number 18.

Steps to Reproduce:
Prelink /lib/ld.so.1 to 0x0ffd0000
cat >cmd <<EOH
# 0x1000053c is $pc after `start'
info line *0x1000053c
start
info line *0x1000053c
q
EOH
gdb -nx -x ./cmd gdb-6.3.0.0-1.160.el4.src/gdb-6.3/gdb/testsuite/gdb.mi/basics

Actual results:
Line 54 of "./gdb.mi/basics.c" starts at address 0x1000053c <main+20> and ends
at 0x10000558 <main+48>.
Breakpoint 1 at 0x1000053c: file ./gdb.mi/basics.c, line 54.
main () at ./gdb.mi/basics.c:54
54   callee1 (2, "A string argument.", 3.5);
Line 54 of "./gdb.mi/basics.c" is at address 0x1000053c <main+20> but contains
no code.

Expected results:
Line 54 of "./gdb.mi/basics.c" starts at address 0x1000053c <main+20> and ends
at 0x10000558 <main+48>.
Breakpoint 1 at 0x1000053c: file ./gdb.mi/basics.c, line 54.
main () at ./gdb.mi/basics.c:54
54   callee1 (2, "A string argument.", 3.5);
Line 54 of "./gdb.mi/basics.c" starts at address 0x1000053c <main+20> and ends
at 0x10000558 <main+48>.

Additional info:
The problem affects only debugging (GDB) as _SDA_BASE_ is just in `.symtab'.

Comment From Roland McGrath 2009-01-25 14:57:03 EDT
_SDA_BASE_ is a special-case symbol on ppc.  elflint does have checks for
symbols being out of their section bounds, but there are machine-dependent
special exceptions.  _SDA_BASE_ is set to .sdata+0x8000 because it's used for
ppc insns where there is a -0x8000 bias applied to constants (or something like
that).  Also _SDA2_BASE_ is .sdata2+0x8000.

->

_SDA_BASE_ and _SDA2_BASE_ should be ignored for addresses resolving.

-- 
           Summary: _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: symtab
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org
  GCC host triplet: ppc-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=9807

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug symtab/9807] _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving
  2009-02-02 14:26 [Bug symtab/9807] New: _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving jan dot kratochvil at redhat dot com
@ 2009-02-02 19:08 ` drow at false dot org
  2009-02-02 19:18 ` jan dot kratochvil at redhat dot com
  2009-02-02 19:38 ` drow at false dot org
  2 siblings, 0 replies; 4+ messages in thread
From: drow at false dot org @ 2009-02-02 19:08 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From drow at false dot org  2009-02-02 19:08 -------
Subject: Re:  New: _SDA_BASE_+_SDA2_BASE_ not valid for
	symbols resolving

I don't understand - what is GDB doing wrong?  Is the _SDA_BASE_ that
is causing trouble the one in ld.so.1 or in the application?

We should probably ignore all section-relative symbols which are
outside the containing section.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9807

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug symtab/9807] _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving
  2009-02-02 14:26 [Bug symtab/9807] New: _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving jan dot kratochvil at redhat dot com
  2009-02-02 19:08 ` [Bug symtab/9807] " drow at false dot org
@ 2009-02-02 19:18 ` jan dot kratochvil at redhat dot com
  2009-02-02 19:38 ` drow at false dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-02-02 19:18 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jan dot kratochvil at redhat dot com  2009-02-02 19:18 -------
(In reply to comment #1)
> I don't understand - what is GDB doing wrong?

>From the user POV the wrong point is: "but contains no code"
>From the GDB POV during addr->line resolving it will falsely find _SDA_BASE_
instead of some real main() symbol and fails to resolve the line number from it.

> Is the _SDA_BASE_ that is causing trouble the one in ld.so.1 or in the
> application?

In ld.so.1 if it gets "randomly" prelinked at inappropriate address to clash
with the (fixed) application address space.

On 32-bit (ppc) unfortunately `prelink -R' in fact is not random so on some
systems this unfortunate clash may occur permanently breaking GDB a bit.

> We should probably ignore all section-relative symbols which are
> outside the containing section.

FYI elfutils has _SDA{,2}_BASE_ exception in its elflint so assuming for GDB
more some `set complaints' style complaint.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9807

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug symtab/9807] _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving
  2009-02-02 14:26 [Bug symtab/9807] New: _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving jan dot kratochvil at redhat dot com
  2009-02-02 19:08 ` [Bug symtab/9807] " drow at false dot org
  2009-02-02 19:18 ` jan dot kratochvil at redhat dot com
@ 2009-02-02 19:38 ` drow at false dot org
  2 siblings, 0 replies; 4+ messages in thread
From: drow at false dot org @ 2009-02-02 19:38 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From drow at false dot org  2009-02-02 19:38 -------
Subject: Re:  _SDA_BASE_+_SDA2_BASE_ not valid for symbols
	resolving

On Mon, Feb 02, 2009 at 07:18:26PM -0000, jan dot kratochvil at redhat dot com wrote:
> FYI elfutils has _SDA{,2}_BASE_ exception in its elflint so assuming for GDB
> more some `set complaints' style complaint.

No, it should not be a complaint; there's nothing wrong.  The binary
is ABI-conformant.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=9807

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2009-02-02 19:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-02 14:26 [Bug symtab/9807] New: _SDA_BASE_+_SDA2_BASE_ not valid for symbols resolving jan dot kratochvil at redhat dot com
2009-02-02 19:08 ` [Bug symtab/9807] " drow at false dot org
2009-02-02 19:18 ` jan dot kratochvil at redhat dot com
2009-02-02 19:38 ` drow at false dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).