<div dir="ltr">What version of LLVM are you using? This looks similar to a bug that I fixed in 4.0 (R290809). I mostly only tested for `-dwarf-version 4`, so you may get better results with using the newer format as well. But if it's broken on the latest version of LLVM, can you post a gist/pastebin of the LL file (e.g. `clang -S -emit-llvm`)? That'll help with reproducing it and seeing which entry is still getting relocated incorrectly in dwarf version 2.<div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 4, 2017 at 11:25 AM Aliaksei Zasenka via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">Hi all,<br class="gmail_msg"><br class="gmail_msg">Need your help.<br class="gmail_msg"><br class="gmail_msg">I added some debug information to my code according to Kaleidoscope-9 sample and got stuck with a GDB error:<br class="gmail_msg"><br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(gdb) info functions<br class="gmail_msg">invalid dwarf2 offset 1849950870<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">My module is a DLL built with llc+ld toolchain. Target triple: 'i686-w64-mingw32'.<br class="gmail_msg">Looking this offset (1849950870 == 0x6e440296) in dwarfdump output of the dll gave the following:<br class="gmail_msg"><br class="gmail_msg">0x00000296: DW_TAG_base_type [10] <br class="gmail_msg"> DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000068f] = "void")<br class="gmail_msg"> DW_AT_encoding [DW_FORM_data1] (0x00)<br class="gmail_msg"> DW_AT_byte_size [DW_FORM_data1] (0x00)<br class="gmail_msg">....<br class="gmail_msg">0x00000cf8: DW_TAG_subprogram [16] *<br class="gmail_msg"> DW_AT_low_pc [DW_FORM_addr] (0x000000006e384c30)<br class="gmail_msg"> DW_AT_high_pc [DW_FORM_data4] (0x000002b4)<br class="gmail_msg"> DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 54 )<br class="gmail_msg"> DW_AT_name [DW_FORM_strp] ( .debug_str[0x00001616] = "FB_FPUMP@HORIZONTAL")<br class="gmail_msg"> DW_AT_type [DW_FORM_ref_addr] (<span style="color:rgb(204,0,0)" class="gmail_msg"><span style="background-color:rgb(255,255,255)" class="gmail_msg"><b class="gmail_msg">0x000000006e440296</b></span></span>)<br class="gmail_msg"> DW_<br class="gmail_msg">AT_external [DW_FORM_flag_present] (true)<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">In the original object file the corresponding record was:<br class="gmail_msg"><br class="gmail_msg">0x00000296: DW_TAG_base_type [10] <br class="gmail_msg"> DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000068f] = "void")<br class="gmail_msg"> DW_AT_encoding [DW_FORM_data1] (0x00)<br class="gmail_msg"> DW_AT_byte_size [DW_FORM_data1] (0x00)<br class="gmail_msg">....<br class="gmail_msg"><br class="gmail_msg">0x00000cf8: DW_TAG_subprogram [16] *<br class="gmail_msg"> DW_AT_low_pc [DW_FORM_addr] (0x00000000000037e0)<br class="gmail_msg"> DW_AT_high_pc [DW_FORM_data4] (0x000002b4)<br class="gmail_msg"> DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 54 )<br class="gmail_msg"> DW_AT_name [DW_FORM_strp] ( .debug_str[0x00001616] = "FB_FPUMP@HORIZONTAL")<br class="gmail_msg"> DW_AT_type [DW_FORM_ref_addr] (<span style="color:rgb(204,0,0)" class="gmail_msg"><b class="gmail_msg">0x0000000000000296</b></span>)<br class="gmail_msg"> DW_AT_external [DW_FORM_flag_present] (true)<br class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">There are lots of subprogram records like this.<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Any ideas what may be done to fix that?<br class="gmail_msg"><br class="gmail_msg">My debugger config:<br class="gmail_msg"><div class="gmail_msg">GNU gdb (GDB) 7.10.1<br class="gmail_msg">This GDB was configured as "i686-w64-mingw32".<br class="gmail_msg"></div>OS : Win7 64-bit<br class="gmail_msg"><br class="gmail_msg">--<br class="gmail_msg"></div><div class="gmail_msg">Best regards,<br class="gmail_msg"></div><div class="gmail_msg">Alexey Zasenko<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div></div></div>
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div></div></div>