summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-12-12 23:40:58 +0000
committerSam Clegg <sbc@chromium.org>2018-12-12 23:40:58 +0000
commit03801256d86eb0d22dc7d489ed4ec0eec9ace6b6 (patch)
tree8dff16dade50cba59768a25aea61e4c691d7832b /llvm/lib/Object/WasmObjectFile.cpp
parent744c3c327fbaa3548c4af62694e7c3eeca8b4f6f (diff)
downloadbcm5719-llvm-03801256d86eb0d22dc7d489ed4ec0eec9ace6b6.tar.gz
bcm5719-llvm-03801256d86eb0d22dc7d489ed4ec0eec9ace6b6.zip
[WebAssembly] Update dylink section parsing
This updates the format of the dylink section in accordance with recent "spec" change: https://github.com/WebAssembly/tool-conventions/pull/77 Differential Revision: https://reviews.llvm.org/D55609 llvm-svn: 348989
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index 895d45c470f..1a687d94d7f 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -319,6 +319,10 @@ Error WasmObjectFile::parseDylinkSection(ReadContext &Ctx) {
DylinkInfo.MemoryAlignment = readVaruint32(Ctx);
DylinkInfo.TableSize = readVaruint32(Ctx);
DylinkInfo.TableAlignment = readVaruint32(Ctx);
+ uint32_t Count = readVaruint32(Ctx);
+ while (Count--) {
+ DylinkInfo.Needed.push_back(readString(Ctx));
+ }
if (Ctx.Ptr != Ctx.End)
return make_error<GenericBinaryError>("dylink section ended prematurely",
object_error::parse_failed);
@@ -1405,6 +1409,8 @@ SubtargetFeatures WasmObjectFile::getFeatures() const {
bool WasmObjectFile::isRelocatableObject() const { return HasLinkingSection; }
+bool WasmObjectFile::isSharedObject() const { return HasDylinkSection; }
+
const WasmSection &WasmObjectFile::getWasmSection(DataRefImpl Ref) const {
assert(Ref.d.a < Sections.size());
return Sections[Ref.d.a];
OpenPOWER on IntegriCloud