Skip to content

Commit 8c4638c

Browse files
committed
[lld-macho] Clean up comments
1 parent 5bfdbde commit 8c4638c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lld/MachO/SyntheticSections.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void RebaseSection::writeTo(uint8_t *buf) const {
200200
NonLazyPointerSectionBase::NonLazyPointerSectionBase(const char *segname,
201201
const char *name)
202202
: SyntheticSection(segname, name) {
203-
align = WordSize; // vector of pointers / mimic ld64
203+
align = WordSize;
204204
flags = MachO::S_NON_LAZY_SYMBOL_POINTERS;
205205
}
206206

@@ -405,7 +405,9 @@ StubsSection::StubsSection()
405405
: SyntheticSection(segment_names::text, "__stubs") {
406406
flags = MachO::S_SYMBOL_STUBS | MachO::S_ATTR_SOME_INSTRUCTIONS |
407407
MachO::S_ATTR_PURE_INSTRUCTIONS;
408-
align = 4; // machine instructions / mimic ld64
408+
// The stubs section comprises machine instructions, which are aligned to
409+
// 4 bytes on the archs we care about.
410+
align = 4;
409411
reserved2 = target->stubSize;
410412
}
411413

@@ -431,7 +433,7 @@ bool StubsSection::addEntry(Symbol *sym) {
431433
StubHelperSection::StubHelperSection()
432434
: SyntheticSection(segment_names::text, "__stub_helper") {
433435
flags = MachO::S_ATTR_SOME_INSTRUCTIONS | MachO::S_ATTR_PURE_INSTRUCTIONS;
434-
align = 4; // machine instructions / mimic ld64
436+
align = 4; // This section comprises machine instructions
435437
}
436438

437439
uint64_t StubHelperSection::getSize() const {
@@ -472,12 +474,12 @@ ImageLoaderCacheSection::ImageLoaderCacheSection() {
472474
uint8_t *arr = bAlloc.Allocate<uint8_t>(WordSize);
473475
memset(arr, 0, WordSize);
474476
data = {arr, WordSize};
475-
align = WordSize; // pointer / mimic ld64
477+
align = WordSize;
476478
}
477479

478480
LazyPointerSection::LazyPointerSection()
479481
: SyntheticSection(segment_names::data, "__la_symbol_ptr") {
480-
align = WordSize; // vector of pointers / mimic ld64
482+
align = WordSize;
481483
flags = MachO::S_LAZY_SYMBOL_POINTERS;
482484
}
483485

0 commit comments

Comments
 (0)