This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Fix alignment of TLV data sections
ClosedPublic

Authored by glandium on Dec 23 2021, 11:59 PM.

Details

Reviewers
int3
Group Reviewers
Restricted Project
Commits
rG319181f76718: [lld-macho] Fix alignment of TLV data sections

Diff Detail

Event Timeline

glandium created this revision.Dec 23 2021, 11:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2021, 11:59 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
glandium requested review of this revision.Dec 23 2021, 11:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2021, 11:59 PM
glandium updated this revision to Diff 396138.Dec 24 2021, 12:03 AM

Applied clang-format.

glandium added inline comments.Dec 24 2021, 12:06 AM
lld/test/MachO/tlv.s
129–132

Note that this doesn't cause a problem at an alignment of 16 unless __thread_vars has an odd number of entries, which makes (otherwise __thread_data is accidentally aligned to 16)

int3 accepted this revision.Dec 25 2021, 2:22 AM
int3 added a subscriber: int3.

Can you include a description of the problem in the commit message? (Just copying the block comment is fine)

lld/MachO/Writer.cpp
916
918
919
919–923

convention is to omit braces for one-liners

This revision is now accepted and ready to land.Dec 25 2021, 2:22 AM
glandium updated this revision to Diff 396369.Dec 27 2021, 8:31 PM

Addressed comments and added a check that __thread_vars is aligned correctly for the test to be valuable.

glandium marked 4 inline comments as done.Dec 27 2021, 8:32 PM

@int3 Can you commit this for me?

This revision was automatically updated to reflect the committed changes.