llvm-project/lld
James Henderson 38e67e8212 [ELF] Emit only one error if -z max-page-size without value
In r305364, Rui changed the mechanism that parses -z option values slightly.
This caused a bug, as demonstrated by this test, which now fails:

---
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t -z max-page-size

.global _start
_start:
  nop
---

Before, the link succeeded and set the max-page-size to the target default.

After we get the following two error messages:
"invalid max-page-size: "
"max-page-size: value isn't a power of 2"

The latter error is because an uninitialised variable ends up being passed back
to getMaxPageSize).

This change ensures we only get the first error.

Reviewers: ruiu

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

llvm-svn: 305679
2017-06-19 11:05:15 +00:00
..
COFF Update documentation to reflection disuse of external cvtres. 2017-06-17 02:26:27 +00:00
ELF [ELF] Emit only one error if -z max-page-size without value 2017-06-19 11:05:15 +00:00
cmake/modules [lld][cmake] Fix BUILD_SHARED_LIBS installation 2017-01-24 10:41:02 +00:00
docs Update documentation to reflection disuse of external cvtres. 2017-06-17 02:26:27 +00:00
include/lld Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
lib Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-10 08:06:17 +00:00
test [ELF] Emit only one error if -z max-page-size without value 2017-06-19 11:05:15 +00:00
tools/lld Accept not only lld-link but also LLD-LINK, for example. 2017-04-12 18:29:52 +00:00
unittests Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format
.gitignore
CMakeLists.txt Dummy commit to trigger CMake reconfiguration and unbreak Sphinx build 2017-05-04 08:32:33 +00:00
CODE_OWNERS.TXT Add initial CODE_OWNERS.TXT file 2015-07-25 00:44:37 +00:00
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:40:59 +00:00
README.md

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.