diff options
author | Sam Clegg <sbc@chromium.org> | 2021-08-31 10:28:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 10:28:18 -0700 |
commit | 41fff9e2284e9be6e8a99da05beda54f398b0305 (patch) | |
tree | ef301fe3e18d562e36d5367f46bd205fd6716736 /test | |
parent | 9bb771d06843390443f82877ad58d5a7108bb623 (diff) | |
download | binaryen-41fff9e2284e9be6e8a99da05beda54f398b0305.tar.gz binaryen-41fff9e2284e9be6e8a99da05beda54f398b0305.tar.bz2 binaryen-41fff9e2284e9be6e8a99da05beda54f398b0305.zip |
Handle extra info in dylink section (#4112)
If extra data is found in this section simply propagate it.
Also, remove some dead code from wasm-binary.cpp.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/binary/dylink.test | 15 | ||||
-rwxr-xr-x | test/lit/binary/dylink.test.wasm | bin | 0 -> 37 bytes | |||
-rw-r--r-- | test/lit/lit.cfg.py | 2 |
3 files changed, 17 insertions, 0 deletions
diff --git a/test/lit/binary/dylink.test b/test/lit/binary/dylink.test new file mode 100644 index 000000000..72341c9ba --- /dev/null +++ b/test/lit/binary/dylink.test @@ -0,0 +1,15 @@ +# Verify that extra bytes in the dylink section are preserved. +# +# `dylink.test.wasm` was generated using emscripten to build a side +# module with two TLS exports (which adds extra information to the +# dylink section) using: +# `emcc -s SIDE_MODULE side.c` +# +# side.c: +# _Thread_local int foo = 10; +# _Thread_local int bar = 11; +# +# and then removing all sections except the dylink section using: +# `llvm-objcopy --only-section=dylink` +RUN: wasm-opt -O1 %s.wasm -o %t.o +RUN: cmp %s.wasm %t.o diff --git a/test/lit/binary/dylink.test.wasm b/test/lit/binary/dylink.test.wasm Binary files differnew file mode 100755 index 000000000..401028d96 --- /dev/null +++ b/test/lit/binary/dylink.test.wasm diff --git a/test/lit/lit.cfg.py b/test/lit/lit.cfg.py index 23b0c3de6..ac89a5991 100644 --- a/test/lit/lit.cfg.py +++ b/test/lit/lit.cfg.py @@ -10,6 +10,8 @@ config.test_exec_root = os.path.join(config.binaryen_build_root, 'test') # Replace all Binaryen tools with their absolute paths bin_dir = os.path.join(config.binaryen_build_root, 'bin') +assert(os.path.isdir(bin_dir)) + for tool_file in os.listdir(bin_dir): tool_path = config.binaryen_build_root + '/bin/' + tool_file tool = tool_file[:-4] if tool_file.endswith('.exe') else tool_file |