Commit 9fdc38c
authored
[WebAssembly][Object] Support more elem segment flags (llvm#123427)
Some tools (e.g. Rust tooling) produce element segment descriptors with
neither
elemkind or element type descriptors, but with init exprs instead of
func indices
(this is with the flags value of 4 in
https://webassembly.github.io/spec/core/binary/modules.html#element-section).
LLVM doesn't fully model reference types or the various ways to
initialize element
segments, but we do want to correctly parse and skip over all type
sections, so
this change updates the object parser to handle that case, and refactors
for more
clarity.
The test file is updated to include one additional elem segment with a
flags value
of 4, an initializer value of (32.const 0) and an empty vector.
Also support parsing files that export imported (undefined) functions.1 parent 87e4b68 commit 9fdc38c
File tree
7 files changed
+36
-19
lines changed- lld/wasm
- llvm
- include/llvm/BinaryFormat
- lib
- MC
- ObjectYAML
- Object
- test/Object/Inputs/WASM
7 files changed
+36
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
597 | | - | |
| 597 | + | |
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
418 | 422 | | |
419 | 423 | | |
420 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
1022 | | - | |
| 1022 | + | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | 1025 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
1443 | | - | |
| 1443 | + | |
1444 | 1444 | | |
1445 | 1445 | | |
1446 | | - | |
1447 | 1446 | | |
1448 | 1447 | | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1452 | 1457 | | |
1453 | 1458 | | |
1454 | 1459 | | |
| |||
1645 | 1650 | | |
1646 | 1651 | | |
1647 | 1652 | | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
1651 | 1661 | | |
1652 | | - | |
| 1662 | + | |
1653 | 1663 | | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
1654 | 1670 | | |
1655 | 1671 | | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | 1672 | | |
1660 | 1673 | | |
1661 | 1674 | | |
| |||
1666 | 1679 | | |
1667 | 1680 | | |
1668 | 1681 | | |
1669 | | - | |
| 1682 | + | |
1670 | 1683 | | |
1671 | 1684 | | |
1672 | 1685 | | |
| |||
1692 | 1705 | | |
1693 | 1706 | | |
1694 | 1707 | | |
1695 | | - | |
| 1708 | + | |
1696 | 1709 | | |
1697 | 1710 | | |
1698 | 1711 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
| 500 | + | |
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
Binary file not shown.
0 commit comments