@@ -193,9 +193,9 @@ const MCSymbol *MCAssembler::getAtom(const MCSymbol &S) const {
193193 return S.getFragment ()->getAtom ();
194194}
195195
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,
199199 bool &WasForced) const {
200200 ++stats::evaluateFixup;
201201
@@ -227,7 +227,7 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
227227
228228 if (IsTarget)
229229 return getBackend ().evaluateTargetFixup (*this , Layout, Fixup, DF, Target,
230- Value, WasForced);
230+ STI, Value, WasForced);
231231
232232 unsigned FixupFlags = getBackendPtr ()->getFixupKindInfo (Fixup.getKind ()).Flags ;
233233 bool IsPCRel = getBackendPtr ()->getFixupKindInfo (Fixup.getKind ()).Flags &
@@ -282,7 +282,8 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
282282 }
283283
284284 // 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)) {
286287 IsResolved = false ;
287288 WasForced = true ;
288289 }
@@ -796,13 +797,13 @@ void MCAssembler::writeSectionData(raw_ostream &OS, const MCSection *Sec,
796797
797798std::tuple<MCValue, uint64_t , bool >
798799MCAssembler::handleFixup (const MCAsmLayout &Layout, MCFragment &F,
799- const MCFixup &Fixup) {
800+ const MCFixup &Fixup, const MCSubtargetInfo *STI ) {
800801 // Evaluate the fixup.
801802 MCValue Target;
802803 uint64_t FixedValue;
803804 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);
806807 if (!IsResolved) {
807808 // The fixup was unresolved, we need a relocation. Inform the object
808809 // writer of the relocation, and give it an opportunity to adjust the
@@ -936,7 +937,7 @@ void MCAssembler::layout(MCAsmLayout &Layout) {
936937 bool IsResolved;
937938 MCValue Target;
938939 std::tie (Target, FixedValue, IsResolved) =
939- handleFixup (Layout, Frag, Fixup);
940+ handleFixup (Layout, Frag, Fixup, STI );
940941 getBackend ().applyFixup (*this , Fixup, Target, Contents, FixedValue,
941942 IsResolved, STI);
942943 }
@@ -960,7 +961,8 @@ bool MCAssembler::fixupNeedsRelaxation(const MCFixup &Fixup,
960961 MCValue Target;
961962 uint64_t Value;
962963 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);
964966 if (Target.getSymA () &&
965967 Target.getSymA ()->getKind () == MCSymbolRefExpr::VK_X86_ABS8 &&
966968 Fixup.getKind () == FK_Data_1)
0 commit comments