[lld] r326243 - Add `--dynamic-linker=foo` as an alias for `--dynamic-linker foo`.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 12:37:18 PST 2018


Author: ruiu
Date: Tue Feb 27 12:37:18 2018
New Revision: 326243

URL: http://llvm.org/viewvc/llvm-project?rev=326243&view=rev
Log:
Add `--dynamic-linker=foo` as an alias for `--dynamic-linker foo`.

This patch fixes a minor compatibility issue with ld.gold and ld.bfd.

Added:
    lld/trunk/test/ELF/dynamic-linker.s
Removed:
    lld/trunk/test/ELF/no-dynamic-linker.s
Modified:
    lld/trunk/ELF/Options.td

Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=326243&r1=326242&r2=326243&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Tue Feb 27 12:37:18 2018
@@ -350,6 +350,7 @@ def alias_define_common_dc: F<"dc">, Ali
 def alias_define_common_dp: F<"dp">, Alias<define_common>;
 def alias_discard_all_x: Flag<["-"], "x">, Alias<discard_all>;
 def alias_discard_locals_X: Flag<["-"], "X">, Alias<discard_locals>;
+def alias_dynamic_linker_eq: J<"dynamic-linker=">, Alias<dynamic_linker>;
 def alias_emit_relocs: Flag<["-"], "q">, Alias<emit_relocs>;
 def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
 def alias_export_dynamic_E: Flag<["-"], "E">, Alias<export_dynamic>;

Added: lld/trunk/test/ELF/dynamic-linker.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/dynamic-linker.s?rev=326243&view=auto
==============================================================================
--- lld/trunk/test/ELF/dynamic-linker.s (added)
+++ lld/trunk/test/ELF/dynamic-linker.s Tue Feb 27 12:37:18 2018
@@ -0,0 +1,24 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/shared.s -o %t1.o
+# RUN: ld.lld -shared %t1.o -o %t.so
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+
+# RUN: ld.lld --dynamic-linker foo %t.o %t.so -o %t
+# RUN: llvm-readelf -program-headers %t | FileCheck %s
+
+# RUN: ld.lld --dynamic-linker=foo %t.o %t.so -o %t
+# RUN: llvm-readelf -program-headers %t | FileCheck %s
+
+# CHECK: [Requesting program interpreter: foo]
+
+# RUN: ld.lld %t.o %t.so -o %t
+# RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s
+
+# RUN: ld.lld --dynamic-linker foo --no-dynamic-linker %t.o %t.so -o %t
+# RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s
+
+# NO-NOT: PT_INTERP
+
+.globl _start
+_start:
+  nop

Removed: lld/trunk/test/ELF/no-dynamic-linker.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/no-dynamic-linker.s?rev=326242&view=auto
==============================================================================
--- lld/trunk/test/ELF/no-dynamic-linker.s (original)
+++ lld/trunk/test/ELF/no-dynamic-linker.s (removed)
@@ -1,12 +0,0 @@
-# REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/shared.s -o %tso.o
-# RUN: ld.lld -shared %tso.o -o %t.so
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-
-# RUN: ld.lld -dynamic-linker foo --no-dynamic-linker %t.o %t.so -o %t
-# RUN: llvm-readobj --program-headers %t | FileCheck %s --check-prefix=NODL
-# NODL-NOT: PT_INTERP
-
-# RUN: ld.lld --no-dynamic-linker -dynamic-linker foo %t.o %t.so -o %t
-# RUN: llvm-readobj --program-headers %t | FileCheck %s --check-prefix=WITHDL
-# WITHDL: PT_INTERP




More information about the llvm-commits mailing list