@@ -85,7 +85,7 @@ class MCMachOStreamer : public MCObjectStreamer {
85
85
// / @name MCStreamer Interface
86
86
// / @{
87
87
88
- void changeSection (MCSection *Sect, uint32_t Subsect ) override ;
88
+ void changeSection (MCSection *Sect, uint32_t Subsection = 0 ) override ;
89
89
void emitLabel (MCSymbol *Symbol, SMLoc Loc = SMLoc()) override ;
90
90
void emitAssignment (MCSymbol *Symbol, const MCExpr *Value) override ;
91
91
void emitEHSymAttributes (const MCSymbol *Symbol, MCSymbol *EHSymbol) override ;
@@ -155,10 +155,11 @@ static bool canGoAfterDWARF(const MCSectionMachO &MSec) {
155
155
if (SegName == " __TEXT" && SecName == " __eh_frame" )
156
156
return true ;
157
157
158
- if (SegName == " __DATA" && (SecName == " __nl_symbol_ptr" ||
159
- SecName == " __thread_ptr" ))
158
+ if (SegName == " __DATA" &&
159
+ (SecName == " __llvm_addrsig" || SecName == " __nl_symbol_ptr" ||
160
+ SecName == " __thread_ptr" ))
160
161
return true ;
161
- if (SegName == " __LLVM" && SecName == " __cg_profile" )
162
+ if (SegName == " __LLVM" && ( SecName == " __cg_profile" ) )
162
163
return true ;
163
164
return false ;
164
165
}
@@ -553,7 +554,7 @@ void MCMachOStreamer::finalizeCGProfile() {
553
554
// and set its size now so that it's accounted for in layout.
554
555
MCSection *CGProfileSection = Asm.getContext ().getMachOSection (
555
556
" __LLVM" , " __cg_profile" , 0 , SectionKind::getMetadata ());
556
- Asm. registerSection (* CGProfileSection);
557
+ changeSection ( CGProfileSection);
557
558
// For each entry, reserve space for 2 32-bit indices and a 64-bit count.
558
559
size_t SectionBytes =
559
560
Asm.CGProfile .size () * (2 * sizeof (uint32_t ) + sizeof (uint64_t ));
@@ -594,7 +595,7 @@ void MCMachOStreamer::createAddrSigSection() {
594
595
// to be computed immediately after in order for it to be exported correctly.
595
596
MCSection *AddrSigSection =
596
597
Asm.getContext ().getObjectFileInfo ()->getAddrSigSection ();
597
- Asm. registerSection (* AddrSigSection);
598
+ changeSection ( AddrSigSection);
598
599
auto *Frag = getContext ().allocFragment <MCDataFragment>();
599
600
Frag->setParent (AddrSigSection);
600
601
AddrSigSection->addFragment (*Frag);
0 commit comments