diff options
| author | Petr Hosek <phosek@chromium.org> | 2017-05-30 03:18:28 +0000 |
|---|---|---|
| committer | Petr Hosek <phosek@chromium.org> | 2017-05-30 03:18:28 +0000 |
| commit | 3c6de1a66caff299f52d393c8eb4d677d2158dc8 (patch) | |
| tree | 6f037359209824c7aaba9c6bdb4a3b2a155225b5 /lld/ELF/LinkerScript.h | |
| parent | 057084180662c897a94563768b374f8b58e71ebf (diff) | |
| download | bcm5719-llvm-3c6de1a66caff299f52d393c8eb4d677d2158dc8.tar.gz bcm5719-llvm-3c6de1a66caff299f52d393c8eb4d677d2158dc8.zip | |
[ELF] Use late evaluation for ALIGN in expression
While the following expression is handled fine:
PROVIDE_HIDDEN(newsym = oldsym + address);
The following expression triggers an error because the expression
is evaluated as absolute:
PROVIDE_HIDDEN(newsym = ALIGN(oldsym, CONSTANT(MAXPAGESIZE)) + address);
To avoid this error, we use late evaluation for ALIGN by making the
alignment an attribute of the expression itself.
Differential Revision: https://reviews.llvm.org/D33629
llvm-svn: 304185
Diffstat (limited to 'lld/ELF/LinkerScript.h')
| -rw-r--r-- | lld/ELF/LinkerScript.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index e56e569d4e7..08f60f4517a 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -41,7 +41,12 @@ struct ExprValue { SectionBase *Sec; uint64_t Val; bool ForceAbsolute; + uint64_t Alignment = 1; + ExprValue(SectionBase *Sec, bool ForceAbsolute, uint64_t Val, + uint64_t Alignment) + : Sec(Sec), Val(Val), ForceAbsolute(ForceAbsolute), Alignment(Alignment) { + } ExprValue(SectionBase *Sec, bool ForceAbsolute, uint64_t Val) : Sec(Sec), Val(Val), ForceAbsolute(ForceAbsolute) {} ExprValue(SectionBase *Sec, uint64_t Val) : ExprValue(Sec, false, Val) {} |

