summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorJack Carter <jcarter@mips.com>2012-08-22 00:49:30 +0000
committerJack Carter <jcarter@mips.com>2012-08-22 00:49:30 +0000
commit77064c05907c9f02e5f4641c3b2f89e073e65744 (patch)
treed4fe11b5b5884aa805086d42bfeac97805d1a3ab /llvm/lib/MC
parent3fb2047f82296c135b502ef09dff4583cfe307de (diff)
downloadbcm5719-llvm-77064c05907c9f02e5f4641c3b2f89e073e65744.tar.gz
bcm5719-llvm-77064c05907c9f02e5f4641c3b2f89e073e65744.zip
For mips64 switch statements in subroutines could generate
within the codegen EK_GPRel64BlockAddress. This was not supported for direct object output and resulted in an assertion. This change adds support for EK_GPRel64BlockAddress for direct object. One fallout from this is to turn on rela relocations for mips64 to match gas. llvm-svn: 162334
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index bad7cfe38a1..21756cd149b 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -258,12 +258,18 @@ bool MCObjectStreamer::EmitValueToOffset(const MCExpr *Offset,
void MCObjectStreamer::EmitGPRel32Value(const MCExpr *Value) {
MCDataFragment *DF = getOrCreateDataFragment();
- DF->addFixup(MCFixup::Create(DF->getContents().size(),
- Value,
- FK_GPRel_4));
+ DF->addFixup(MCFixup::Create(DF->getContents().size(), Value, FK_GPRel_4));
DF->getContents().resize(DF->getContents().size() + 4, 0);
}
+// Associate GPRel32 fixup with data and resize data area
+void MCObjectStreamer::EmitGPRel64Value(const MCExpr *Value) {
+ MCDataFragment *DF = getOrCreateDataFragment();
+
+ DF->addFixup(MCFixup::Create(DF->getContents().size(), Value, FK_GPRel_4));
+ DF->getContents().resize(DF->getContents().size() + 8, 0);
+}
+
void MCObjectStreamer::FinishImpl() {
// Dump out the dwarf file & directory tables and line tables.
const MCSymbol *LineSectionSymbol = NULL;
OpenPOWER on IntegriCloud