[lld] r221860 - [ELF] Fix conditions for max-page-size.

Shankar Easwaran shankare at codeaurora.org
Wed Nov 12 20:03:46 PST 2014


Author: shankare
Date: Wed Nov 12 22:03:46 2014
New Revision: 221860

URL: http://llvm.org/viewvc/llvm-project?rev=221860&view=rev
Log:
[ELF] Fix conditions for max-page-size.

Fix comments from Rui, also adds a test.

Modified:
    lld/trunk/lib/Driver/GnuLdDriver.cpp
    lld/trunk/test/elf/X86_64/maxpagesize.test

Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=221860&r1=221859&r2=221860&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Wed Nov 12 22:03:46 2014
@@ -495,7 +495,7 @@ bool GnuLdDriver::parse(int argc, const
         // modulo of the default page size.
         if ((!parseZOption(extOpt, maxPageSize)) ||
             (maxPageSize < ctx->getPageSize()) ||
-            (!maxPageSize % ctx->getPageSize())) {
+            (maxPageSize % ctx->getPageSize())) {
           diagnostics << "invalid option: " << extOpt << "\n";
           return false;
         }

Modified: lld/trunk/test/elf/X86_64/maxpagesize.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/X86_64/maxpagesize.test?rev=221860&r1=221859&r2=221860&view=diff
==============================================================================
--- lld/trunk/test/elf/X86_64/maxpagesize.test (original)
+++ lld/trunk/test/elf/X86_64/maxpagesize.test Wed Nov 12 22:03:46 2014
@@ -8,6 +8,8 @@
 # RUN: --no-align-segments --noinhibit-exec -z max-page-size=0
 # RUN: not lld -flavor gnu -target x86_64 %t.o -o %t.exe -static \
 # RUN: --no-align-segments --noinhibit-exec -z max-page-size=0xFF
+# RUN: not lld -flavor gnu -target x86_64 %t.o -o %t.exe -static \
+# RUN: --no-align-segments --noinhibit-exec -z max-page-size=0x1010
 # RUN: lld -flavor gnu -target x86_64 %t.o -o %t1.exe -static \
 # RUN: --no-align-segments --noinhibit-exec -z max-page-size=0x100000
 # RUN: lld -flavor gnu -target x86_64 %t.o -o %t.exe -static \





More information about the llvm-commits mailing list