diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-01-12 20:56:01 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-01-12 20:56:01 +0000 |
commit | 4635017176efff6bf4b618d6f2ee822d0a7e52db (patch) | |
tree | c394a32bbc8e72a4a210918edb63d8c21920e92e /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 45c7439d11214d8b1a80edd9308537bb2d48c0e7 (diff) | |
download | bcm5719-llvm-4635017176efff6bf4b618d6f2ee822d0a7e52db.tar.gz bcm5719-llvm-4635017176efff6bf4b618d6f2ee822d0a7e52db.zip |
[WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.
A request has been made to the official registry, but an official value is
not yet available. This patch uses a temporary value in order to support
development. When an official value is recieved, the value of EM_WEBASSEMBLY
will be updated.
llvm-svn: 257517
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 22167c78890..94022693cc2 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -482,6 +482,23 @@ static std::error_code getRelocationValueString(const ELFObjectFile<ELFT> *Obj, case ELF::EM_MIPS: res = Target; break; + case ELF::EM_WEBASSEMBLY: + switch (type) { + case ELF::R_WEBASSEMBLY_DATA: { + std::string fmtbuf; + raw_string_ostream fmt(fmtbuf); + fmt << Target << (addend < 0 ? "" : "+") << addend; + fmt.flush(); + Result.append(fmtbuf.begin(), fmtbuf.end()); + break; + } + case ELF::R_WEBASSEMBLY_FUNCTION: + res = Target; + break; + default: + res = "Unknown"; + } + break; default: res = "Unknown"; } |