diff options
| author | Jack Carter <jcarter@mips.com> | 2012-06-27 22:48:25 +0000 |
|---|---|---|
| committer | Jack Carter <jcarter@mips.com> | 2012-06-27 22:48:25 +0000 |
| commit | b9f9de93df2eb1e6097458768fbc303f9e2150a9 (patch) | |
| tree | e79ad025a638a16f0c0ce05d6b360241b4523428 /llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp | |
| parent | 51afe6397b07ff9a20e918be046e12d6d0e96507 (diff) | |
| download | bcm5719-llvm-b9f9de93df2eb1e6097458768fbc303f9e2150a9.tar.gz bcm5719-llvm-b9f9de93df2eb1e6097458768fbc303f9e2150a9.zip | |
This allows hello world to be compiled for Mips 64 direct object.
It takes advantage of r159299 which introduces relocation support for N64.
elf-dump needed to be upgraded to support N64 relocations as well.
This passes make check.
Jack
llvm-svn: 159301
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp')
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp index 002c1b907a6..1bd1420c91d 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp @@ -199,6 +199,23 @@ getMachineOpValue(const MCInst &MI, const MCOperand &MO, Mips::Fixups FixupKind = Mips::Fixups(0); switch(cast<MCSymbolRefExpr>(Expr)->getKind()) { + default: llvm_unreachable("Unknown fixup kind!"); + break; + case MCSymbolRefExpr::VK_Mips_GOT_DISP : + llvm_unreachable("fixup kind VK_Mips_GOT_DISP not supported for direct object!"); + break; + case MCSymbolRefExpr::VK_Mips_GPOFF_HI : + FixupKind = Mips::fixup_Mips_GPOFF_HI; + break; + case MCSymbolRefExpr::VK_Mips_GPOFF_LO : + FixupKind = Mips::fixup_Mips_GPOFF_LO; + break; + case MCSymbolRefExpr::VK_Mips_GOT_PAGE : + FixupKind = Mips::fixup_Mips_GOT_PAGE; + break; + case MCSymbolRefExpr::VK_Mips_GOT_OFST : + FixupKind = Mips::fixup_Mips_GOT_OFST; + break; case MCSymbolRefExpr::VK_Mips_GPREL: FixupKind = Mips::fixup_Mips_GPREL16; break; @@ -238,8 +255,6 @@ getMachineOpValue(const MCInst &MI, const MCOperand &MO, case MCSymbolRefExpr::VK_Mips_TPREL_LO: FixupKind = Mips::fixup_Mips_TPREL_LO; break; - default: - break; } // switch Fixups.push_back(MCFixup::Create(0, MO.getExpr(), MCFixupKind(FixupKind))); |

