aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCSection.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-06-18 15:14:21 -0700
committerFangrui Song <i@maskray.me>2023-06-18 15:14:21 -0700
commitc26c5e47ab9ca60835f191c90fa751e9a7dd0f3d (patch)
tree4e3048aae56def49bff3bb2128a3db90e942563a /llvm/lib/MC/MCSection.cpp
parentc32ba7d5e00869de05d798ec8eb791bd1d7fb585 (diff)
downloadllvm-c26c5e47ab9ca60835f191c90fa751e9a7dd0f3d.zip
llvm-c26c5e47ab9ca60835f191c90fa751e9a7dd0f3d.tar.gz
llvm-c26c5e47ab9ca60835f191c90fa751e9a7dd0f3d.tar.bz2
[MC] flushPendingLabels: set Atom for new fragment after D71368
The newly created MCDataFragment should inherit Atom (see MCMachOStreamer::finishImpl). I cannot think of a case to test the behavior, but this is one step towards folding the Mach-O label difference below and making Mach-O more similar to ELF. ``` .section __DATA,xray_instr_map lxray_sleds_start1: .space 16 Lxray_sleds_end1: .section __DATA,xray_fn_idx .quad (Lxray_sleds_end1-lxray_sleds_start1)>>4 // error: expected relocatable expression // Mach-O ```
Diffstat (limited to 'llvm/lib/MC/MCSection.cpp')
-rw-r--r--llvm/lib/MC/MCSection.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp
index 883cb5d..9b784a6 100644
--- a/llvm/lib/MC/MCSection.cpp
+++ b/llvm/lib/MC/MCSection.cpp
@@ -116,6 +116,8 @@ void MCSection::flushPendingLabels() {
MCFragment *F = new MCDataFragment();
getFragmentList().insert(CurInsertionPoint, F);
F->setParent(this);
+ if (CurInsertionPoint != begin())
+ F->setAtom(std::prev(CurInsertionPoint)->getAtom());
flushPendingLabels(F, 0, Label.Subsection);
}
}