@@ -73,6 +73,11 @@ void MCAsmLayout::UpdateForSlide(MCFragment *F, int SlideAmount) {
73
73
getAssembler ().LayoutSection (*this , i);
74
74
}
75
75
76
+ void MCAsmLayout::FragmentReplaced (MCFragment *Src, MCFragment *Dst) {
77
+ Dst->Offset = Src->Offset ;
78
+ Dst->EffectiveSize = Src->EffectiveSize ;
79
+ }
80
+
76
81
uint64_t MCAsmLayout::getFragmentAddress (const MCFragment *F) const {
77
82
assert (F->getParent () && " Missing section()!" );
78
83
return getSectionAddress (F->getParent ()) + getFragmentOffset (F);
@@ -818,13 +823,10 @@ void MCAssembler::FinishLayout(MCAsmLayout &Layout) {
818
823
SD.getFragmentList ().insert (it2, DF);
819
824
820
825
// Update the data fragments layout data.
821
- //
822
- // FIXME: Add MCAsmLayout utility for this.
823
826
DF->setParent (IF->getParent ());
824
827
DF->setAtom (IF->getAtom ());
825
828
DF->setOrdinal (IF->getOrdinal ());
826
- Layout.setFragmentOffset (DF, Layout.getFragmentOffset (IF));
827
- Layout.setFragmentEffectiveSize (DF, Layout.getFragmentEffectiveSize (IF));
829
+ Layout.FragmentReplaced (IF, DF);
828
830
829
831
// Copy in the data and the fixups.
830
832
DF->getContents ().append (IF->getCode ().begin (), IF->getCode ().end ());
0 commit comments