Skip to content

Commit a556ba7

Browse files
committed
MCAsmBackend: Merge addReloc into applyFixup
Follow-up to llvm#141333. MCAssembler.cpp calls both addReloc and applyFixup, with the default addReloc calling shouldForceRelocation. The three virtual calls are inefficient. This change changes applyFixup to potentially add a relocation, allowing targets to remove `maybeAddReloc` two and eliminate two virtual calls. maybeAddReloc is the previous default `addReloc`. Refactor targets overridding `addReloc` to call their customized `addReloc` instead.
1 parent 31e85f9 commit a556ba7

File tree

26 files changed

+105
-92
lines changed

26 files changed

+105
-92
lines changed

llvm/include/llvm/MC/MCAsmBackend.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class LLVM_ABI MCAsmBackend {
9191
/// Get information on a fixup kind.
9292
virtual MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const;
9393

94-
// Hook used by the default `addReloc` to check if a relocation is needed.
94+
// Hook used by `maybeAddReloc` to check if a relocation is needed.
9595
virtual bool shouldForceRelocation(const MCFixup &, const MCValue &) {
9696
return false;
9797
}
@@ -116,9 +116,10 @@ class LLVM_ABI MCAsmBackend {
116116
llvm_unreachable("Need to implement hook if target has custom fixups");
117117
}
118118

119-
virtual bool addReloc(const MCFragment &, const MCFixup &, const MCValue &,
120-
uint64_t &FixedValue, bool IsResolved);
119+
void maybeAddReloc(const MCFragment &, const MCFixup &, const MCValue &,
120+
uint64_t &Value, bool IsResolved);
121121

122+
/// Determine if a relocation is required. In addition,
122123
/// Apply the \p Value for given \p Fixup into the provided data fragment, at
123124
/// the offset specified by the fixup and following the fixup kind as
124125
/// appropriate. Errors (such as an out of range fixup value) should be

llvm/lib/MC/MCAsmBackend.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,11 @@ bool MCAsmBackend::fixupNeedsRelaxationAdvanced(const MCFixup &Fixup,
116116
return fixupNeedsRelaxation(Fixup, Value);
117117
}
118118

119-
bool MCAsmBackend::addReloc(const MCFragment &F, const MCFixup &Fixup,
120-
const MCValue &Target, uint64_t &FixedValue,
121-
bool IsResolved) {
122-
if (IsResolved && shouldForceRelocation(Fixup, Target))
123-
IsResolved = false;
119+
void MCAsmBackend::maybeAddReloc(const MCFragment &F, const MCFixup &Fixup,
120+
const MCValue &Target, uint64_t &Value,
121+
bool IsResolved) {
124122
if (!IsResolved)
125-
Asm->getWriter().recordRelocation(F, Fixup, Target, FixedValue);
126-
return IsResolved;
123+
Asm->getWriter().recordRelocation(F, Fixup, Target, Value);
127124
}
128125

129126
bool MCAsmBackend::isDarwinCanonicalPersonality(const MCSymbol *Sym) const {

llvm/lib/MC/MCAssembler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ bool MCAssembler::evaluateFixup(const MCFragment &F, const MCFixup &Fixup,
202202

203203
if (IsResolved && mc::isRelocRelocation(Fixup.getKind()))
204204
IsResolved = false;
205-
IsResolved = getBackend().addReloc(F, Fixup, Target, Value, IsResolved);
206205
getBackend().applyFixup(F, Fixup, Target, Contents, Value, IsResolved);
207206
return true;
208207
}

llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,13 @@ unsigned AArch64AsmBackend::getFixupKindContainereSizeInBytes(unsigned Kind) con
412412
}
413413
}
414414

415-
void AArch64AsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
415+
void AArch64AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
416416
const MCValue &Target,
417417
MutableArrayRef<char> Data, uint64_t Value,
418418
bool IsResolved) {
419+
if (IsResolved && shouldForceRelocation(Fixup, Target))
420+
IsResolved = false;
421+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
419422
MCFixupKind Kind = Fixup.getKind();
420423
if (mc::isRelocation(Kind))
421424
return;

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,13 @@ static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
130130
}
131131
}
132132

133-
void AMDGPUAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
133+
void AMDGPUAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
134134
const MCValue &Target,
135135
MutableArrayRef<char> Data, uint64_t Value,
136136
bool IsResolved) {
137+
if (IsResolved && shouldForceRelocation(Fixup, Target))
138+
IsResolved = false;
139+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
137140
if (mc::isRelocation(Fixup.getKind()))
138141
return;
139142

llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,9 @@ void ARMAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
11281128
const MCValue &Target,
11291129
MutableArrayRef<char> Data, uint64_t Value,
11301130
bool IsResolved) {
1131+
if (IsResolved && shouldForceRelocation(Fixup, Target))
1132+
IsResolved = false;
1133+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
11311134
auto Kind = Fixup.getKind();
11321135
if (mc::isRelocation(Kind))
11331136
return;

llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -368,26 +368,21 @@ AVRAsmBackend::createObjectTargetWriter() const {
368368
return createAVRELFObjectWriter(MCELFObjectTargetWriter::getOSABI(OSType));
369369
}
370370

371-
bool AVRAsmBackend::addReloc(const MCFragment &F, const MCFixup &Fixup,
372-
const MCValue &Target, uint64_t &FixedValue,
373-
bool IsResolved) {
371+
void AVRAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
372+
const MCValue &Target,
373+
MutableArrayRef<char> Data, uint64_t Value,
374+
bool IsResolved) {
374375
// AVR sets the fixup value to bypass the assembly time overflow with a
375376
// relocation.
376377
if (IsResolved) {
377-
auto TargetVal = MCValue::get(Target.getAddSym(), Target.getSubSym(),
378-
FixedValue, Target.getSpecifier());
378+
auto TargetVal = MCValue::get(Target.getAddSym(), Target.getSubSym(), Value,
379+
Target.getSpecifier());
379380
if (forceRelocation(F, Fixup, TargetVal))
380381
IsResolved = false;
381382
}
382383
if (!IsResolved)
383-
Asm->getWriter().recordRelocation(F, Fixup, Target, FixedValue);
384-
return IsResolved;
385-
}
384+
Asm->getWriter().recordRelocation(F, Fixup, Target, Value);
386385

387-
void AVRAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
388-
const MCValue &Target,
389-
MutableArrayRef<char> Data, uint64_t Value,
390-
bool IsResolved) {
391386
if (mc::isRelocation(Fixup.getKind()))
392387
return;
393388
adjustFixupValue(Fixup, Target, Value, &getContext());

llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ class AVRAsmBackend : public MCAsmBackend {
3737
std::unique_ptr<MCObjectTargetWriter>
3838
createObjectTargetWriter() const override;
3939

40-
bool addReloc(const MCFragment &, const MCFixup &, const MCValue &,
41-
uint64_t &FixedValue, bool IsResolved) override;
42-
4340
void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target,
4441
MutableArrayRef<char> Data, uint64_t Value,
4542
bool IsResolved) override;

llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ bool BPFAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
6666
return true;
6767
}
6868

69-
void BPFAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
69+
void BPFAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
7070
const MCValue &Target,
7171
MutableArrayRef<char> Data, uint64_t Value,
7272
bool IsResolved) {
73+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
7374
if (Fixup.getKind() == FK_SecRel_8) {
7475
// The Value is 0 for global variables, and the in-section offset
7576
// for static variables. Write to the immediate field of the inst.

llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,14 @@ bool CSKYAsmBackend::fixupNeedsRelaxationAdvanced(const MCFixup &Fixup,
188188
}
189189
}
190190

191-
void CSKYAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
191+
void CSKYAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
192192
const MCValue &Target,
193193
MutableArrayRef<char> Data, uint64_t Value,
194194
bool IsResolved) {
195+
if (IsResolved && shouldForceRelocation(Fixup, Target))
196+
IsResolved = false;
197+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
198+
195199
MCFixupKind Kind = Fixup.getKind();
196200
if (mc::isRelocation(Kind))
197201
return;

llvm/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,13 @@ class HexagonAsmBackend : public MCAsmBackend {
653653

654654
} // namespace
655655

656-
void HexagonAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
656+
void HexagonAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
657657
const MCValue &Target,
658658
MutableArrayRef<char> Data,
659659
uint64_t FixupValue, bool IsResolved) {
660+
if (IsResolved && shouldForceRelocation(Fixup, Target))
661+
IsResolved = false;
662+
maybeAddReloc(F, Fixup, Target, FixupValue, IsResolved);
660663
// When FixupValue is 0 the relocation is external and there
661664
// is nothing for us to do.
662665
if (!FixupValue)

llvm/lib/Target/Lanai/MCTargetDesc/LanaiAsmBackend.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "llvm/MC/MCFixupKindInfo.h"
1515
#include "llvm/MC/MCObjectWriter.h"
1616
#include "llvm/MC/MCSubtargetInfo.h"
17+
#include "llvm/MC/MCValue.h"
1718
#include "llvm/Support/ErrorHandling.h"
1819
#include "llvm/Support/raw_ostream.h"
1920

@@ -71,13 +72,15 @@ bool LanaiAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count,
7172
return true;
7273
}
7374

74-
void LanaiAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
75+
void LanaiAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
7576
const MCValue &Target,
7677
MutableArrayRef<char> Data, uint64_t Value,
77-
bool) {
78+
bool IsResolved) {
79+
if (!IsResolved)
80+
Asm->getWriter().recordRelocation(F, Fixup, Target, Value);
81+
7882
MCFixupKind Kind = Fixup.getKind();
7983
Value = adjustFixupValue(static_cast<unsigned>(Kind), Value);
80-
8184
if (!Value)
8285
return; // This value doesn't change the encoding
8386

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,13 @@ static void fixupLeb128(MCContext &Ctx, const MCFixup &Fixup,
140140
Ctx.reportError(Fixup.getLoc(), "Invalid uleb128 value!");
141141
}
142142

143-
void LoongArchAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
143+
void LoongArchAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
144144
const MCValue &Target,
145145
MutableArrayRef<char> Data, uint64_t Value,
146146
bool IsResolved) {
147+
if (IsResolved && shouldForceRelocation(Fixup, Target))
148+
IsResolved = false;
149+
IsResolved = addReloc(F, Fixup, Target, Value, IsResolved);
147150
if (!Value)
148151
return; // Doesn't change encoding.
149152

@@ -453,7 +456,8 @@ bool LoongArchAsmBackend::addReloc(const MCFragment &F, const MCFixup &Fixup,
453456
const MCValue &Target, uint64_t &FixedValue,
454457
bool IsResolved) {
455458
auto Fallback = [&]() {
456-
return MCAsmBackend::addReloc(F, Fixup, Target, FixedValue, IsResolved);
459+
MCAsmBackend::maybeAddReloc(F, Fixup, Target, FixedValue, IsResolved);
460+
return true;
457461
};
458462
uint64_t FixedValueA, FixedValueB;
459463
if (Target.getSubSym()) {

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LoongArchAsmBackend : public MCAsmBackend {
4040
const MCTargetOptions &Options);
4141

4242
bool addReloc(const MCFragment &, const MCFixup &, const MCValue &,
43-
uint64_t &FixedValue, bool IsResolved) override;
43+
uint64_t &FixedValue, bool IsResolved);
4444

4545
void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target,
4646
MutableArrayRef<char> Data, uint64_t Value,

llvm/lib/Target/M68k/MCTargetDesc/M68kAsmBackend.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/BinaryFormat/ELF.h"
1919
#include "llvm/BinaryFormat/MachO.h"
2020
#include "llvm/MC/MCAsmBackend.h"
21+
#include "llvm/MC/MCAssembler.h"
2122
#include "llvm/MC/MCELFObjectWriter.h"
2223
#include "llvm/MC/MCExpr.h"
2324
#include "llvm/MC/MCFixupKindInfo.h"
@@ -77,11 +78,14 @@ class M68kAsmBackend : public MCAsmBackend {
7778
};
7879
} // end anonymous namespace
7980

80-
void M68kAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
81-
const MCValue &, MutableArrayRef<char> Data,
82-
uint64_t Value, bool) {
83-
unsigned Size = 1 << getFixupKindLog2Size(Fixup.getKind());
81+
void M68kAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
82+
const MCValue &Target,
83+
MutableArrayRef<char> Data, uint64_t Value,
84+
bool IsResolved) {
85+
if (!IsResolved)
86+
Asm->getWriter().recordRelocation(F, Fixup, Target, Value);
8487

88+
unsigned Size = 1 << getFixupKindLog2Size(Fixup.getKind());
8589
assert(Fixup.getOffset() + Size <= Data.size() && "Invalid fixup offset!");
8690
// Check that uppper bits are either all zeros or all ones.
8791
// Specifically ignore overflow/underflow as long as the leakage is

llvm/lib/Target/MSP430/MCTargetDesc/MSP430AsmBackend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ uint64_t MSP430AsmBackend::adjustFixupValue(const MCFixup &Fixup,
103103
}
104104
}
105105

106-
void MSP430AsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
106+
void MSP430AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
107107
const MCValue &Target,
108108
MutableArrayRef<char> Data, uint64_t Value,
109109
bool IsResolved) {
110+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
110111
Value = adjustFixupValue(Fixup, Value, getContext());
111112
MCFixupKindInfo Info = getFixupKindInfo(Fixup.getKind());
112113
if (!Value)

llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,13 @@ static unsigned calculateMMLEIndex(unsigned i) {
242242
/// ApplyFixup - Apply the \p Value for given \p Fixup into the provided
243243
/// data fragment, at the offset specified by the fixup and following the
244244
/// fixup kind as appropriate.
245-
void MipsAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
245+
void MipsAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
246246
const MCValue &Target,
247247
MutableArrayRef<char> Data, uint64_t Value,
248248
bool IsResolved) {
249+
if (IsResolved && shouldForceRelocation(Fixup, Target))
250+
IsResolved = false;
251+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
249252
MCFixupKind Kind = Fixup.getKind();
250253
MCContext &Ctx = getContext();
251254
Value = adjustFixupValue(Fixup, Value, Ctx);

llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,6 @@ class PPCAsmBackend : public MCAsmBackend {
9393

9494
MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;
9595

96-
bool addReloc(const MCFragment &F, const MCFixup &Fixup,
97-
const MCValue &TargetVal, uint64_t &FixedValue,
98-
bool IsResolved) override {
99-
// In PPC64 ELFv1, .quad .TOC.@tocbase in the .opd section is expected to
100-
// reference the null symbol.
101-
auto Target = TargetVal;
102-
if (Target.getSpecifier() == PPC::S_TOCBASE)
103-
Target.setAddSym(nullptr);
104-
return MCAsmBackend::addReloc(F, Fixup, Target, FixedValue, IsResolved);
105-
}
106-
10796
void applyFixup(const MCFragment &, const MCFixup &Fixup,
10897
const MCValue &Target, MutableArrayRef<char> Data,
10998
uint64_t Value, bool IsResolved) override;
@@ -201,10 +190,20 @@ MCFixupKindInfo PPCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
201190
: InfosBE)[Kind - FirstTargetFixupKind];
202191
}
203192

204-
void PPCAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
205-
const MCValue &Target,
193+
void PPCAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
194+
const MCValue &TargetVal,
206195
MutableArrayRef<char> Data, uint64_t Value,
207196
bool IsResolved) {
197+
// In PPC64 ELFv1, .quad .TOC.@tocbase in the .opd section is expected to
198+
// reference the null symbol.
199+
auto Target = TargetVal;
200+
if (Target.getSpecifier() == PPC::S_TOCBASE)
201+
Target.setAddSym(nullptr);
202+
if (IsResolved && shouldForceRelocation(Fixup, Target))
203+
IsResolved = false;
204+
if (!IsResolved)
205+
Asm->getWriter().recordRelocation(F, Fixup, Target, Value);
206+
208207
MCFixupKind Kind = Fixup.getKind();
209208
if (mc::isRelocation(Kind))
210209
return;

llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,10 +815,11 @@ bool RISCVAsmBackend::addReloc(const MCFragment &F, const MCFixup &Fixup,
815815
return false;
816816
}
817817

818-
void RISCVAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
818+
void RISCVAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
819819
const MCValue &Target,
820820
MutableArrayRef<char> Data, uint64_t Value,
821821
bool IsResolved) {
822+
IsResolved = addReloc(F, Fixup, Target, Value, IsResolved);
822823
MCFixupKind Kind = Fixup.getKind();
823824
if (mc::isRelocation(Kind))
824825
return;

llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class RISCVAsmBackend : public MCAsmBackend {
5151
uint64_t &Value) override;
5252

5353
bool addReloc(const MCFragment &, const MCFixup &, const MCValue &,
54-
uint64_t &FixedValue, bool IsResolved) override;
54+
uint64_t &FixedValue, bool IsResolved);
5555

5656
void maybeAddVendorReloc(const MCFragment &, const MCFixup &);
5757

llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,11 @@ MCFixupKindInfo SparcAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
253253
return Info;
254254
}
255255

256-
void SparcAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
256+
void SparcAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
257257
const MCValue &Target,
258258
MutableArrayRef<char> Data, uint64_t Value,
259259
bool IsResolved) {
260+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
260261
if (!IsResolved)
261262
return;
262263
Value = adjustFixupValue(Fixup.getKind(), Value);

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,13 @@ bool SystemZMCAsmBackend::shouldForceRelocation(const MCFixup &,
158158
return Target.getSpecifier();
159159
}
160160

161-
void SystemZMCAsmBackend::applyFixup(const MCFragment &, const MCFixup &Fixup,
161+
void SystemZMCAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
162162
const MCValue &Target,
163163
MutableArrayRef<char> Data, uint64_t Value,
164164
bool IsResolved) {
165+
if (IsResolved && shouldForceRelocation(Fixup, Target))
166+
IsResolved = false;
167+
maybeAddReloc(F, Fixup, Target, Value, IsResolved);
165168
MCFixupKind Kind = Fixup.getKind();
166169
if (mc::isRelocation(Kind))
167170
return;

0 commit comments

Comments
 (0)