This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/1171: GDB 5.3 misreads the symbol table for very big executables
- From: leob at mailcom dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 3 Apr 2003 04:49:33 -0000
- Subject: gdb/1171: GDB 5.3 misreads the symbol table for very big executables
- Reply-to: leob at mailcom dot com
>Number: 1171
>Category: gdb
>Synopsis: GDB 5.3 misreads the symbol table for very big executables
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Apr 03 04:58:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: leob at mailcom dot com
>Release: gdb-5.3
>Organization:
>Environment:
sparc-sun-solaris-2.7
>Description:
GDB reads the symbol table incorrectly from big executables,
compiled with g++-3.2.2 (--with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld)
There are two executables, "small", and "big":
> size small
text data bss dec hex filename
5290863 743031 122768 6156662 5df176
> size big
text data bss dec hex filename
9413938 1281701 695028 11390667 adcecb
They have quite a few sections:
> objdump -h small | wc -l
23215
(that is, there are (23215-5)/2 = 11605 sections
> objdump -h big | wc -l
38585
(38505-5)/2 = 19290
Let's see where "main" is:
> nm small | fgrep 'T main'
0016b30c T main
> nm big | fgrep 'T main'
0025b844 T main
Now let's see what GDB thinks about the location of "main"
> gdb small
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.7"...
(gdb) info addr main
Symbol "main" is a function at address 0x16b30c.
(gdb)
GOOD
> gdb big
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.7"...
(gdb) info addr main
Symbol "main" is a function at address 0x97cc60.
(gdb)
BAD !!!!
The bug does not depend on the presence of the debug informaition
or even of the "static" symbol table, as the symbol "main" is present
in the dynamic symbol table as well.
>How-To-Repeat:
Looks like a size-dependent problem; may need more than 8M of .text
and more than 16K of .gnu.linkonce sections (???) to reproduce.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: