[lld] r335713 - Make -z option check more strict.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 27 00:56:24 PDT 2018
Author: ruiu
Date: Wed Jun 27 00:56:23 2018
New Revision: 335713
URL: http://llvm.org/viewvc/llvm-project?rev=335713&view=rev
Log:
Make -z option check more strict.
Removed:
lld/trunk/test/ELF/invalid-z.s
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/driver.test
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=335713&r1=335712&r2=335713&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Jun 27 00:56:23 2018
@@ -327,14 +327,14 @@ static bool getZFlag(opt::InputArgList &
static bool isKnown(StringRef S) {
return S == "combreloc" || S == "copyreloc" || S == "defs" ||
- S == "execstack" || S == "hazardplt" || S == "initfirst" ||
- S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
- S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" ||
- S == "nodlopen" || S == "noexecstack" ||
- S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
- S == "now" || S == "origin" || S == "relro" || S == "retpolineplt" ||
- S == "rodynamic" || S == "text" || S == "wxneeded" ||
- S.startswith("max-page-size") || S.startswith("stack-size");
+ S == "execstack" || S == "hazardplt" || S == "initfirst" ||
+ S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" ||
+ S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" ||
+ S == "nodlopen" || S == "noexecstack" ||
+ S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" ||
+ S == "now" || S == "origin" || S == "relro" || S == "retpolineplt" ||
+ S == "rodynamic" || S == "text" || S == "wxneeded" ||
+ S.startswith("max-page-size=") || S.startswith("stack-size=");
}
// Report an error for an unknown -z option.
Modified: lld/trunk/test/ELF/driver.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/driver.test?rev=335713&r1=335712&r2=335713&view=diff
==============================================================================
--- lld/trunk/test/ELF/driver.test (original)
+++ lld/trunk/test/ELF/driver.test Wed Jun 27 00:56:23 2018
@@ -58,6 +58,9 @@
# RUN: not ld.lld %t -z foo 2>&1 | FileCheck -check-prefix=ERR9 %s
# ERR9: unknown -z value: foo
+# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR10 %s
+# ERR10: unknown -z value: max-page-size
+
.globl _start
_start:
nop
Removed: lld/trunk/test/ELF/invalid-z.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid-z.s?rev=335712&view=auto
==============================================================================
--- lld/trunk/test/ELF/invalid-z.s (original)
+++ lld/trunk/test/ELF/invalid-z.s (removed)
@@ -1,9 +0,0 @@
-# REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-# RUN: not ld.lld %t.o -o %t -z max-page-size 2>&1 | FileCheck %s
-# CHECK: invalid max-page-size
-# CHECK-NOT: error
-
-.global _start
-_start:
- nop
More information about the llvm-commits
mailing list