Skip to content

Commit

Permalink
Fix typo: --nopie -> --no-pie.
Browse files Browse the repository at this point in the history
--nopie was a typo. GNU gold doesn't recognize it. It is also
inconsistent with other options that have --foo and --no-foo.

Differential Revision: https://reviews.llvm.org/D42825

llvm-svn: 324043
  • Loading branch information
rui314 committed Feb 2, 2018
1 parent 279c850 commit 5d87b69
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lld/ELF/Driver.cpp
Expand Up @@ -646,7 +646,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
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 =
Expand Down
4 changes: 2 additions & 2 deletions lld/ELF/Options.td
Expand Up @@ -205,6 +205,8 @@ def no_gnu_unique: F<"no-gnu-unique">,
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">;

Expand All @@ -214,8 +216,6 @@ def no_whole_archive: F<"no-whole-archive">,
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">;

Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/pie.s
Expand Up @@ -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

Expand Down

0 comments on commit 5d87b69

Please sign in to comment.