[lld] r285621 - Simple numeric constants are absolute.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 11:56:02 PDT 2016
Author: rafael
Date: Mon Oct 31 13:56:02 2016
New Revision: 285621
URL: http://llvm.org/viewvc/llvm-project?rev=285621&view=rev
Log:
Simple numeric constants are absolute.
Modified:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/test/ELF/linkerscript/absolute-expr.s
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=285621&r1=285620&r2=285621&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Oct 31 13:56:02 2016
@@ -1682,7 +1682,7 @@ Expr ScriptParser::readPrimary() {
// Tok is a literal number.
uint64_t V;
if (readInteger(Tok, V))
- return [=](uint64_t Dot) { return V; };
+ return {[=](uint64_t Dot) { return V; }, true};
// Tok is a symbol name.
if (Tok != "." && !isValidCIdentifier(Tok))
Modified: lld/trunk/test/ELF/linkerscript/absolute-expr.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/absolute-expr.s?rev=285621&r1=285620&r2=285621&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/absolute-expr.s (original)
+++ lld/trunk/test/ELF/linkerscript/absolute-expr.s Mon Oct 31 13:56:02 2016
@@ -6,6 +6,7 @@
# RUN: bar2 = CONSTANT (MAXPAGESIZE); \
# RUN: bar3 = SIZEOF (.text); \
# RUN: bar4 = SIZEOF_HEADERS; \
+# RUN: bar5 = 0x42; \
# RUN: *(.text) \
# RUN: } \
# RUN: };" > %t.script
@@ -45,6 +46,15 @@
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: None
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: Absolute
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: bar5
+# CHECK-NEXT: Value: 0x42
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type: None
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: Absolute
# CHECK-NEXT: }
More information about the llvm-commits
mailing list