This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
elf64_alpha_find_nearest_line fails for compaq execs
- To: binutils at sources dot redhat dot com
- Subject: elf64_alpha_find_nearest_line fails for compaq execs
- From: "Curtis L. Janssen" <cljanss at aros dot ca dot sandia dot gov>
- Date: Thu, 25 Jan 2001 15:17:12 -0800
- Reply-to: cljanss at ca dot sandia dot gov
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