This is an archive of the discontinued LLVM Phabricator instance.

Correct ALIGN expression when inside a section.
ClosedPublic

Authored by rafael on Sep 11 2017, 4:15 PM.

Details

Reviewers
ruiu
Summary

When given

foobar = ALIGN(., 0x100);

my expectation from what the manual says is that the final address of foobar will be aligned. It seems that bfd aligns the offset in the section, which causes some odd results if the section is not 0x100 aligned. Gold algins the address.

This changes lld to align the final address.

Diff Detail

Event Timeline

rafael created this revision.Sep 11 2017, 4:15 PM
ruiu accepted this revision.Sep 11 2017, 4:18 PM

LGTM

This revision is now accepted and ready to land.Sep 11 2017, 4:18 PM
espindola closed this revision.Mar 14 2018, 3:37 PM
espindola added a subscriber: espindola.

312979