[AArch64] DW_TAG_label prevents elf from loading in Trace32 and other tools
Ana Pazos
apazos at codeaurora.org
Thu Aug 21 18:44:39 PDT 2014
Hi Tim,
Trace32 and some other internal tools are not loading AArch64 LLVM
executables built with -g flag and the integrated assembler.
The tools complain about the entry DW_TAG_label in debug_info section
emitted for assembly files (code in lib/MC/MCDwarf.cpp).
Building the executables with LLVM with no-integrated-as flag works because
GAS does not emit this entry.
At first I thought setting DW_AT_prototyped to 0 was the issue (it seems it
should be 1 for non-C code). I changed it, but it did not help.
The only thing that worked was to not emit DW_TAG_label entries at all.
Is this a tool issue or LLVM is not emitting the fields required by
DW_TAG_label correctly?
Thanks for the help,
Ana.
Here is a reduced example:
.text
.file "a.c"
.globl main
.align 2
.type main, at function
main: // @main
// BB#0:
sub sp, sp, #16 // =16
movz w8, #0
str w8, [sp, #12]
str w0, [sp, #8]
str x1, [sp]
ldr w0, [sp, #8]
add sp, sp, #16 // =16
ret
.Ltmp1:
.size main, .Ltmp1-main
aarch64-linux-gnu-objdump -dwarf=info a.exe
a0.exe: file format elf64-littleaarch64
Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0xa8 (32-bit)
Version: 3
Abbrev Offset: 0x0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_stmt_list : 0x0
<10> DW_AT_low_pc : 0x400568
<18> DW_AT_high_pc : 0x400588
<20> DW_AT_name : a.s
<24> DW_AT_comp_dir : xxx
<6f> DW_AT_producer : LLVM ARM
<90> DW_AT_language : 32769 (MIPS assembler)
<1><92>: Abbrev Number: 2 (DW_TAG_label)
<93> DW_AT_name : main
<98> DW_AT_decl_file : 0x1
<9c> DW_AT_decl_line : 0x6
<a0> DW_AT_low_pc : 0x400568
<a8> DW_AT_prototyped : 0
<2><a9>: Abbrev Number: 3 (DW_TAG_unspecified_parameters)
<2><aa>: Abbrev Number: 0
<1><ab>: Abbrev Number: 0
For the executable generated by gcc:
aarch64-linux-gnu-objdump -dwarf=info g.exe
g.exe: file format elf64-littleaarch64
Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0x7b (32-bit)
Version: 2
Abbrev Offset: 0x0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_stmt_list : 0x0
<10> DW_AT_low_pc : 0x400510
<18> DW_AT_high_pc : 0x400530
<20> DW_AT_name : a.s
<24> DW_AT_comp_dir : xxx
<6f> DW_AT_producer : GNU AS 2.24.0
<7d> DW_AT_language : 32769 (MIPS assembler)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140821/aaf77ca8/attachment.html>
More information about the llvm-commits
mailing list