This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] Move fixSectionAlignments() before first call to assignAddresses()
ClosedPublic

Authored by peter.smith on Aug 15 2017, 7:49 AM.

Details

Summary

The fixSectionAlignments() function may alter the alignment of some OutputSections, this is likely to alter the addresses calculated earlier in assignAddresses(). By moving the call to fixSectionAlignments() we make sure that assignAddresses() is consistent with the early calculation used for RangeThunks and the final call just before writing the image.

This difference in address between the first call the assignAddresses() and the second may, with some linker scripts, cause some range-thunk calculations to go wrong, however for the majority of links it won't affect the relative offsets between callers and callees.

It is more important for a fix for pr33463 https://bugs.llvm.org/show_bug.cgi?id=33463 as the sequence of instructions that trigger the cortex-a53 errata are sensitive to address modulo 0x1000.

Diff Detail

Repository
rL LLVM

Event Timeline

peter.smith created this revision.Aug 15 2017, 7:49 AM

General ping for the -fix-cortex-a53-843419 patch set. Collectively these fix pr33463 which would be necessary to fix to allow lld to be used to build Android on AArch64.

General ping for the -fix-cortex-a53-843419 patch set. Collectively these fix pr33463 which would be necessary to fix in order for lld to be used to build Android on AArch64.

ruiu accepted this revision.Sep 5 2017, 5:46 PM

LGTM

This revision is now accepted and ready to land.Sep 5 2017, 5:46 PM
This revision was automatically updated to reflect the committed changes.