[PATCH] D13626: [ELF2] Implement -T/--script
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 10 20:55:31 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL249969: [ELF2] Implement -T/--script. (authored by davide).
Changed prior to commit:
http://reviews.llvm.org/D13626?vs=37041&id=37042#toc
Repository:
rL LLVM
http://reviews.llvm.org/D13626
Files:
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/Options.td
lld/trunk/test/elf2/linkerscript2.s
Index: lld/trunk/ELF/Options.td
===================================================================
--- lld/trunk/ELF/Options.td
+++ lld/trunk/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.
Index: lld/trunk/ELF/Driver.cpp
===================================================================
--- lld/trunk/ELF/Driver.cpp
+++ lld/trunk/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:
Index: lld/trunk/test/elf2/linkerscript2.s
===================================================================
--- lld/trunk/test/elf2/linkerscript2.s
+++ lld/trunk/test/elf2/linkerscript2.s
@@ -0,0 +1,10 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd \
+# RUN: %p/Inputs/libsearch-dyn.s -o %tdyn.o
+# RUN: ld.lld2 -shared %tdyn.o -o %T/libls.so
+# RUN: echo "SEARCH_DIR(" %T ")" > %t.script
+# RUN: ld.lld2 -o %t2 --script %t.script -lls %t
+
+.globl _start,_bar
+_start:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13626.37042.patch
Type: text/x-patch
Size: 1738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151011/e9dea929/attachment.bin>
More information about the llvm-commits
mailing list