<div dir="ltr"><a href="http://H.J.Lu">H.J.Lu</a>,<div><br></div><div>This may be a dumb question, but why didn't you define new types of relocations for GOT/GOTX without base registers? Making relocations change their behavior based on instructions where they applied doesn't seem like a cleaner way than defining new relocations.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 5, 2017 at 1:14 PM, Rui Ueyama via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ruiu added inline comments.<br>
<br>
<br>
================<br>
Comment at: ELF/Target.cpp:394<br>
+    // resolves to an offset in GOT table (R_GOT_FROM_END), but when instruction<br>
+    // pointed by relocation has no base register, this relocation can be used<br>
+    // when PIC code is disabled. In that case it resolves to address of entry<br>
----------------<br>
What is "this" in this sentence?<br>
<br>
<br>
================<br>
Comment at: ELF/Target.cpp:406<br>
+      error(toString(S.File) +<br>
+            ": relocation R_386_GOT32/R_386_GOT32X against '" + S.getName() +<br>
+            "' without base register can not be used when PIC enabled");<br>
----------------<br>
You want to use `toString(Type)` instead of R_386_GOT32/R_386_GOT32X.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D30699" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D30699</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>