This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/40040] gfortran invalid DW_AT_location for overridable variables
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2009 10:24:22 -0000
- Subject: [Bug debug/40040] gfortran invalid DW_AT_location for overridable variables
- References: <bug-40040-12292@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jakub at gcc dot gnu dot org 2009-05-06 10:24 -------
I'd say this is actually a ld bug, not GCC.
GCC emits:
.uleb128 0x3 # (DIE (0x38) DW_TAG_variable)
.ascii "var\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file (pr40040lib.f90)
.byte 0x2 # DW_AT_decl_line
.long 0x4f # DW_AT_type
.byte 0x1 # DW_AT_external
.byte 0x9 # DW_AT_location
.byte 0x3 # DW_OP_addr
.quad __pr40040lib_MOD_var
and the relocation is preserved even by gas, .rela.debug_info has:
6: 0000000000200738 4 OBJECT GLOBAL DEFAULT 19 __pr40040lib_MOD_var
But then ld resolves all relocations in .rela.debug_info locally and throws
away that section, while perhaps best would be to drop most of the relocations
from that section and keep only some, against overridable objects. Still the
question is if .rela.debug_info won't be too large for practical uses.
If DW_AT_location isn't provided, how would gdb find that address out? Using
DW_AT_MIPS_linkage_name (currently not emitted) and symbol lookup?
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at gcc dot gnu dot
| |org, roland at redhat dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40040