<div dir="ltr">In this case you could use a .ll file to do this and just have it generated rather than an object file that you check. Just compile a basic object file with a function or two and it'll get you what you need. For the aarch64 bits go ahead and make a directory parallel to the X86 directory for this specific thing.<div>
<br></div><div>Thanks!</div><div><br></div><div style>-eric</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 11, 2013 at 3:16 AM, Tim Northover <span dir="ltr"><<a href="mailto:Tim.Northover@arm.com" target="_blank">Tim.Northover@arm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: tnorthover<br>
Date: Mon Feb 11 05:16:02 2013<br>
New Revision: 174874<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=174874&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=174874&view=rev</a><br>
Log:<br>
AArch64: Add basic relocation processing for llvm-dwarfdump.<br>
<br>
This allows llvm-dwarfdump to handle the relocations needed, at least<br>
for LLVM-produced code.<br>
<br>
Added:<br>
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-aarch64   (with props)<br>
    llvm/trunk/test/DebugInfo/dwarfdump-aarch64.test   (with props)<br>
Modified:<br>
    llvm/trunk/include/llvm/Object/RelocVisitor.h<br>
<br>
Modified: llvm/trunk/include/llvm/Object/RelocVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/RelocVisitor.h?rev=174874&r1=174873&r2=174874&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/RelocVisitor.h?rev=174874&r1=174873&r2=174874&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/include/llvm/Object/RelocVisitor.h (original)<br>
+++ llvm/trunk/include/llvm/Object/RelocVisitor.h Mon Feb 11 05:16:02 2013<br>
@@ -92,6 +92,16 @@ public:<br>
         HasError = true;<br>
         return RelocToApply();<br>
       }<br>
+    } else if (FileFormat == "ELF64-aarch64") {<br>
+      switch (RelocType) {<br>
+      case llvm::ELF::R_AARCH64_ABS32:<br>
+        return visitELF_AARCH64_ABS32(R, Value);<br>
+      case llvm::ELF::R_AARCH64_ABS64:<br>
+        return visitELF_AARCH64_ABS64(R, Value);<br>
+      default:<br>
+        HasError = true;<br>
+        return RelocToApply();<br>
+      }<br>
     }<br>
     HasError = true;<br>
     return RelocToApply();<br>
@@ -172,6 +182,26 @@ private:<br>
     uint32_t Res = (Value + Addend) & 0xFFFFFFFF;<br>
     return RelocToApply(Res, 4);<br>
   }<br>
+<br>
+  // AArch64 ELF<br>
+  RelocToApply visitELF_AARCH64_ABS32(RelocationRef R, uint64_t Value) {<br>
+    int64_t Addend;<br>
+    R.getAdditionalInfo(Addend);<br>
+    int64_t Res =  Value + Addend;<br>
+<br>
+    // Overflow check allows for both signed and unsigned interpretation.<br>
+    if (Res < INT32_MIN || Res > UINT32_MAX)<br>
+      HasError = true;<br>
+<br>
+    return RelocToApply(static_cast<uint32_t>(Res), 4);<br>
+  }<br>
+<br>
+  RelocToApply visitELF_AARCH64_ABS64(RelocationRef R, uint64_t Value) {<br>
+    int64_t Addend;<br>
+    R.getAdditionalInfo(Addend);<br>
+    return RelocToApply(Value + Addend, 8);<br>
+  }<br>
+<br>
 };<br>
<br>
 }<br>
<br>
Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-aarch64<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-aarch64?rev=174874&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-aarch64?rev=174874&view=auto</a><br>

==============================================================================<br>
Binary files llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-aarch64 (added) and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-aarch64 Mon Feb 11 05:16:02 2013 differ<br>
<br>
Propchange: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-aarch64<br>
------------------------------------------------------------------------------<br>
    svn:eol-style = native<br>
<br>
Added: llvm/trunk/test/DebugInfo/dwarfdump-aarch64.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-aarch64.test?rev=174874&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-aarch64.test?rev=174874&view=auto</a><br>

==============================================================================<br>
--- llvm/trunk/test/DebugInfo/dwarfdump-aarch64.test (added)<br>
+++ llvm/trunk/test/DebugInfo/dwarfdump-aarch64.test Mon Feb 11 05:16:02 2013<br>
@@ -0,0 +1,16 @@<br>
+RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-aarch64  \<br>
+RUN:     | FileCheck %s<br>
+<br>
+We're mostly checking that relocations are applied correctly<br>
+here. Currently R_AARCH64_ABS32 is used for references to debug data<br>
+and R_AARCH64_ABS64 is used for program addresses.<br>
+<br>
+A couple of ABS32s, both at 0 and elsewhere, interpreted correctly:<br>
+<br>
+CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 3.3 ")<br>
+CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000013] = "tmp.c")<br>
+<br>
+A couple of ABS64s similarly:<br>
+<br>
+CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)<br>
+CHECK: DW_AT_high_pc [DW_FORM_addr] (0x000000000000005c)<br>
<br>
Propchange: llvm/trunk/test/DebugInfo/dwarfdump-aarch64.test<br>
------------------------------------------------------------------------------<br>
    svn:eol-style = native<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>