diff options
author | Hans Wennborg <hans@hanshq.net> | 2018-02-21 13:58:32 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2018-02-21 13:58:32 +0000 |
commit | fe61605fe3c83f0c8522c6516bc69c10face8420 (patch) | |
tree | 10bc22b4b88f9a17e71c4c3c1b7ec9b6257211ae | |
parent | be97c91aca6c88132fcdc0a87002898d8cfe78ed (diff) |
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
-rw-r--r-- | ELF/Options.td | 1 | ||||
-rw-r--r-- | test/ELF/pie.s | 4 |
2 files changed, 4 insertions, 1 deletions
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<filter>; def alias_format_b: S<"b">, Alias<format>; def alias_library: JoinedOrSeparate<["-"], "l">, Alias<library>; def alias_library_path: JoinedOrSeparate<["-"], "L">, Alias<library_path>; +def alias_nopie: F<"nopie">, Alias<no_pie>; def alias_omagic: Flag<["-"], "N">, Alias<omagic>; def alias_o_output: Joined<["--"], "output=">, Alias<o>; def alias_o_output2 : Separate<["--"], "output">, Alias<o>; 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 |