AArch64 invalid DWARF compilation unit

42 views
Skip to first unread message

Stephen Mcgroarty

unread,
Jul 7, 2015, 1:29:29 PM7/7/15
to mcli...@googlegroups.com
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

Diana Chen

unread,
Jul 8, 2015, 3:45:00 AM7/8/15
to Stephen Mcgroarty, mcli...@googlegroups.com
Hi Stephen,
Thanks for your report. This bug is fixed by latest revision

Diana

--
You received this message because you are subscribed to the Google Groups "MCLinker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mclinker+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Mcgroarty

unread,
Jul 8, 2015, 6:14:15 AM7/8/15
to mcli...@googlegroups.com, smc...@gmail.com
Hi Diana,

Thanks for the prompt reply! Checked out and verified it on my end, thanks!

Stephen
Reply all
Reply to author
Forward
0 new messages