Skip to content

Commit c26c5e4

Browse files
committed
[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 ```
1 parent c32ba7d commit c26c5e4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/MC/MCSection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ void MCSection::flushPendingLabels() {
116116
MCFragment *F = new MCDataFragment();
117117
getFragmentList().insert(CurInsertionPoint, F);
118118
F->setParent(this);
119+
if (CurInsertionPoint != begin())
120+
F->setAtom(std::prev(CurInsertionPoint)->getAtom());
119121
flushPendingLabels(F, 0, Label.Subsection);
120122
}
121123
}

0 commit comments

Comments
 (0)