#
e4b2f305 |
| 31-Aug-2021 |
Sam Clegg <sbc@chromium.org> |
[WebAssembly][libObject] Avoid re-use of Section object during parsing
The re-use of this struct across iterations of the loop was causing fields (specifically Name) to be incorrectly shared between
[WebAssembly][libObject] Avoid re-use of Section object during parsing
The re-use of this struct across iterations of the loop was causing fields (specifically Name) to be incorrectly shared between multiple sections.
Differential Revision: https://reviews.llvm.org/D108984
show more ...
|
Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init |
|
#
670944fb |
| 15-Jul-2021 |
Wouter van Oortmerssen <aardappel@gmail.com> |
[WebAssembly] Support R_WASM_MEMORY_ADDR_TLS_SLEB64 for wasm64
Also fixed TLS tests swapping addr & value in store op Differential Revision: https://reviews.llvm.org/D106096
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3 |
|
#
1c7b8410 |
| 18-Jun-2021 |
Heejin Ahn <aheejin@gmail.com> |
[WebAssembly] Make tag attribute's encoding uint8
This changes the encoding of the `attribute` field, which currently only contains the value `0` denoting this tag is for an exception, from `varuint
[WebAssembly] Make tag attribute's encoding uint8
This changes the encoding of the `attribute` field, which currently only contains the value `0` denoting this tag is for an exception, from `varuint32` to `uint8`. This field is effectively unused at the moment and reserved for future use, and it is not likely to need `varuint32` even in future. See https://github.com/WebAssembly/exception-handling/pull/162.
This does not change any encoded binaries because `0` is encoded in the same way both in `varuint32` and `uint8`.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D104571
show more ...
|
Revision tags: llvmorg-12.0.1-rc2 |
|
#
1d891d44 |
| 15-Jun-2021 |
Heejin Ahn <aheejin@gmail.com> |
[WebAssembly] Rename event to tag
We recently decided to change 'event' to 'tag', and 'event section' to 'tag section', out of the rationale that the section contains a generalized tag that referenc
[WebAssembly] Rename event to tag
We recently decided to change 'event' to 'tag', and 'event section' to 'tag section', out of the rationale that the section contains a generalized tag that references a type, which may be used for something other than exceptions, and the name 'event' can be confusing in the web context.
See - https://github.com/WebAssembly/exception-handling/issues/159#issuecomment-857910130 - https://github.com/WebAssembly/exception-handling/pull/161
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D104423
show more ...
|
Revision tags: llvmorg-12.0.1-rc1 |
|
#
3a293cbf |
| 22-Apr-2021 |
Wouter van Oortmerssen <aardappel@gmail.com> |
[WebAssembly] Fix PIC/GOT codegen for wasm64
__table_base is know 64-bit, since in LLVM it represents a function pointer offset __table_base32 is a copy in wasm32 for use in elem init expr, since no
[WebAssembly] Fix PIC/GOT codegen for wasm64
__table_base is know 64-bit, since in LLVM it represents a function pointer offset __table_base32 is a copy in wasm32 for use in elem init expr, since no truncation may be used there. New reloc R_WASM_TABLE_INDEX_REL_SLEB64 added
Differential Revision: https://reviews.llvm.org/D101784
show more ...
|
#
cd01430f |
| 11-May-2021 |
Sam Clegg <sbc@chromium.org> |
[lld][WebAssembly] Allow data symbols to extend past end of segment
This fixes a bug with string merging with string symbols that contain NULLs, as is the case in the `merge-string.s` test.
The bug
[lld][WebAssembly] Allow data symbols to extend past end of segment
This fixes a bug with string merging with string symbols that contain NULLs, as is the case in the `merge-string.s` test.
The bug only showed when we run with `--relocatable` and then try read the resulting object back in. In this case we would end up with string symbols that extend past the end of the segment in which they live.
The problem comes from the fact that sections which are flagged as string mergable assume that all strings are NULL terminated. The merging algorithm will drop trailing chars that follow a NULL since they are essentially unreachable. However, the "size" attribute (in the symbol table) of such a truncated symbol is not updated resulting a symbol size that can overlap the end of the segment.
I verified that this can happen in ELF too given the right conditions and the its harmless enough. In practice Strings that contain embedded null should not be part of a mergable section.
Differential Revision: https://reviews.llvm.org/D102281
show more ...
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3 |
|
#
3b8d2be5 |
| 27-Feb-2021 |
Sam Clegg <sbc@chromium.org> |
Reland: "[lld][WebAssembly] Initial support merging string data"
This change was originally landed in: 5000a1b4b9edeb9e994f2a5b36da8d48599bea49 It was reverted in: 061e071d8c9b98526f35cad55a918a4f16
Reland: "[lld][WebAssembly] Initial support merging string data"
This change was originally landed in: 5000a1b4b9edeb9e994f2a5b36da8d48599bea49 It was reverted in: 061e071d8c9b98526f35cad55a918a4f1615afd4
This change adds support for a new WASM_SEG_FLAG_STRINGS flag in the object format which works in a similar fashion to SHF_STRINGS in the ELF world.
Unlike the ELF linker this support is currently limited: - No support for SHF_MERGE (non-string merging) - Always do full tail merging ("lo" can be merged with "hello") - Only support single byte strings (p2align 0)
Like the ELF linker merging is only performed at `-O1` and above.
This fixes part of https://bugs.llvm.org/show_bug.cgi?id=48828, although crucially it doesn't not currently support debug sections because they are not represented by data segments (they are custom sections)
Differential Revision: https://reviews.llvm.org/D97657
show more ...
|
#
061e071d |
| 10-May-2021 |
Nico Weber <thakis@chromium.org> |
Revert "[lld][WebAssembly] Initial support merging string data"
This reverts commit 5000a1b4b9edeb9e994f2a5b36da8d48599bea49. Breaks tests, see https://reviews.llvm.org/D97657#2749151
Easily repros
Revert "[lld][WebAssembly] Initial support merging string data"
This reverts commit 5000a1b4b9edeb9e994f2a5b36da8d48599bea49. Breaks tests, see https://reviews.llvm.org/D97657#2749151
Easily repros locally with `ninja check-llvm-mc-webassembly`.
show more ...
|
#
5000a1b4 |
| 27-Feb-2021 |
Sam Clegg <sbc@chromium.org> |
[lld][WebAssembly] Initial support merging string data
This change adds support for a new WASM_SEG_FLAG_STRINGS flag in the object format which works in a similar fashion to SHF_STRINGS in the ELF w
[lld][WebAssembly] Initial support merging string data
This change adds support for a new WASM_SEG_FLAG_STRINGS flag in the object format which works in a similar fashion to SHF_STRINGS in the ELF world.
Unlike the ELF linker this support is currently limited: - No support for SHF_MERGE (non-string merging) - Always do full tail merging ("lo" can be merged with "hello") - Only support single byte strings (p2align 0)
Like the ELF linker merging is only performed at `-O1` and above.
This fixes part of https://bugs.llvm.org/show_bug.cgi?id=48828, although crucially it doesn't not currently support debug sections because they are not represented by data segments (they are custom sections)
Differential Revision: https://reviews.llvm.org/D97657
show more ...
|
#
73332d73 |
| 01-May-2021 |
Sam Clegg <sbc@chromium.org> |
[lld][WebAssembly] Do not merge comdat data segments
When running in relocatable mode any input data segments that are part of a comdat group should not be merged with other segments of the same nam
[lld][WebAssembly] Do not merge comdat data segments
When running in relocatable mode any input data segments that are part of a comdat group should not be merged with other segments of the same name. This is because the final linker needs to keep the separate so they can be included/excluded individually.
Often this is not a problem since normally only one section with a given name `foo` ends up in the output object file. However, the problem occurs when one input contains `foo` which part of a comdat and another object contains a local symbol `foo` we were attempting to merge them.
This behaviour matches (I believe) that of the ELF linker. See `LinkerScript.cpp:addInputSec`.
Fixes: https://github.com/emscripten-core/emscripten/issues/9726
Differential Revision: https://reviews.llvm.org/D101703
show more ...
|
#
144ec1c3 |
| 30-Mar-2021 |
Heejin Ahn <aheejin@gmail.com> |
[WebAssembly] Encode numbers in ULEB128 in event section
The number of events and the type index should be encoded in ULEB128, but they were incorrctly encoded in LEB128. The smallest number with wh
[WebAssembly] Encode numbers in ULEB128 in event section
The number of events and the type index should be encoded in ULEB128, but they were incorrctly encoded in LEB128. The smallest number with which its LEB128 and ULEB128 encodings are different is 64. There's no way we can generate 64 events in the C++ toolchain implementation so we can't test that, but the attached test tests when the type index is 64.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D99627
show more ...
|
#
9ac5620c |
| 23-Mar-2021 |
Andy Wingo <wingo@igalia.com> |
[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC.
This patch renames the "Initial" member of WasmLimits to the name used in the spec, "Minimum".
In the core WebAssembly specification, th
[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC.
This patch renames the "Initial" member of WasmLimits to the name used in the spec, "Minimum".
In the core WebAssembly specification, the Limits data type has one required "min" member and one optional "max" member, indicating the minimum required size of the corresponding table or memory, and the maximum size, if any.
Although the WebAssembly spec does instantiate locally-defined tables and memories with the initial size being equal to the minimum size, it can't impose such a requirement for imports. It doesn't make sense to require an initial size for a memory import, for example. The compiler can only sensibly express the minimum and maximum sizes.
See https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits for a related discussion that agrees that the right name of "initial" is "minimum" when querying the type of a table or memory from JavaScript. (Of course it still makes sense for JS to speak in terms of an initial size when it explicitly instantiates memories and tables.)
Differential Revision: https://reviews.llvm.org/D99186
show more ...
|
#
aa0c571a |
| 08-Mar-2021 |
Yuta Saito <kateinoigakukun@gmail.com> |
[WebAssembly] Add new relocation for location relative data
This `R_WASM_MEMORY_ADDR_SELFREL_I32` relocation represents an offset between its relocating address and the symbol address. It's very sim
[WebAssembly] Add new relocation for location relative data
This `R_WASM_MEMORY_ADDR_SELFREL_I32` relocation represents an offset between its relocating address and the symbol address. It's very similar to `R_X86_64_PC32` but restricted to be used for only data segments.
``` S + A - P ```
A: Represents the addend used to compute the value of the relocatable field. P: Represents the place of the storage unit being relocated. S: Represents the value of the symbol whose index resides in the relocation entry.
Proposal: https://github.com/WebAssembly/tool-conventions/issues/162
Differential Revision: https://reviews.llvm.org/D96659
show more ...
|
#
a5a3659d |
| 04-Mar-2021 |
Andy Wingo <wingo@igalia.com> |
[WebAssembly][yaml2obj][obj2yaml] Elem sections for nonzero tables
With reference types, tables can have non-zero table numbers. This commit adds support for element sections against these tables.
[WebAssembly][yaml2obj][obj2yaml] Elem sections for nonzero tables
With reference types, tables can have non-zero table numbers. This commit adds support for element sections against these tables.
Differential Revision: https://reviews.llvm.org/D97923
show more ...
|
Revision tags: llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init |
|
#
84c6f325 |
| 22-Jan-2021 |
Sam Clegg <sbc@chromium.org> |
[Object][WebAssembly] Update format of error messages
Error message should start with lowercase in accordance with https://llvm.org/docs/CodingStandards.html#error-and-warning-messages
Differential
[Object][WebAssembly] Update format of error messages
Error message should start with lowercase in accordance with https://llvm.org/docs/CodingStandards.html#error-and-warning-messages
Differential Revision: https://reviews.llvm.org/D95239
show more ...
|
#
d75b3719 |
| 21-Jan-2021 |
Sam Clegg <sbc@chromium.org> |
[WebAssembly] Test that invalid symbol/relocation types generate errors
See https://bugs.llvm.org/show_bug.cgi?id=48827
Differential Revision: https://reviews.llvm.org/D95163
|
Revision tags: llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2 |
|
#
831a143e |
| 30-Nov-2020 |
Andy Wingo <wingo@igalia.com> |
[WebAssembly] Change prefix on data segment flags to WASM_DATA_SEGMENT
Element sections will also need flags, so we shouldn't squat the WASM_SEGMENT namespace.
Depends on D90948.
Differential Revi
[WebAssembly] Change prefix on data segment flags to WASM_DATA_SEGMENT
Element sections will also need flags, so we shouldn't squat the WASM_SEGMENT namespace.
Depends on D90948.
Differential Revision: https://reviews.llvm.org/D92315
show more ...
|
#
53e3b81f |
| 05-Jan-2021 |
Andy Wingo <wingo@igalia.com> |
[lld][WebAssembly] Add support for handling table symbols
This commit adds table symbol support in a partial way, while still including some special cases for the __indirect_function_table symbol. N
[lld][WebAssembly] Add support for handling table symbols
This commit adds table symbol support in a partial way, while still including some special cases for the __indirect_function_table symbol. No change in tests.
Differential Revision: https://reviews.llvm.org/D94075
show more ...
|
#
9a72d3e3 |
| 09-Dec-2020 |
Sam Clegg <sbc@chromium.org> |
[WebAssembly] Add support for named data sections in wasm binaries
Followup to https://reviews.llvm.org/D91769 which added support for names globals.
Differential Revision: https://reviews.llvm.org
[WebAssembly] Add support for named data sections in wasm binaries
Followup to https://reviews.llvm.org/D91769 which added support for names globals.
Differential Revision: https://reviews.llvm.org/D92909
show more ...
|
#
0a391060 |
| 04-Dec-2020 |
Derek Schuff <dschuff@chromium.org> |
[WebAssembly] Add Object and ObjectWriter support for wasm COMDAT sections
Allow sections to be placed into COMDAT groups, in addtion to functions and data segments.
Also make section symbols unnam
[WebAssembly] Add Object and ObjectWriter support for wasm COMDAT sections
Allow sections to be placed into COMDAT groups, in addtion to functions and data segments.
Also make section symbols unnamed, which allows sections with identical names (section names are independent of their section symbols, but previously we gave the symbols the same name as their sections, which results in collisions when sections are identically-named).
Differential Revision: https://reviews.llvm.org/D92691
show more ...
|
Revision tags: llvmorg-11.0.1-rc1 |
|
#
feac819e |
| 25-Nov-2020 |
Andy Wingo <wingo@igalia.com> |
[MC][WebAssembly] Only emit indirect function table import if needed
The indirect function table, synthesized by the linker, is needed if and only if there are TABLE_INDEX relocs.
Differential Revi
[MC][WebAssembly] Only emit indirect function table import if needed
The indirect function table, synthesized by the linker, is needed if and only if there are TABLE_INDEX relocs.
Differential Revision: https://reviews.llvm.org/D91637
show more ...
|
#
1933c9d4 |
| 25-Nov-2020 |
Andy Wingo <wingo@igalia.com> |
[WebAssembly] Factor out WasmTableType in binary format
This commit factors out a WasmTableType definition from WasmTable, as is the case for WasmGlobal and other data types. Also add support for e
[WebAssembly] Factor out WasmTableType in binary format
This commit factors out a WasmTableType definition from WasmTable, as is the case for WasmGlobal and other data types. Also add support for extracting the SymbolName for a table from the linking section's symbol table.
Differential Revision: https://reviews.llvm.org/D91849
show more ...
|
#
1827005c |
| 19-Nov-2020 |
Sam Clegg <sbc@chromium.org> |
[WebAssembly] Add support for named globals in the object format.
Differential Revision: https://reviews.llvm.org/D91769
|
#
2a473db5 |
| 17-Nov-2020 |
Andy Wingo <wingo@igalia.com> |
[WebAssembly] Fix parsing of linking section for named global imports
Differential Revision: https://reviews.llvm.org/D91635
|
#
16f02431 |
| 12-Nov-2020 |
Wouter van Oortmerssen <aardappel@gmail.com> |
[WebAssembly] Added R_WASM_FUNCTION_OFFSET_I64 for use with DWARF DW_AT_low_pc
Needed for wasm64, see discussion in https://reviews.llvm.org/D91203
Differential Revision: https://reviews.llvm.org/D
[WebAssembly] Added R_WASM_FUNCTION_OFFSET_I64 for use with DWARF DW_AT_low_pc
Needed for wasm64, see discussion in https://reviews.llvm.org/D91203
Differential Revision: https://reviews.llvm.org/D91395
show more ...
|