diff options
author | Sam Clegg <sbc@chromium.org> | 2018-12-12 23:40:58 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2018-12-12 23:40:58 +0000 |
commit | 03801256d86eb0d22dc7d489ed4ec0eec9ace6b6 (patch) | |
tree | 8dff16dade50cba59768a25aea61e4c691d7832b /llvm/lib/Object/WasmObjectFile.cpp | |
parent | 744c3c327fbaa3548c4af62694e7c3eeca8b4f6f (diff) | |
download | bcm5719-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.cpp | 6 |
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]; |