Index: src/IceELFObjectWriter.cpp |
diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp |
index f370d873cd9fe3b5f5cb06ed9f653f9a13bfc87a..8b531fd40b4141357949b9ad3163723452974824 100644 |
--- a/src/IceELFObjectWriter.cpp |
+++ b/src/IceELFObjectWriter.cpp |
@@ -22,9 +22,9 @@ |
#include "IceGlobalInits.h" |
#include "IceInst.h" |
#include "IceOperand.h" |
-#include "llvm/Support/MathExtras.h" |
-using namespace llvm::ELF; |
+#include "llvm/Support/MathExtras.h" |
+#include "llvm/Support/ELF.h" |
Jim Stichnoth
2016/02/10 06:36:00
alphabetical order
John
2016/02/10 15:41:13
Done.
|
namespace Ice { |
@@ -419,11 +419,13 @@ void ELFObjectWriter::writeDataOfType(SectionType ST, |
Section->appendZeros(Str, Init->getNumBytes()); |
break; |
case VariableDeclaration::Initializer::RelocInitializerKind: { |
- const auto Reloc = |
+ const auto *Reloc = |
Jim Stichnoth
2016/02/10 06:36:00
Cool. If you think it's appropriate, there are a
John
2016/02/10 15:41:13
Noted. Expect a cl later today with this fix.
|
llvm::cast<VariableDeclaration::RelocInitializer>(Init.get()); |
AssemblerFixup NewFixup; |
NewFixup.set_position(Section->getCurrentSize()); |
- NewFixup.set_kind(RelocationKind); |
+ NewFixup.set_kind(Reloc->hasFixup() ? Reloc->getFixup() |
+ : RelocationKind); |
+ assert(NewFixup.kind() != llvm::ELF::R_ARM_NONE); |
constexpr bool SuppressMangling = true; |
NewFixup.set_value(Ctx.getConstantSym( |
Reloc->getOffset(), Reloc->getDeclaration()->mangleName(&Ctx), |