This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Linkerscript: simplify DATA_SEGMENT_ALIGN evaluation
ClosedPublic

Authored by grimar on Jul 26 2016, 7:00 AM.

Details

Summary

As was suggested by Rafael, we can simplify the evaluation of DATA_SEGMENT_ALIGN
just to simple align. That way it will work exactly like we have in non-script case.

This is not really neccessary to support DATA_SEGMENT_RELRO_END, but
since them are relative, I think it is a good start point.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 65509.Jul 26 2016, 7:00 AM
grimar retitled this revision from to [ELF] Linkerscript: simplify DATA_SEGMENT_ALIGN evaluation.
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar updated this object.
grimar added subscribers: llvm-commits, grimar, davide, evgeny777.
rafael accepted this revision.Jul 26 2016, 7:04 AM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 26 2016, 7:04 AM
This revision was automatically updated to reflect the committed changes.
ruiu added inline comments.Jul 26 2016, 10:00 AM
lld/trunk/ELF/LinkerScript.cpp
815–816

Please merge the two lines -- return alignTo(Dot, E(Dot));

ruiu added inline comments.Jul 26 2016, 10:26 AM
lld/trunk/ELF/LinkerScript.cpp
814–816

So actually this can be return [=](uint64_t Dot) { return alignTo(Dot, E(Dot)); }.

grimar added inline comments.Jul 26 2016, 10:27 AM
lld/trunk/ELF/LinkerScript.cpp
814–816

r276768