mirror of
https://github.com/siemens-mobile-hacks/llvm-c166.git
synced 2026-11-25 21:45:57 +00:00
This patch adds end-to-end support for common symbols (`.comm` /
`-fcommon`)
for the WebAssembly target in LLVM and LLD.
1. Object File and binary format:
- Introduce the `WASM_SYMBOL_BINDING_COMMON` (0x40) symbol flag in
`Wasm.h`.
- Update `WasmObjectWriter` and `WasmObjectFile` to serialize and parse
common
symbol metadata (size and alignment) in the linking symbol table.
- Update YAML tooling and `llvm-readobj` to handle common symbols.
2. LLD Support:
- Introduce `CommonSymbol` representing common data symbols.
- Implement common symbol resolution in `SymbolTable::addCommon`:
- Multiple common symbols are merged by selecting the maximum size and
alignment.
- Strong defined symbols override common symbols.
- Common symbols override weak symbols and undefined references.
- For non-relocatable links, allocate common symbols into a synthetic
`.bss.common` segment.
- For relocatable links (`-r`), preserve merged common symbols as
`WASM_SYMBOL_BINDING_COMMON`
in the output linking symbol table with their updated size and
alignment.
The format is documented in
https://github.com/WebAssembly/tool-conventions/pull/267
Fixes: #196641
Assisted-by: Antigravity
|
||
|---|---|---|
| .. | ||
| _static | ||
| _templates | ||
| ELF | ||
| llvm-theme | ||
| MachO | ||
| CMakeLists.txt | ||
| conf.py | ||
| DTLTO.md | ||
| error_handling_script.md | ||
| hello.png | ||
| index.md | ||
| ld.lld.1 | ||
| make.bat | ||
| missingkeyfunction.md | ||
| NewLLD.md | ||
| README.txt | ||
| ReleaseNotes.md | ||
| ReleaseNotesTemplate.txt | ||
| WebAssembly.md | ||
| windows_support.md | ||
lld Documentation ================= The lld documentation is written using the Sphinx documentation generator. It is currently tested with Sphinx 1.1.3. We currently use the 'nature' theme and a Beaker inspired structure. See sphinx_intro.rst for more details.