diff options
author | Sam Clegg <sbc@chromium.org> | 2018-07-16 23:09:29 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2018-07-16 23:09:29 +0000 |
commit | cf2a9e28b1bb37181ae916043df155cede38ff18 (patch) | |
tree | 2201a2ebd62ff346c8c631b0c71422aff1e78860 /llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp | |
parent | c71adc8040b1e382b195a0096015cb5c39628b23 (diff) | |
download | bcm5719-llvm-cf2a9e28b1bb37181ae916043df155cede38ff18.tar.gz bcm5719-llvm-cf2a9e28b1bb37181ae916043df155cede38ff18.zip |
[WebAssembly] Remove ELF file support.
This support was partial and temporary. Now that we have
wasm object file support its no longer needed.
Differential Revision: https://reviews.llvm.org/D48744
llvm-svn: 337222
Diffstat (limited to 'llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp deleted file mode 100644 index 0d9cb7b96f6..00000000000 --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===-- WebAssemblyELFObjectWriter.cpp - WebAssembly ELF Writer -----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// This file handles ELF-specific object emission, converting LLVM's -/// internal fixups into the appropriate relocations. -/// -//===----------------------------------------------------------------------===// - -#include "MCTargetDesc/WebAssemblyMCTargetDesc.h" -#include "llvm/MC/MCELFObjectWriter.h" -#include "llvm/MC/MCFixup.h" -#include "llvm/MC/MCObjectWriter.h" -#include "llvm/Support/ErrorHandling.h" -using namespace llvm; - -namespace { -class WebAssemblyELFObjectWriter final : public MCELFObjectTargetWriter { -public: - WebAssemblyELFObjectWriter(bool Is64Bit, uint8_t OSABI); - -protected: - unsigned getRelocType(MCContext &Ctx, const MCValue &Target, - const MCFixup &Fixup, bool IsPCRel) const override; -}; -} // end anonymous namespace - -WebAssemblyELFObjectWriter::WebAssemblyELFObjectWriter(bool Is64Bit, - uint8_t OSABI) - : MCELFObjectTargetWriter(Is64Bit, OSABI, ELF::EM_WEBASSEMBLY, - /*HasRelocationAddend=*/false) {} - -unsigned WebAssemblyELFObjectWriter::getRelocType(MCContext &Ctx, - const MCValue &Target, - const MCFixup &Fixup, - bool IsPCRel) const { - // WebAssembly functions are not allocated in the address space. To resolve a - // pointer to a function, we must use a special relocation type. - if (const MCSymbolRefExpr *SyExp = - dyn_cast<MCSymbolRefExpr>(Fixup.getValue())) - if (SyExp->getKind() == MCSymbolRefExpr::VK_WebAssembly_FUNCTION) - return ELF::R_WEBASSEMBLY_FUNCTION; - - switch (Fixup.getKind()) { - case FK_Data_4: - assert(!is64Bit() && "4-byte relocations only supported on wasm32"); - return ELF::R_WEBASSEMBLY_DATA; - case FK_Data_8: - assert(is64Bit() && "8-byte relocations only supported on wasm64"); - return ELF::R_WEBASSEMBLY_DATA; - default: - llvm_unreachable("unimplemented fixup kind"); - } -} - -std::unique_ptr<MCObjectTargetWriter> -llvm::createWebAssemblyELFObjectWriter(bool Is64Bit, uint8_t OSABI) { - return llvm::make_unique<WebAssemblyELFObjectWriter>(Is64Bit, OSABI); -} |