This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

elf64_alpha_find_nearest_line fails for compaq execs


elf64_alpha_find_nearest_line returns incorrect information for
executables generated with the compaq compilers for linux.

  OS:
     RedHat 6.2 w/kernel 2.2.18

  Compaq compiler:
     ccc-6.2.9.504-2

  Binutils used by compaq compiler:
     binutils-2.9.5.0.22-8

  Binutils used for libbfd which exhibited above problem:
     from CVS on 2001/01/25 (binutils-2.9.5.0.22-8 also has this
     problem)

The problem seems to be that elf64_alpha_find_nearest_line tries
to find the line number from ecoff info before falling back to
dwarf2.  It thinks it found something; however, the info is
incorrect.  The Compaq compiler uses dwarf2 so the problem can
be fixed by checking for dwarf2 info first.  This doesn't break
code generated by gcc.  Here is is patch that implements this
fix:

Index: elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.18
diff -u -r1.18 elf64-alpha.c
--- elf64-alpha.c	2001/01/23 11:45:53	1.18
+++ elf64-alpha.c	2001/01/25 23:07:08
@@ -2081,6 +2081,12 @@
 {
   asection *msec;
 
+  if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
+				     filename_ptr, functionname_ptr,
+				     line_ptr, 0,
+				     &elf_tdata (abfd)->dwarf2_find_line_info))
+    return true;
+
   msec = bfd_get_section_by_name (abfd, ".mdebug");
   if (msec != NULL)
     {

-----------------------------------------------------------------------
Curtis Janssen
cljanss@ca.sandia.gov                http://aros.ca.sandia.gov/~cljanss
Tel: +1 925-294-1509                 Fax: +1 925-294-2234
Sandia National Labs, MS 9217, PO Box 969, Livermore, CA 94551, USA

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