<div dir="ltr">Hey Kevin,<br><br>It looks like you originally implemented -g for asm by emitting a subprogram for each non-local label and using DW_TAG_unspecified_parameters to indicate that the signature was unknown. (r146262)<br>
<br>Later on (r147860) you changed these subprograms to be labels instead, but the DW_TAG_unspecified_parameters remained.<br><br>DW_TAG_unspecified_parameters is only relevant to DW_TAG_subprograms - so can we remove it now that these are labels instead? Or do you have some need for it?<br>
<br>- David</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 8:11 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><p dir="ltr"><br>
On Aug 28, 2014 6:38 AM, "Keith Walker" <<a href="mailto:kwalker@arm.com" target="_blank">kwalker@arm.com</a>> wrote:<br>
><br>
> Ana,<br>
><br>
> Did you get any further to the bottom of this issue?<br>
><br>
> Although the DW_AT_prototyped attribute is not one specified in the DWARF<br>
> specification for use on the DW_TAG_label I would have hoped this would be<br>
> benign to the tools.<br>
><br>
> One thing that looks "strange" to me is that the DW_TAG_label has a<br>
> DW_TAG_unspecified_parameters as a child.  My suspicion is that the tools do<br>
> not expect DW_TAG_label to have any children.  (The DWARF spec is silent is<br>
> this respect).</p>
</div><p dir="ltr">Sorry I didn't notice that in the original dump but that does sound particularly bogus. I will see if I can reproduce it when I get to the office.</p><div class="HOEnZb"><div class="h5">
<p dir="ltr">><br>
> Keith<br>
><br>
> > -----Original Message-----<br>
> > From: <a href="mailto:llvm-commits-bounces@cs.uiuc.edu" target="_blank">llvm-commits-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvm-commits-" target="_blank">llvm-commits-</a><br>
> > <a href="mailto:bounces@cs.uiuc.edu" target="_blank">bounces@cs.uiuc.edu</a>] On Behalf Of Ana Pazos<br>
> > Sent: 22 August 2014 22:04<br>
> > To: 'David Blaikie'; 'Weiming Zhao'<br>
> > Cc: 'llvm-commits'<br>
> > Subject: RE: [AArch64] DW_TAG_label prevents elf from loading in<br>
> > Trace32 and other tools<br>
> ><br>
> > Hi David,<br>
> ><br>
> > Unfortunately the tools do not print more details other than a generic<br>
> > error message.<br>
> ><br>
> > Are you able to load AArch64 executables built with -g on Trace32?<br>
> > Maybe you could try to reproduce the issue on your side?<br>
> ><br>
> > Thanks,<br>
> > Ana.<br>
> ><br>
> > -----Original Message-----<br>
> > From: David Blaikie [mailto:<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>]<br>
> > Sent: Friday, August 22, 2014 11:20 AM<br>
> > To: Weiming Zhao<br>
> > Cc: Ana Pazos; Tim Northover; llvm-commits<br>
> > Subject: Re: [AArch64] DW_TAG_label prevents elf from loading in<br>
> > Trace32 and other tools<br>
> ><br>
> > On Fri, Aug 22, 2014 at 11:18 AM, Weiming Zhao<br>
> > <<a href="mailto:weimingz@codeaurora.org" target="_blank">weimingz@codeaurora.org</a>> wrote:<br>
> > > Hi David,<br>
> > ><br>
> > > Thanks for your response.<br>
> > > The tool complained that "Entry error near offset xxxx in file yyyy".<br>
> > That offset is in .debug_info, around a DIE about asm label.<br>
> ><br>
> > I don't think that diagnostic is sufficient for me to guestimate what<br>
> > might be the source of the problem, sorry.<br>
> ><br>
> > ><br>
> > > For C files, clang -g is ok.<br>
> > > I just tried C files with labels and it's OK.<br>
> > ><br>
> > > We do suspect it's an issue of the tool.<br>
> > ><br>
> > > Thanks,<br>
> > > Weiming<br>
> > ><br>
> > ><br>
> > > -----Original Message-----<br>
> > > From: David Blaikie [mailto:<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>]<br>
> > > Sent: Friday, August 22, 2014 10:57 AM<br>
> > > To: Ana Pazos<br>
> > > Cc: Tim Northover; llvm-commits; <a href="mailto:weimingz@codeaurora.org" target="_blank">weimingz@codeaurora.org</a><br>
> > > Subject: Re: [AArch64] DW_TAG_label prevents elf from loading in<br>
> > > Trace32 and other tools<br>
> > ><br>
> > > On Thu, Aug 21, 2014 at 6:44 PM, Ana Pazos <<a href="mailto:apazos@codeaurora.org" target="_blank">apazos@codeaurora.org</a>><br>
> > wrote:<br>
> > >> Hi Tim,<br>
> > >><br>
> > >><br>
> > >><br>
> > >> Trace32 and some other internal tools are not loading AArch64 LLVM<br>
> > >> executables built with -g flag and the integrated assembler.<br>
> > >><br>
> > >><br>
> > >><br>
> > >> The tools complain about the entry DW_TAG_label in debug_info<br>
> > section<br>
> > >> emitted for assembly files (code in lib/MC/MCDwarf.cpp).<br>
> > ><br>
> > > You'd have to be more specific about what those complaints are.<br>
> > ><br>
> > > So far as I know (and I've looked at a fair bit of debug info - but<br>
> > not much of the asm debug info specifically) the DWARF we emit there is<br>
> > correct. I could imagine we might have an incorrect relocation for a<br>
> > label on a particular architecture or somesuch, but there's not much I<br>
> > can do to help diagnose that with the information you've provided.<br>
> > ><br>
> > >> Building the executables with LLVM with no-integrated-as flag works<br>
> > >> because GAS does not emit this entry.<br>
> > ><br>
> > > Have you tried compiling a piece of C code with an explicit label,<br>
> > > using GCC and throwing that at your tools? (clang/LLVM don't produce<br>
> > > label debug info for non-asm source, but GCC does - so if it's<br>
> > > something to do with the label debug info, that could show it)<br>
> > ><br>
> > > And/or do your tools work with clang -g output? If it's something<br>
> > generically related to relocations/addresses in debug info, I'd imagine<br>
> > it would show up with that just as well.<br>
> > ><br>
> > >><br>
> > >><br>
> > >><br>
> > >> At first I thought setting DW_AT_prototyped to 0 was the issue (it<br>
> > >> seems it should be 1 for non-C code). I changed it, but it did not<br>
> > help.<br>
> > >><br>
> > >><br>
> > >><br>
> > >> The only thing that worked was to not emit DW_TAG_label entries at<br>
> > all.<br>
> > >><br>
> > >><br>
> > >><br>
> > >> Is this a tool issue or LLVM is not emitting the fields required by<br>
> > >> DW_TAG_label correctly?<br>
> > >><br>
> > >><br>
> > >><br>
> > >> Thanks for the help,<br>
> > >><br>
> > >> Ana.<br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >> Here is a reduced example:<br>
> > >><br>
> > >><br>
> > >><br>
> > >>                 .text<br>
> > >><br>
> > >>                 .file        "a.c"<br>
> > >><br>
> > >>                 .globl     main<br>
> > >><br>
> > >>                 .align     2<br>
> > >><br>
> > >>                 .type     main,@function<br>
> > >><br>
> > >> main:                                   // @main<br>
> > >><br>
> > >> // BB#0:<br>
> > >><br>
> > >>                 sub         sp, sp, #16             // =16<br>
> > >><br>
> > >>                 movz     w8, #0<br>
> > >><br>
> > >>                 str           w8, [sp, #12]<br>
> > >><br>
> > >>                 str           w0, [sp, #8]<br>
> > >><br>
> > >>                 str           x1, [sp]<br>
> > >><br>
> > >>                 ldr           w0, [sp, #8]<br>
> > >><br>
> > >>                 add        sp, sp, #16             // =16<br>
> > >><br>
> > >>                 ret<br>
> > >><br>
> > >> .Ltmp1:<br>
> > >><br>
> > >>                 .size       main, .Ltmp1-main<br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >> aarch64-linux-gnu-objdump -dwarf=info  a.exe<br>
> > >><br>
> > >><br>
> > >><br>
> > >> a0.exe:     file format elf64-littleaarch64<br>
> > >><br>
> > >><br>
> > >><br>
> > >> Contents of the .debug_info section:<br>
> > >><br>
> > >><br>
> > >><br>
> > >>   Compilation Unit @ offset 0x0:<br>
> > >><br>
> > >>    Length:        0xa8 (32-bit)<br>
> > >><br>
> > >>    Version:       3<br>
> > >><br>
> > >>    Abbrev Offset: 0x0<br>
> > >><br>
> > >>    Pointer Size:  8<br>
> > >><br>
> > >> <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)<br>
> > >><br>
> > >>     <c>   DW_AT_stmt_list   : 0x0<br>
> > >><br>
> > >>     <10>   DW_AT_low_pc      : 0x400568<br>
> > >><br>
> > >>     <18>   DW_AT_high_pc     : 0x400588<br>
> > >><br>
> > >>     <20>   DW_AT_name        : a.s<br>
> > >><br>
> > >>     <24>   DW_AT_comp_dir    : xxx<br>
> > >><br>
> > >>     <6f>   DW_AT_producer    : LLVM ARM<br>
> > >><br>
> > >>     <90>   DW_AT_language    : 32769         (MIPS assembler)<br>
> > >><br>
> > >> <1><92>: Abbrev Number: 2 (DW_TAG_label)<br>
> > >><br>
> > >>     <93>   DW_AT_name        : main<br>
> > >><br>
> > >>     <98>   DW_AT_decl_file   : 0x1<br>
> > >><br>
> > >>     <9c>   DW_AT_decl_line   : 0x6<br>
> > >><br>
> > >>     <a0>   DW_AT_low_pc      : 0x400568<br>
> > >><br>
> > >>     <a8>   DW_AT_prototyped  : 0<br>
> > >><br>
> > >> <2><a9>: Abbrev Number: 3 (DW_TAG_unspecified_parameters)<br>
> > >><br>
> > >> <2><aa>: Abbrev Number: 0<br>
> > >><br>
> > >> <1><ab>: Abbrev Number: 0<br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >> For the executable generated by gcc:<br>
> > >><br>
> > >><br>
> > >><br>
> > >> aarch64-linux-gnu-objdump -dwarf=info g.exe<br>
> > >><br>
> > >><br>
> > >><br>
> > >> g.exe:     file format elf64-littleaarch64<br>
> > >><br>
> > >><br>
> > >><br>
> > >> Contents of the .debug_info section:<br>
> > >><br>
> > >><br>
> > >><br>
> > >>   Compilation Unit @ offset 0x0:<br>
> > >><br>
> > >>    Length:        0x7b (32-bit)<br>
> > >><br>
> > >>    Version:       2<br>
> > >><br>
> > >>    Abbrev Offset: 0x0<br>
> > >><br>
> > >>    Pointer Size:  8<br>
> > >><br>
> > >> <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)<br>
> > >><br>
> > >>     <c>   DW_AT_stmt_list   : 0x0<br>
> > >><br>
> > >>     <10>   DW_AT_low_pc      : 0x400510<br>
> > >><br>
> > >>     <18>   DW_AT_high_pc     : 0x400530<br>
> > >><br>
> > >>     <20>   DW_AT_name        : a.s<br>
> > >><br>
> > >>     <24>   DW_AT_comp_dir    : xxx<br>
> > >><br>
> > >>     <6f>   DW_AT_producer    : GNU AS 2.24.0<br>
> > >><br>
> > >>     <7d>   DW_AT_language    : 32769        (MIPS assembler)<br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >> _______________________________________________<br>
> > >> llvm-commits mailing list<br>
> > >> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> > >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> > >><br>
> > ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
><br>
><br>
><br>
</p>
</div></div></blockquote></div><br></div>