diff options
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 2 | ||||
| -rw-r--r-- | lld/test/ELF/linkerscript/linkerscript-locationcounter.s | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 0ea99200464..c7219f6335e 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -813,7 +813,7 @@ Expr ScriptParser::readPrimary() { expect(")"); return [=](uint64_t Dot) -> uint64_t { uint64_t Val = E(Dot); - return alignTo(Dot, Val) + (Dot & (Val - 1)); + return alignTo(Dot, Val); }; } if (Tok == "DATA_SEGMENT_END") { diff --git a/lld/test/ELF/linkerscript/linkerscript-locationcounter.s b/lld/test/ELF/linkerscript/linkerscript-locationcounter.s index 93f7778db69..ac31ca48412 100644 --- a/lld/test/ELF/linkerscript/linkerscript-locationcounter.s +++ b/lld/test/ELF/linkerscript/linkerscript-locationcounter.s @@ -288,7 +288,7 @@ # CHECK-NEXT: Flags [ # CHECK-NEXT: SHF_ALLOC # CHECK-NEXT: ] -# CHECK-NEXT: Address: 0x26008 +# CHECK-NEXT: Address: 0x26000 # CHECK-NEXT: Offset: # CHECK-NEXT: Size: # CHECK-NEXT: Link: |

