This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Use late evaluation for ALIGN in expression
ClosedPublic

Authored by phosek on May 28 2017, 1:28 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.May 28 2017, 1:28 AM
ruiu accepted this revision.May 28 2017, 1:54 AM

LGTM

ELF/LinkerScript.h
44 ↗(On Diff #100546)

Can you rename this Alignment? (For member variables, I think we use that name.)

Also = 1.

This revision is now accepted and ready to land.May 28 2017, 1:54 AM
phosek updated this revision to Diff 100655.May 29 2017, 8:14 PM
phosek marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.