Skip to content

Commit f0884e4

Browse files
committed
Add --dynamic-linker=foo as an alias for --dynamic-linker foo.
This patch fixes a minor compatibility issue with ld.gold and ld.bfd. llvm-svn: 326243
1 parent 3f4c673 commit f0884e4

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

lld/ELF/Options.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ def alias_define_common_dc: F<"dc">, Alias<define_common>;
350350
def alias_define_common_dp: F<"dp">, Alias<define_common>;
351351
def alias_discard_all_x: Flag<["-"], "x">, Alias<discard_all>;
352352
def alias_discard_locals_X: Flag<["-"], "X">, Alias<discard_locals>;
353+
def alias_dynamic_linker_eq: J<"dynamic-linker=">, Alias<dynamic_linker>;
353354
def alias_emit_relocs: Flag<["-"], "q">, Alias<emit_relocs>;
354355
def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
355356
def alias_export_dynamic_E: Flag<["-"], "E">, Alias<export_dynamic>;

lld/test/ELF/dynamic-linker.s

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# REQUIRES: x86
2+
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/shared.s -o %t1.o
3+
# RUN: ld.lld -shared %t1.o -o %t.so
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
5+
6+
# RUN: ld.lld --dynamic-linker foo %t.o %t.so -o %t
7+
# RUN: llvm-readelf -program-headers %t | FileCheck %s
8+
9+
# RUN: ld.lld --dynamic-linker=foo %t.o %t.so -o %t
10+
# RUN: llvm-readelf -program-headers %t | FileCheck %s
11+
12+
# CHECK: [Requesting program interpreter: foo]
13+
14+
# RUN: ld.lld %t.o %t.so -o %t
15+
# RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s
16+
17+
# RUN: ld.lld --dynamic-linker foo --no-dynamic-linker %t.o %t.so -o %t
18+
# RUN: llvm-readelf -program-headers %t | FileCheck --check-prefix=NO %s
19+
20+
# NO-NOT: PT_INTERP
21+
22+
.globl _start
23+
_start:
24+
nop

lld/test/ELF/no-dynamic-linker.s

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)