llvm-c166/lld/docs
Derek Schuff de5e538331
[WebAssembly] Implement support for Common symbols (#199303)
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
2026-08-21 22:03:44 +00:00
..
_static
_templates
ELF [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
llvm-theme
MachO [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
CMakeLists.txt
conf.py [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
DTLTO.md [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
error_handling_script.md [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
hello.png
index.md [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
ld.lld.1 [ELF] --retain-symbols-file: keep listed symbols in .symtab, not .dynsym (#209063) 2026-07-14 07:08:29 +00:00
make.bat
missingkeyfunction.md [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
NewLLD.md [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
README.txt
ReleaseNotes.md [WebAssembly] Implement support for Common symbols (#199303) 2026-08-21 22:03:44 +00:00
ReleaseNotesTemplate.txt
WebAssembly.md [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00
windows_support.md [docs] Rewrite LLD docs to Markdown (#209897) 2026-07-16 20:21:17 +00:00

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.