<div dir="ltr">Cool! Thanks Davide. :)<div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 23, 2016 at 6:36 PM, Davide Italiano via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davide<br>
Date: Sat Apr 23 20:36:37 2016<br>
New Revision: 267309<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=267309&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=267309&view=rev</a><br>
Log:<br>
[RuntimeDyldELF] Handle GOTPCRELX/REX_GOTPCRELX.<br>
<br>
Added:<br>
    llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s<br>
Modified:<br>
    llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp<br>
<br>
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=267309&r1=267308&r2=267309&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=267309&r1=267308&r2=267309&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)<br>
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Sat Apr 23 20:36:37 2016<br>
@@ -1708,7 +1708,9 @@ relocation_iterator RuntimeDyldELF::proc<br>
                   Value.Offset);<br>
         addRelocationForSection(RE, Value.SectionID);<br>
       }<br>
-    } else if (RelType == ELF::R_X86_64_GOTPCREL) {<br>
+    } else if (RelType == ELF::R_X86_64_GOTPCREL ||<br>
+               RelType == ELF::R_X86_64_GOTPCRELX ||<br>
+               RelType == ELF::R_X86_64_REX_GOTPCRELX) {<br>
       uint64_t GOTOffset = allocateGOTEntries(SectionID, 1);<br>
       resolveGOTOffsetRelocation(SectionID, Offset, GOTOffset + Addend);<br>
<br>
@@ -1869,6 +1871,8 @@ bool RuntimeDyldELF::relocationNeedsStub<br>
<br>
<br>
   case ELF::R_X86_64_GOTPCREL:<br>
+  case ELF::R_X86_64_GOTPCRELX:<br>
+  case ELF::R_X86_64_REX_GOTPCRELX:<br>
   case ELF::R_X86_64_PC32:<br>
   case ELF::R_X86_64_PC64:<br>
   case ELF::R_X86_64_64:<br>
<br>
Added: llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s?rev=267309&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s?rev=267309&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s (added)<br>
+++ llvm/trunk/test/ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s Sat Apr 23 20:36:37 2016<br>
@@ -0,0 +1,8 @@<br>
+# RUN: llvm-mc -triple=x86_64-pc-linux -relocation-model=pic -filetype=obj -o %T/file.o %p/Inputs/ELF_STT_FILE_GLOBAL.s<br>
+# RUN: llvm-mc -triple=x86_64-pc-linux -relax-relocations -relocation-model=pic -filetype=obj -o %T/relaxed.o %s<br>
+# RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %T/file.o %T/relaxed.o<br>
+<br>
+# Test that RTDyldELF does not crash with 'unimplemented relocation'<br>
+<br>
+_main:<br>
+    movq    foo.c@GOTPCREL(%rip), %rax<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>