Open
Description
I'm using rust from the Fedora COPR:
bapiya. rustc --version
rustc 1.7.0 (a5d1e7a59 2016-02-29)
Consider this program:
pub static AA: i32 = 5;
fn main() {
}
I compile with -g
and then examine the DWARF using readelf
. I see:
<2><2f>: Abbrev Number: 3 (DW_TAG_variable)
<30> DW_AT_name : (indirect string, offset: 0x48): AA
<34> DW_AT_type : <0x62>
<38> DW_AT_decl_file : 1
<39> DW_AT_decl_line : 1
<3a> DW_AT_location : 9 byte block: 3 0 0 0 0 0 0 0 0 (DW_OP_addr: 0)
<44> DW_AT_linkage_name: (indirect string, offset: 0x4f): _ZN2b12AAE
Now, this variable is not actually emitted. There's no ELF symbol for it. Given this, it seems strange to emit DW_AT_linkage_name
and DW_AT_location
, especially considering that the latter is incorrect.