<div dir="ltr">Hey Chris,<br><br>Would your new ObjectYAML improvements be suitable for testing this? Could you help me have a go at porting the test case to use it instead of the object file I just checked in?<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 16, 2016 at 8:41 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 10:31:10 2016<br class="gmail_msg">
New Revision: 289954<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=289954&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=289954&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
dwarfdump: Support/process relocations on a CU's abbrev_off<br class="gmail_msg">
<br class="gmail_msg">
Input can be produced by ld -r, for example (a normal LLVM workflow<br class="gmail_msg">
never hits this - LLVM only ever produces a single abbrev table in an<br class="gmail_msg">
object (shared by multiple CUs), so the reloc's always 0, and when it's<br class="gmail_msg">
linked together the relocation's resolved so it doesn't need to be<br class="gmail_msg">
handled)<br class="gmail_msg">
<br class="gmail_msg">
Added:<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=289954&r1=289953&r2=289954&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=289954&r1=289953&r2=289954&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 10:31:10 2016<br class="gmail_msg">
@@ -87,7 +87,10 @@ 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">
Added: 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=289954&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=289954&view=auto</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
Binary files llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64 (added) and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64 Fri Dec 16 10:31:10 2016 differ<br class="gmail_msg">
<br class="gmail_msg">
Added: 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=289954&view=auto" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test?rev=289954&view=auto</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test (added)<br class="gmail_msg">
+++ llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test Fri Dec 16 10:31:10 2016<br class="gmail_msg">
@@ -0,0 +1,8 @@<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>