[PATCH] D28612: [ELF] - Added support for --emit-relocs.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 12:59:51 PST 2017


ruiu added a comment.

Did you verify that this output is the same as ld.bfd's output?



================
Comment at: ELF/Driver.cpp:166-169
+    if (Config->EmitRelocs) {
+      error("--emit-reloc does not allow link against dynamic object " + Path);
+      return;
+    }
----------------
Why do you need this restriction?


================
Comment at: ELF/Driver.cpp:227-229
+
+  if (Config->EmitRelocs && Config->Pic)
+    error("-pie/-shared and --emit-relocs may not be used together");
----------------
Why?


================
Comment at: ELF/InputFiles.cpp:403-404
+
+    return Config->EmitRelocs ? make<InputSection<ELFT>>(this, &Sec, Name)
+                              : nullptr;
   }
----------------
Use `if` instead of ?:.


https://reviews.llvm.org/D28612





More information about the llvm-commits mailing list