commit | dffc1410c55f62efbff8f14f8a761a3c3371b6f2 | [log] [tgz] |
---|---|---|
author | George Rimar <grimar@accesssoftek.com> | Fri Apr 22 11:40:53 2016 +0000 |
committer | George Rimar <grimar@accesssoftek.com> | Fri Apr 22 11:40:53 2016 +0000 |
tree | 9b8b7740a76ae5da11491b8c036bb5e53ef6714f | |
parent | b1bfd5039eeadefd3ad071ca46729d5d996586eb [diff] [blame] |
[ELF] - Implemented linkerscript ALIGN command ALIGN(exp) Return the location counter (.) aligned to the next exp boundary. (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/expressions.html) Patch implements this command. This fixes PR27406. Differential revision: http://reviews.llvm.org/D19364 llvm-svn: 267145
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 77ba023..1cfe358 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp
@@ -94,6 +94,14 @@ return 0; return V; } + if (Tok == "ALIGN") { + if (!expect(Tokens, "(")) + return 0; + uint64_t V = parseExpr(Tokens); + if (!expect(Tokens, ")")) + return 0; + return alignTo(Dot, V); + } return getInteger(Tok); }