This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Align the first section of a PT_TLS even if its type is SHT_NOBITS
ClosedPublic

Authored by jrtc27 on Jul 28 2021, 12:38 PM.

Details

Summary

This is somewhat of a repeat of D66658 but for sections in PT_TLS
segments. Although such sections don't need to be aligned such that
address and offset are congruent modulo the page size, they do need
to be congruent modulo the segment alignment, otherwise the
whole PT_TLS will be unaligned. We therefore use the normal calculation
to determine the section's address within the PT_LOAD rather than
bailing out early due to being SHT_NOBITS.

Diff Detail

Event Timeline

jrtc27 created this revision.Jul 28 2021, 12:38 PM
jrtc27 requested review of this revision.Jul 28 2021, 12:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 12:38 PM
MaskRay accepted this revision.Jul 28 2021, 8:36 PM

LGTM.

This revision is now accepted and ready to land.Jul 28 2021, 8:36 PM
This revision was landed with ongoing or failed builds.Jul 29 2021, 7:14 AM
This revision was automatically updated to reflect the committed changes.