aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCAssembler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 4b78453..7e6365a 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -161,9 +161,11 @@ bool MCAssembler::evaluateFixup(const MCFragment &F, MCFixup &Fixup,
return true;
}
- bool IsResolved = false;
+ // TODO: Require targets to set PCRel at fixup creation time.
unsigned FixupFlags = getBackend().getFixupKindInfo(Fixup.getKind()).Flags;
- bool IsPCRel = FixupFlags & MCFixupKindInfo::FKF_IsPCRel;
+ if (FixupFlags & MCFixupKindInfo::FKF_IsPCRel)
+ Fixup.setPCRel();
+ bool IsResolved = false;
if (FixupFlags & MCFixupKindInfo::FKF_IsTarget) {
IsResolved = getBackend().evaluateTargetFixup(Fixup, Target, Value);
} else {
@@ -177,7 +179,7 @@ bool MCAssembler::evaluateFixup(const MCFragment &F, MCFixup &Fixup,
bool ShouldAlignPC =
FixupFlags & MCFixupKindInfo::FKF_IsAlignedDownTo32Bits;
- if (IsPCRel) {
+ if (Fixup.isPCRel()) {
uint64_t Offset = getFragmentOffset(F) + Fixup.getOffset();
// A number of ARM fixups in Thumb mode require that the effective PC
@@ -202,8 +204,6 @@ bool MCAssembler::evaluateFixup(const MCFragment &F, MCFixup &Fixup,
if (IsResolved && mc::isRelocRelocation(Fixup.getKind()))
IsResolved = false;
- if (IsPCRel)
- Fixup.setPCRel();
getBackend().applyFixup(F, Fixup, Target, Contents, Value, IsResolved);
return true;
}