Skip to content

Commit 0b3579b

Browse files
committed
MCMachOStreamer: Call MCObjectStreamer::changeSection
We don't want to emit linker-local label `ltmpN` for addrsig and cg_profile sections. Make the intention clear to prepare for the pending refactoring that moves emitLabel from switchSection to changeSection.
1 parent 7ad1d5b commit 0b3579b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/MC/MCMachOStreamer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ void MCMachOStreamer::finalizeCGProfile() {
478478
// and set its size now so that it's accounted for in layout.
479479
MCSection *CGProfileSection = Asm.getContext().getMachOSection(
480480
"__LLVM", "__cg_profile", 0, SectionKind::getMetadata());
481-
changeSection(CGProfileSection);
481+
// Call the base class changeSection to omit the linker-local label.
482+
MCObjectStreamer::changeSection(CGProfileSection);
482483
// For each entry, reserve space for 2 32-bit indices and a 64-bit count.
483484
size_t SectionBytes =
484485
W.getCGProfile().size() * (2 * sizeof(uint32_t) + sizeof(uint64_t));
@@ -510,7 +511,8 @@ void MCMachOStreamer::createAddrSigSection() {
510511
// to be computed immediately after in order for it to be exported correctly.
511512
MCSection *AddrSigSection =
512513
Asm.getContext().getObjectFileInfo()->getAddrSigSection();
513-
changeSection(AddrSigSection);
514+
// Call the base class changeSection to omit the linker-local label.
515+
MCObjectStreamer::changeSection(AddrSigSection);
514516
auto *Frag = cast<MCFragment>(AddrSigSection->curFragList()->Head);
515517
// We will generate a series of pointer-sized symbol relocations at offset
516518
// 0x0. Set the section size to be large enough to contain a single pointer

0 commit comments

Comments
 (0)