This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/1630: Get sect_index_data not initialized for libm.so on Tru64 V5.1A with -taso


>Number:         1630
>Category:       gdb
>Synopsis:       Get sect_index_data not initialized for libm.so on Tru64 V5.1A with -taso
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          patch
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 27 18:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     martin@xanalys.com
>Release:        GNU gdb 6.1
>Organization:
>Environment:
OSF1 schiele V5.1 1885 alpha
Compaq C V6.4-009 on Compaq Tru64 UNIX V5.1A (Rev. 1885)
This GDB was configured as "alpha-dec-osf5.1"
>Description:
When debugging a program linked with the -taso option (32 bit address space) and libm.so, gdb will abort with "internal-error: sect_index_data not initialized" when the program is run.

The problem is that the sect_index_data is set from the .data section, but the library doesn't have one.
>How-To-Repeat:
If the file t.c contains:

int main(int argc, char *argv)
{
  return (sin(argc)+1.0) > 0;
}

and is compiled and run with:

cc -taso t.c -o /tmp/a.out2 -lm
gdb-6.1/gdb/gdb /tmp/a.out2

then the output is like this:

GNU gdb 6.1
Copyright 2004 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 "alpha-dec-osf5.1"...(no debugging symbols found)...
gdb> r
Starting program: /cluster/members/member0/tmp/a.out2 
(no debugging symbols found)...mdebugread.c:2435: internal-error: sect_index_data not initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) 
>Fix:
The code in parse_partial_symbols() assumes that all "data" sections have the same offset, so we can pick one of the other sections if the main data section doesn't exist (warning optional):

--- gdb-6.1/gdb/symfile.c~	Sat Feb 28 18:04:37 2004
+++ gdb-6.1/gdb/symfile.c	Tue Apr 27 18:23:15 2004
@@ -396,6 +396,16 @@
   sect = bfd_get_section_by_name (objfile->obfd, ".data");
   if (sect) 
     objfile->sect_index_data = sect->index;
+  else
+    {
+      sect = bfd_get_section_by_name (objfile->obfd, ".sdata");
+      if (sect)
+        {
+          objfile->sect_index_data = sect->index;
+          warning ("no .data section found in added symbol-file %s, using .sdata",
+		   objfile->name);
+        }
+    }
 
   sect = bfd_get_section_by_name (objfile->obfd, ".bss");
   if (sect) 
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]