From fe61605fe3c83f0c8522c6516bc69c10face8420 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 21 Feb 2018 13:58:32 +0000 Subject: Merging r325679: ------------------------------------------------------------------------ r325679 | hans | 2018-02-21 14:54:26 +0100 (Wed, 21 Feb 2018) | 9 lines [ELF] Add -nopie alias for -no-pie (PR36423) In r324043, --nopie was renamed to --no-pie to presumably fix a typo. As it turns out, "nopie" wasn't a typo but the spelling used by OpenBSD's binutils ld. Gold on the other hand spells the flag "no-pie". (Vanilla binutils doesn't have a flag like this at all.) Since they do the same thing, let's support both spellings. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/lld/branches/release_60@325680 91177308-0d34-0410-b5e6-96231b3b80d8 --- ELF/Options.td | 1 + test/ELF/pie.s | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ELF/Options.td b/ELF/Options.td index 735046728..2bd6e4460 100644 --- a/ELF/Options.td +++ b/ELF/Options.td @@ -351,6 +351,7 @@ def alias_filter: Separate<["-"], "F">, Alias; def alias_format_b: S<"b">, Alias; def alias_library: JoinedOrSeparate<["-"], "l">, Alias; def alias_library_path: JoinedOrSeparate<["-"], "L">, Alias; +def alias_nopie: F<"nopie">, Alias; def alias_omagic: Flag<["-"], "N">, Alias; def alias_o_output: Joined<["--"], "output=">, Alias; def alias_o_output2 : Separate<["--"], "output">, Alias; diff --git a/test/ELF/pie.s b/test/ELF/pie.s index 3efd6e337..f5e6150be 100644 --- a/test/ELF/pie.s +++ b/test/ELF/pie.s @@ -47,9 +47,11 @@ # CHECK: Type: PT_DYNAMIC -## Check -nopie +## Check -no-pie # RUN: ld.lld -no-pie %t1.o -o %t2 # RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE +# RUN: ld.lld -nopie %t1.o -o %t2 +# RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE # NOPIE-NOT: Type: SharedObject .globl _start -- cgit v1.2.3