diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2016-06-10 19:26:38 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2016-06-10 19:26:38 +0000 |
commit | f3af841462ad6dfc6c2fee5a441400b4bded931c (patch) | |
tree | 35d23a6d90d93d0b4eacf8d2904b8978f0f8a440 /llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp | |
parent | cbd68ecf04ddba1bc2a1c75ca8fa55b6f472f6ee (diff) | |
download | bcm5719-llvm-f3af841462ad6dfc6c2fee5a441400b4bded931c.tar.gz bcm5719-llvm-f3af841462ad6dfc6c2fee5a441400b4bded931c.zip |
AMDGPU/SI: Don't use fixup_si_rodata for scratch rsrc relocations
Summary:
We need to set the fixup type to FK_Data_4 for the
SCRATCH_RSRC_DWORD[01] symbols, since these require absolute
relocations, and fixup_si_rodata is for relative relocations.
Reviewers: arsenm, kzhuravl
Subscribers: arsenm, kzhuravl, llvm-commits
Differential Revision: http://reviews.llvm.org/D21153
llvm-svn: 272417
Diffstat (limited to 'llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp index 9eb3dadbc5e..533a54c1a8b 100644 --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp @@ -249,7 +249,12 @@ uint64_t SIMCCodeEmitter::getMachineOpValue(const MCInst &MI, if (MO.isExpr()) { const MCSymbolRefExpr *Expr = cast<MCSymbolRefExpr>(MO.getExpr()); - MCFixupKind Kind = (MCFixupKind)AMDGPU::fixup_si_rodata; + const MCSymbol &Sym = Expr->getSymbol(); + MCFixupKind Kind; + if (Sym.isExternal()) + Kind = FK_Data_4; + else + Kind = (MCFixupKind)AMDGPU::fixup_si_rodata; Fixups.push_back(MCFixup::create(4, Expr, Kind, MI.getLoc())); } |