[ELF] Linkerscript: simplify DATA_SEGMENT_ALIGN evaluation

We can simplify the evaluation of DATA_SEGMENT_ALIGN
just to simple align(). That way it will work exactly like we have in non-script case.

Change was suggested by Rafael Ávila de Espíndola

Differential revision: https://reviews.llvm.org/D22807

llvm-svn: 276745
This commit is contained in:
George Rimar 2016-07-26 14:00:10 +00:00
parent 6151699b08
commit 528e0bfa12
2 changed files with 2 additions and 2 deletions

View File

@ -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") {

View File

@ -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: