This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Handle output section alignment in linker scripts
ClosedPublic

Authored by phosek on Feb 7 2017, 2:54 PM.

Details

Summary

LLD already parses ALIGN expression to specify alignment for output sections in linker scripts but it never applied the alignment to the output section.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Feb 7 2017, 2:54 PM
ruiu added inline comments.Feb 7 2017, 3:01 PM
ELF/LinkerScript.cpp
372 ↗(On Diff #87531)

I don't know if this is the right place to add this code. Have all output sections been created when the control reaches here? I think LinkerScript<ELFT>::assignOffsets is a better place to do this.

phosek updated this revision to Diff 87534.Feb 7 2017, 3:43 PM
phosek added inline comments.
ELF/LinkerScript.cpp
372 ↗(On Diff #87531)

I think they should, but assignOffsets would definitely work.

ruiu accepted this revision.Feb 7 2017, 3:47 PM

LGTM

This revision is now accepted and ready to land.Feb 7 2017, 3:47 PM
This revision was automatically updated to reflect the committed changes.