Bug 6924 - ld does not understand DWARF version 3 when trying to get a source line number
Summary: ld does not understand DWARF version 3 when trying to get a source line number
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-29 22:06 UTC by Geir Johansen
Modified: 2009-01-19 12:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geir Johansen 2008-09-29 22:06:00 UTC
Using ld version 2.18 when linking a PGI 7.2-5 compiled program, I see the
following dwarf error:

$ cat datatypes.module.f90
module datatypes
  integer, parameter :: short = 1
end module datatypes
$ cat main.f90
program TEST
  use datatypes
end program TEST
$ pgf90 -Mdwarf3 -g -c datatypes.module.f90                   <
$ pgf90 -Mdwarf3 -g -c main.f90
$ pgf90 -Mdwarf3 main.o
/usr/bin/ld: Dwarf Error: found dwarf version '3', this reader only handles
version 2 information.
main.o:(.debug_info+0x74): undefined reference to `..Dm_datatypes'
$

The "undefined reference" error is a PGI compiler error, so that can be ignored.

The message: "Dwarf Error: found dwarf version '3', this reader only handles
version 2 information." is occurring when the loader is trying to get the line
number for the "undefined reference" error.  'ld' should at least be able to get
the source line number for a code in Dwarf 3 format.
Comment 1 christophe.lyon@st.com 2008-09-30 07:50:39 UTC
Subject: Re:  New: ld does not understand DWARF version 3 when
 trying to get a source line number

This has been fixed as part of PR ld/3191 by Daniel Jacobowitz (on
2008/09/19)

Christophe.

On 30.09.2008 00:06, geir at cray dot com wrote:
> Using ld version 2.18 when linking a PGI 7.2-5 compiled program, I see the
> following dwarf error:
> 
> $ cat datatypes.module.f90
> module datatypes
>   integer, parameter :: short = 1
> end module datatypes
> $ cat main.f90
> program TEST
>   use datatypes
> end program TEST
> $ pgf90 -Mdwarf3 -g -c datatypes.module.f90                   <
> $ pgf90 -Mdwarf3 -g -c main.f90
> $ pgf90 -Mdwarf3 main.o
> /usr/bin/ld: Dwarf Error: found dwarf version '3', this reader only handles
> version 2 information.
> main.o:(.debug_info+0x74): undefined reference to `..Dm_datatypes'
> $
> 
> The "undefined reference" error is a PGI compiler error, so that can be ignored.
> 
> The message: "Dwarf Error: found dwarf version '3', this reader only handles
> version 2 information." is occurring when the loader is trying to get the line
> number for the "undefined reference" error.  'ld' should at least be able to get
> the source line number for a code in Dwarf 3 format.
> 

Comment 2 Alan Modra 2009-01-19 12:40:45 UTC
Closing as per comment #1