aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-07-22 23:48:06 -0700
committerFangrui Song <i@maskray.me>2025-07-22 23:48:06 -0700
commit0b3579bedcb2ac608b1a68bf967386c4600554ea (patch)
treee06a008f309ba4dfea87f723ea2e2ed28374a176 /llvm/lib/MC/MCMachOStreamer.cpp
parent7ad1d5bd34754fb909d7b58014372baddf94bfc7 (diff)
downloadllvm-0b3579bedcb2ac608b1a68bf967386c4600554ea.zip
llvm-0b3579bedcb2ac608b1a68bf967386c4600554ea.tar.gz
llvm-0b3579bedcb2ac608b1a68bf967386c4600554ea.tar.bz2
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.
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 7560399..8f023bd 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -478,7 +478,8 @@ void MCMachOStreamer::finalizeCGProfile() {
// and set its size now so that it's accounted for in layout.
MCSection *CGProfileSection = Asm.getContext().getMachOSection(
"__LLVM", "__cg_profile", 0, SectionKind::getMetadata());
- changeSection(CGProfileSection);
+ // Call the base class changeSection to omit the linker-local label.
+ MCObjectStreamer::changeSection(CGProfileSection);
// For each entry, reserve space for 2 32-bit indices and a 64-bit count.
size_t SectionBytes =
W.getCGProfile().size() * (2 * sizeof(uint32_t) + sizeof(uint64_t));
@@ -510,7 +511,8 @@ void MCMachOStreamer::createAddrSigSection() {
// to be computed immediately after in order for it to be exported correctly.
MCSection *AddrSigSection =
Asm.getContext().getObjectFileInfo()->getAddrSigSection();
- changeSection(AddrSigSection);
+ // Call the base class changeSection to omit the linker-local label.
+ MCObjectStreamer::changeSection(AddrSigSection);
auto *Frag = cast<MCFragment>(AddrSigSection->curFragList()->Head);
// We will generate a series of pointer-sized symbol relocations at offset
// 0x0. Set the section size to be large enough to contain a single pointer