diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp index 19e394e5bc38c..0c98c32c21c2c 100644 --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp @@ -18,6 +18,7 @@ #include "llvm/MC/MCFixupKindInfo.h" #include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCSubtargetInfo.h" +#include "llvm/MC/MCValue.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/EndianStream.h" #include "llvm/TargetParser/TargetParser.h" @@ -51,6 +52,8 @@ class AMDGPUAsmBackend : public MCAsmBackend { std::optional getFixupKind(StringRef Name) const override; MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override; + bool shouldForceRelocation(const MCAssembler &, const MCFixup &, + const MCValue &, const MCSubtargetInfo *) override; }; } //End anonymous namespace @@ -189,6 +192,13 @@ MCFixupKindInfo AMDGPUAsmBackend::getFixupKindInfo(MCFixupKind Kind) const { return Infos[Kind - FirstTargetFixupKind]; } +bool AMDGPUAsmBackend::shouldForceRelocation(const MCAssembler &, + const MCFixup &, + const MCValue &Target, + const MCSubtargetInfo *) { + return Target.getSpecifier(); +} + unsigned AMDGPUAsmBackend::getMinimumNopSize() const { return 4; }