<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div><div>Hi,<br>I 'm trying to figure out why LLVM emits broken DWARF debug info on Windows.   When I load executable in gdb it says "DW_FORM_strp pointing outside of .debug_str section [in module ... ]"   It looks like this issue had been previously reported here <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-October/025291.html" target="_blank">[1]</a>, <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054751.html" target="_blank">[2]</a>.   I am still seeing this error with clang compiled from master branch (as well as in 3.3 and 3.2).<br>

<br></div>So I compared asm emitted by clang with that created by gcc, and the difference seems to be that for inter-debug-section references gcc uses .secrel32 <label> directive, whereas clang uses .long <label>.   After manually replacing .long's with .secrel32's and building executable, gdb seemed to like new debug info a lot more!<br>

<br></div><div>I am not sure what's the right approach for fixing this.  Should .secrel32 be used on all platforms, or just for Windows PE-COFF?   Can somebody familiar with intricacies of DWARF format on different platforms please comment of this?   <br>

</div><br></div>thanks!<br></div><div><font color="#888888"><span style="color:rgb(0,0,0)">Vadim</span><br></font></div></div><br></div>