[ELF2] Implement -T/--script.
This one tests more carefully SEARCH_DIR() as an added bonus.
Differential Revision:	http://reviews.llvm.org/D13626
llvm-svn: 249969
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 09924ff..8566deb 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -178,6 +178,7 @@
       addFile(searchLibrary(Arg->getValue()));
       break;
     case OPT_INPUT:
+    case OPT_script:
       addFile(Arg->getValue());
       break;
     case OPT_Bstatic:
diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index 2a0eb0b..82e5922 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -67,6 +67,8 @@
 def rpath : Separate<["-"], "rpath">,
   HelpText<"Add a DT_RUNPATH to the output">;
 
+def script : Separate<["--"], "script">, HelpText<"Read linker script">;
+
 def shared : Flag<["-"], "shared">,
   HelpText<"Build a shared object">;
 
@@ -104,6 +106,7 @@
 def alias_rpath_rpath : Joined<["-"], "rpath=">, Alias<rpath>;
 def alias_soname_h : Separate<["-"], "h">, Alias<soname>;
 def alias_soname_soname : Separate<["-"], "soname">, Alias<soname>;
+def alias_script_T : Separate<["-"], "T">, Alias<script>;
 def alias_undefined_u : Separate<["-"], "u">, Alias<undefined>;
 
 // Options listed below are silently ignored now.