I've also been looking at debugging with ELF and noticed the same problem as Renato. I just sent a patch to llvmcommits that fixes the problem.   DW_at_stmt_list needs to emit a label(and therefore a relocation) for the offset rather a constant 0, then the linker can fixup the offset as it shuffles object files around.<br>
<br>Krister<br><br><br><div class="gmail_quote">On Thu, Aug 26, 2010 at 5:11 AM, Renato Golin <span dir="ltr"><<a href="mailto:rengolin@systemcall.org">rengolin@systemcall.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 25 August 2010 18:54, Devang Patel <<a href="mailto:devang.patel@gmail.com">devang.patel@gmail.com</a>> wrote:<br>
> See "DwarfDebug problem with line section" thread on llvmdev. Bottom line,<br>
> we may need a target specific patch for targets that do not follow dwarf<br>
> standard (as per my reading) in this particular case.<br>
<br>
</div>Hi Devang,<br>
<br>
Ok, got the background, but will reply on this email.<br>
<br>
As far as I understood, there is nothing wrong with the way clang<br>
deals with stmt_list. The encoding is correct (AFAIK) and the offsets<br>
are always zero in every object file, as there is only one line table<br>
and one debug_info. The problem is during link time. GCC also<br>
generated zero for stmt_list in the objects but links correctly in the<br>
end.<br>
<br>
I still haven't figured out which type of relocation is needed. All I<br>
know is that GCC generates .rel.debug_info relocations that clang<br>
doesn't:<br>
<br>
clang:<br>
<br>
** Section #6 '.rel.debug_info' (SHT_REL)<br>
    Size   : 40 bytes (alignment 4)<br>
    Symbol table #22 '.symtab'<br>
    5 relocations applied to section #5 '.debug_info'<br>
<br>
GCC:<br>
<br>
** Section #7 '.rel.debug_info' (SHT_REL)<br>
    Size   : 184 bytes (alignment 4)<br>
    Symbol table #22 '.symtab'<br>
    23 relocations applied to section #6 '.debug_info'<br>
<br>
I'll dig deeper and see if I can spot what should be done.<br>
<br>
cheers,<br>
--renato<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br>