[lld] r249969 - [ELF2] Implement -T/--script.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 11 10:54:20 PDT 2015


Thanks!
On Oct 10, 2015 11:55 PM, "Davide Italiano via llvm-commits" <
llvm-commits at lists.llvm.org> wrote:

> Author: davide
> Date: Sat Oct 10 22:53:36 2015
> New Revision: 249969
>
> URL: http://llvm.org/viewvc/llvm-project?rev=249969&view=rev
> Log:
> [ELF2] Implement -T/--script.
>
> This one tests more carefully SEARCH_DIR() as an added bonus.
>
> Differential Revision:  http://reviews.llvm.org/D13626
>
> Added:
>     lld/trunk/test/elf2/linkerscript2.s
> Modified:
>     lld/trunk/ELF/Driver.cpp
>     lld/trunk/ELF/Options.td
>
> Modified: lld/trunk/ELF/Driver.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=249969&r1=249968&r2=249969&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Driver.cpp (original)
> +++ lld/trunk/ELF/Driver.cpp Sat Oct 10 22:53:36 2015
> @@ -178,6 +178,7 @@ void LinkerDriver::createFiles(opt::Inpu
>        addFile(searchLibrary(Arg->getValue()));
>        break;
>      case OPT_INPUT:
> +    case OPT_script:
>        addFile(Arg->getValue());
>        break;
>      case OPT_Bstatic:
>
> Modified: lld/trunk/ELF/Options.td
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=249969&r1=249968&r2=249969&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Options.td (original)
> +++ lld/trunk/ELF/Options.td Sat Oct 10 22:53:36 2015
> @@ -67,6 +67,8 @@ def o : Separate<["-"], "o">, MetaVarNam
>  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_o_output : Joined<["--"], "out
>  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.
>
> Added: lld/trunk/test/elf2/linkerscript2.s
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/linkerscript2.s?rev=249969&view=auto
>
> ==============================================================================
> --- lld/trunk/test/elf2/linkerscript2.s (added)
> +++ lld/trunk/test/elf2/linkerscript2.s Sat Oct 10 22:53:36 2015
> @@ -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:
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151011/e4a446f3/attachment.html>


More information about the llvm-commits mailing list