Hi,
I'm encountering an issue where MCLinker is producing what appears to be invalid DWARF debug info on 64 bit ARM but correct info on 32 bit ARM. The issue is in the .debug_info section, where every string has an offset of 0x0. This causes every string field in the compilation unit to have the same value (in this case, "clang version 3.6"). When I recompile and relink for 32 bit ARM the resulting dwarf has the correct fields. This issue can be exposed by both readelf and llvm-dwarfdump. Has anyone else encountered this issue? Is it a known bug?
This is a snippet of the compilation unit for the 64 bit version:
Compilation Unit @ offset 0x0:
Length: 0xc0 (32-bit)
Version: 4
Abbrev Offset: 0x0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_producer : (indirect string, offset: 0x0): clang version 3.6
<10> DW_AT_language : 12 (ANSI C99)
<12> DW_AT_name : (indirect string, offset: 0x0): clang version 3.6
<16> DW_AT_stmt_list : 0x0
<1a> DW_AT_comp_dir : (indirect string, offset: 0x0): clang version 3.6
<1e> DW_AT_low_pc : 0x288
<26> DW_AT_high_pc : 0x3c
And for the 32 bit version:
Compilation Unit @ offset 0x0:
Length: 0xb4 (32-bit)
Version: 4
Abbrev Offset: 0x0
Pointer Size: 4
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_producer : (indirect string, offset: 0x0): clang version 3.6
<10> DW_AT_language : 12 (ANSI C99)
<12> DW_AT_name : (indirect string, offset: 0x82): ./
saturation.rs <16> DW_AT_stmt_list : 0x0
<1a> DW_AT_comp_dir : (indirect string, offset: 0x54): /media/stephen/ssd/build
<1e> DW_AT_low_pc : 0x200
<22> DW_AT_high_pc : 0x48
This issue appears for all other fields in the .debug_info section. Appears in linux host built using tip LLVM and in both host and device tip Android Open Source Project builds.
Thanks,
Stephen McGroarty