[ELF] Add -nopie alias for -no-pie (PR36423)
authorHans Wennborg <hans@hanshq.net>
Wed, 21 Feb 2018 13:54:26 +0000 (13:54 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 21 Feb 2018 13:54:26 +0000 (13:54 +0000)
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.

llvm-svn: 325679

lld/ELF/Options.td
lld/test/ELF/pie.s

index b849a2f..0e64cab 100644 (file)
@@ -358,6 +358,7 @@ 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_no_pie_pic_executable: F<"no-pic-executable">, Alias<no_pie>;
+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>;
index ccab162..1bccb24 100644 (file)
 
 # 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
 # RUN: ld.lld -no-pic-executable %t1.o -o %t2
 # RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE
 # NOPIE-NOT: Type: SharedObject