@@ -200,7 +200,7 @@ void RebaseSection::writeTo(uint8_t *buf) const {
200
200
NonLazyPointerSectionBase::NonLazyPointerSectionBase (const char *segname,
201
201
const char *name)
202
202
: SyntheticSection(segname, name) {
203
- align = WordSize; // vector of pointers / mimic ld64
203
+ align = WordSize;
204
204
flags = MachO::S_NON_LAZY_SYMBOL_POINTERS;
205
205
}
206
206
@@ -405,7 +405,9 @@ StubsSection::StubsSection()
405
405
: SyntheticSection(segment_names::text, " __stubs" ) {
406
406
flags = MachO::S_SYMBOL_STUBS | MachO::S_ATTR_SOME_INSTRUCTIONS |
407
407
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 ;
409
411
reserved2 = target->stubSize ;
410
412
}
411
413
@@ -431,7 +433,7 @@ bool StubsSection::addEntry(Symbol *sym) {
431
433
StubHelperSection::StubHelperSection ()
432
434
: SyntheticSection(segment_names::text, " __stub_helper" ) {
433
435
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
435
437
}
436
438
437
439
uint64_t StubHelperSection::getSize () const {
@@ -472,12 +474,12 @@ ImageLoaderCacheSection::ImageLoaderCacheSection() {
472
474
uint8_t *arr = bAlloc.Allocate <uint8_t >(WordSize);
473
475
memset (arr, 0 , WordSize);
474
476
data = {arr, WordSize};
475
- align = WordSize; // pointer / mimic ld64
477
+ align = WordSize;
476
478
}
477
479
478
480
LazyPointerSection::LazyPointerSection ()
479
481
: SyntheticSection(segment_names::data, " __la_symbol_ptr" ) {
480
- align = WordSize; // vector of pointers / mimic ld64
482
+ align = WordSize;
481
483
flags = MachO::S_LAZY_SYMBOL_POINTERS;
482
484
}
483
485
0 commit comments