[PATCH] D42825: Fix typo: --nopie -> --no-pie.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 15:44:54 PST 2018


ruiu created this revision.
ruiu added a reviewer: rafael.
Herald added a subscriber: emaste.

--nopie was a typo. GNU gold doesn't recognize it. It is also
inconsistent with other options that have --foo and --no-foo.


https://reviews.llvm.org/D42825

Files:
  lld/ELF/Driver.cpp
  lld/ELF/Options.td
  lld/test/ELF/pie.s


Index: lld/test/ELF/pie.s
===================================================================
--- lld/test/ELF/pie.s
+++ lld/test/ELF/pie.s
@@ -48,7 +48,7 @@
 # CHECK:         Type: PT_DYNAMIC
 
 ## Check -nopie
-# RUN: ld.lld -nopie %t1.o -o %t2
+# RUN: ld.lld -no-pie %t1.o -o %t2
 # RUN: llvm-readobj -file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE
 # NOPIE-NOT: Type: SharedObject
 
Index: lld/ELF/Options.td
===================================================================
--- lld/ELF/Options.td
+++ lld/ELF/Options.td
@@ -205,6 +205,8 @@
 def no_merge_exidx_entries: F<"no-merge-exidx-entries">,
   HelpText<"Disable merging .ARM.exidx entries">;
 
+def no_pie: F<"no-pie">, HelpText<"Do not create a position independent executable">;
+
 def no_threads: F<"no-threads">,
   HelpText<"Do not run the linker multi-threaded">;
 
@@ -214,8 +216,6 @@
 def noinhibit_exec: F<"noinhibit-exec">,
   HelpText<"Retain the executable output file whenever it is still usable">;
 
-def nopie: F<"nopie">, HelpText<"Do not create a position independent executable">;
-
 def no_omagic: Flag<["--"], "no-omagic">, MetaVarName<"<magic>">,
   HelpText<"Do not set the text data sections to be writable">;
 
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -642,7 +642,7 @@
   Config->Optimize = args::getInteger(Args, OPT_O, 1);
   Config->OrphanHandling = getOrphanHandling(Args);
   Config->OutputFile = Args.getLastArgValue(OPT_o);
-  Config->Pie = Args.hasFlag(OPT_pie, OPT_nopie, false);
+  Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
   Config->PrintIcfSections =
       Args.hasFlag(OPT_print_icf_sections, OPT_no_print_icf_sections, false);
   Config->PrintGcSections =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42825.132492.patch
Type: text/x-patch
Size: 1785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180201/6900f252/attachment.bin>


More information about the llvm-commits mailing list