[PATCH] Implement semantic action for SEARCH_DIR linker script command

Rui Ueyama ruiu at google.com
Thu Jan 29 12:20:49 PST 2015


LGTM.


================
Comment at: include/lld/ReaderWriter/ELFLinkingContext.h:272
@@ +271,3 @@
+  // Retrieve search path list.
+  virtual StringRefVector getSearchPaths() { return _inputSearchPaths; };
+
----------------
Don't make a function virtual if not needed.

================
Comment at: unittests/DriverTests/GnuLdDriverTest.cpp:184
@@ +183,3 @@
+  std::unique_ptr<MemoryBuffer> mb = MemoryBuffer::getMemBuffer(
+    "SEARCH_DIR(\"/usr/lib\")", "foo.so");
+  std::string s;
----------------
I think there's code in the GNU driver to add /usr/lib to the default search path, so this test may pass even if the linker script parser doesn't work. I'd make it something unrealistic, like "/foo/bar", to avoid possible conflict.

http://reviews.llvm.org/D7220

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list