From ac727e86473be03bbc1c4a436305d2771e3a9acd Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 29 Mar 2019 00:04:58 +0000 Subject: [PATCH] Revert "[WebAssembly] Improve invalid relocation error message" Also Revert "[WebAssembly] Fix typo from rL357143" This reverts commit 0805ec5f7b5c80474352531a99e721c30e73e77f and a9958fc30d0c6d4c140be892c5a824b827d2eb5d (rL357143 and rL357144) They cause failures with address-taken extern (JS) functions in emscripten. llvm-svn: 357224 --- lld/wasm/InputChunks.cpp | 6 +++--- lld/wasm/InputChunks.h | 2 +- lld/wasm/Writer.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp index 32157d3..15e57a8 100644 --- a/lld/wasm/InputChunks.cpp +++ b/lld/wasm/InputChunks.cpp @@ -22,7 +22,7 @@ using namespace llvm::support::endian; using namespace lld; using namespace lld::wasm; -StringRef lld::relocTypeToString(uint8_t RelocType) { +StringRef lld::reloctTypeToString(uint8_t RelocType) { switch (RelocType) { #define WASM_RELOC(NAME, REL) \ case REL: \ @@ -78,7 +78,7 @@ void InputChunk::verifyRelocTargets() const { if (Rel.Type != R_WASM_GLOBAL_INDEX_LEB) { uint32_t ExpectedValue = File->calcExpectedValue(Rel); if (ExpectedValue != ExistingValue) - warn("unexpected existing value for " + relocTypeToString(Rel.Type) + + warn("unexpected existing value for " + reloctTypeToString(Rel.Type) + ": existing=" + Twine(ExistingValue) + " expected=" + Twine(ExpectedValue)); } @@ -105,7 +105,7 @@ void InputChunk::writeTo(uint8_t *Buf) const { for (const WasmRelocation &Rel : Relocations) { uint8_t *Loc = Buf + Rel.Offset + Off; uint32_t Value = File->calcNewValue(Rel); - LLVM_DEBUG(dbgs() << "apply reloc: type=" << relocTypeToString(Rel.Type) + LLVM_DEBUG(dbgs() << "apply reloc: type=" << reloctTypeToString(Rel.Type) << " addend=" << Rel.Addend << " index=" << Rel.Index << " value=" << Value << " offset=" << Rel.Offset << "\n"); diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h index 04957cf..8f0999a 100644 --- a/lld/wasm/InputChunks.h +++ b/lld/wasm/InputChunks.h @@ -218,7 +218,7 @@ protected: } // namespace wasm std::string toString(const wasm::InputChunk *); -StringRef relocTypeToString(uint8_t RelocType); +StringRef reloctTypeToString(uint8_t RelocType); } // namespace lld diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index e5fce71..4697540 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -1160,7 +1160,7 @@ void Writer::processRelocations(InputChunk *Chunk) { auto *Sym = File->getSymbols()[Reloc.Index]; if (Sym->isUndefined() && !Sym->isWeak()) error(File->getName() + ": relocation " + - relocTypeToString(Reloc.Type) + + reloctTypeToString(Reloc.Type) + " cannot be used againt symbol " + Sym->getName() + "; recompile with -fPIC"); } -- 2.7.4