Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/IceELFObjectWriter.cpp

Issue 1665263003: Subzero. ARM32. Nonsfi. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: git pull Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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),

Powered by Google App Engine
This is Rietveld 408576698