[PATCH] D19844: ELF: Forbid all relative relocations to absolute symbols in PIC, except for weak undefined.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 18:15:09 PDT 2016


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM with nits.


================
Comment at: ELF/Writer.cpp:465
@@ +464,3 @@
+      return true;
+    else {
+      StringRef S = getELFRelocationTypeName(Config->EMachine, Type);
----------------
Remove else after return.

================
Comment at: ELF/Writer.cpp:467-468
@@ +466,4 @@
+      StringRef S = getELFRelocationTypeName(Config->EMachine, Type);
+      error("relocation " + S + " cannot refer to absolute symbol " +
+            Body.getName());
+    }
----------------
You want to return false (or true, as it is just a dummy value) after error() because error is not a noreturn function.


http://reviews.llvm.org/D19844





More information about the llvm-commits mailing list