<div dir="ltr">Hi George,<br><br>Committing this change broke your gdb-index test in lld.<br><br>It looks like the info section had a non-zero offset in the relocation pointing to the abbrev section, but the abbrev section in the object has the data at start (& dumping the raw object file from disk shows the relocation has a zero offset)<br><br>Is this data somehow modified by lld rather than being the raw bytes from the input file? How/why/where?<br><br>Any idea how to fix this change/lld so it doesn't have this problem?<br><br>As it is, dwarfdump is crashing on inputs I care about & this change seems like a reasonable fix for it, so I'm guessing we probably want to fix lld in some way?<br><br>- Dave<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 16, 2016 at 9:20 AM David Blaikie via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@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">Author: dblaikie<br class="gmail_msg">
Date: Fri Dec 16 11:10:17 2016<br class="gmail_msg">
New Revision: 289961<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=289961&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=289961&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
Revert "dwarfdump: Support/process relocations on a CU's abbrev_off"<br class="gmail_msg">
<br class="gmail_msg">
Reverting because this breaks lld's gdb_index support - it's probably<br class="gmail_msg">
double counting the abbrev relocation offset.<br class="gmail_msg">
<br class="gmail_msg">
This reverts commit r289954.<br class="gmail_msg">
<br class="gmail_msg">
Removed:<br class="gmail_msg">
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64<br class="gmail_msg">
    llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test<br class="gmail_msg">
Modified:<br class="gmail_msg">
    llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=289961&r1=289960&r2=289961&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=289961&r1=289960&r2=289961&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp (original)<br class="gmail_msg">
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp Fri Dec 16 11:10:17 2016<br class="gmail_msg">
@@ -87,10 +87,7 @@ bool DWARFUnit::getStringOffsetSectionIt<br class="gmail_msg">
 bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) {<br class="gmail_msg">
   Length = debug_info.getU32(offset_ptr);<br class="gmail_msg">
   Version = debug_info.getU16(offset_ptr);<br class="gmail_msg">
-  auto AI = InfoSection.Relocs.find(*offset_ptr);<br class="gmail_msg">
   uint64_t AbbrOffset = debug_info.getU32(offset_ptr);<br class="gmail_msg">
-  if (AI != InfoSection.Relocs.end())<br class="gmail_msg">
-    AbbrOffset += AI->second.second;<br class="gmail_msg">
   if (IndexEntry) {<br class="gmail_msg">
     if (AbbrOffset)<br class="gmail_msg">
       return false;<br class="gmail_msg">
<br class="gmail_msg">
Removed: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64?rev=289960&view=auto" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64?rev=289960&view=auto</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
Binary files llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64 (original) and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64 (removed) differ<br class="gmail_msg">
<br class="gmail_msg">
Removed: llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test?rev=289960&view=auto" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test?rev=289960&view=auto</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test (original)<br class="gmail_msg">
+++ llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test (removed)<br class="gmail_msg">
@@ -1,8 +0,0 @@<br class="gmail_msg">
-RUN: llvm-dwarfdump -debug-dump=info %p/Inputs/dwarfdump-abbrev-off.elf-x86-64 | FileCheck %s<br class="gmail_msg">
-<br class="gmail_msg">
-Check that we apply relocations to the abbr_offset - while LLVM never produces<br class="gmail_msg">
-an object file like this, a reproduction can be produced by linking two simple<br class="gmail_msg">
-object files together with ld -r.<br class="gmail_msg">
-<br class="gmail_msg">
-CHECK: abbr_offset = 0x0000<br class="gmail_msg">
-CHECK: abbr_offset = 0x0010<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div></div>