@@ -193,9 +193,9 @@ const MCSymbol *MCAssembler::getAtom(const MCSymbol &S) const {
193
193
return S.getFragment ()->getAtom ();
194
194
}
195
195
196
- bool MCAssembler::evaluateFixup (const MCAsmLayout &Layout,
197
- const MCFixup &Fixup, const MCFragment *DF,
198
- MCValue &Target , uint64_t &Value,
196
+ bool MCAssembler::evaluateFixup (const MCAsmLayout &Layout, const MCFixup &Fixup,
197
+ const MCFragment *DF, MCValue &Target ,
198
+ const MCSubtargetInfo *STI , uint64_t &Value,
199
199
bool &WasForced) const {
200
200
++stats::evaluateFixup;
201
201
@@ -227,7 +227,7 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
227
227
228
228
if (IsTarget)
229
229
return getBackend ().evaluateTargetFixup (*this , Layout, Fixup, DF, Target,
230
- Value, WasForced);
230
+ STI, Value, WasForced);
231
231
232
232
unsigned FixupFlags = getBackendPtr ()->getFixupKindInfo (Fixup.getKind ()).Flags ;
233
233
bool IsPCRel = getBackendPtr ()->getFixupKindInfo (Fixup.getKind ()).Flags &
@@ -282,7 +282,8 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
282
282
}
283
283
284
284
// Let the backend force a relocation if needed.
285
- if (IsResolved && getBackend ().shouldForceRelocation (*this , Fixup, Target)) {
285
+ if (IsResolved &&
286
+ getBackend ().shouldForceRelocation (*this , Fixup, Target, STI)) {
286
287
IsResolved = false ;
287
288
WasForced = true ;
288
289
}
@@ -796,13 +797,13 @@ void MCAssembler::writeSectionData(raw_ostream &OS, const MCSection *Sec,
796
797
797
798
std::tuple<MCValue, uint64_t , bool >
798
799
MCAssembler::handleFixup (const MCAsmLayout &Layout, MCFragment &F,
799
- const MCFixup &Fixup) {
800
+ const MCFixup &Fixup, const MCSubtargetInfo *STI ) {
800
801
// Evaluate the fixup.
801
802
MCValue Target;
802
803
uint64_t FixedValue;
803
804
bool WasForced;
804
- bool IsResolved = evaluateFixup (Layout, Fixup, &F, Target, FixedValue,
805
- WasForced);
805
+ bool IsResolved =
806
+ evaluateFixup (Layout, Fixup, &F, Target, STI, FixedValue, WasForced);
806
807
if (!IsResolved) {
807
808
// The fixup was unresolved, we need a relocation. Inform the object
808
809
// writer of the relocation, and give it an opportunity to adjust the
@@ -936,7 +937,7 @@ void MCAssembler::layout(MCAsmLayout &Layout) {
936
937
bool IsResolved;
937
938
MCValue Target;
938
939
std::tie (Target, FixedValue, IsResolved) =
939
- handleFixup (Layout, Frag, Fixup);
940
+ handleFixup (Layout, Frag, Fixup, STI );
940
941
getBackend ().applyFixup (*this , Fixup, Target, Contents, FixedValue,
941
942
IsResolved, STI);
942
943
}
@@ -960,7 +961,8 @@ bool MCAssembler::fixupNeedsRelaxation(const MCFixup &Fixup,
960
961
MCValue Target;
961
962
uint64_t Value;
962
963
bool WasForced;
963
- bool Resolved = evaluateFixup (Layout, Fixup, DF, Target, Value, WasForced);
964
+ bool Resolved = evaluateFixup (Layout, Fixup, DF, Target,
965
+ DF->getSubtargetInfo (), Value, WasForced);
964
966
if (Target.getSymA () &&
965
967
Target.getSymA ()->getKind () == MCSymbolRefExpr::VK_X86_ABS8 &&
966
968
Fixup.getKind () == FK_Data_1)
0 commit comments