Experimenting with some custom link sections in Rust for Wasm I hit a bug with dependency sections marked with:
#[link_section = "__custom_section"]
static DATA: [u8; 4] = [1,2,3,4];
works for most cases, but when in a codegen unit of a dependency that otherwise doesn't contribute symbols to link, it is possible for the custom section to be ignored, and for the section not to be included when expected.
The problem seems to stem from lld's archive extraction being purely symbol-driven: a lazy archive member with one of these custom sections is never extracted.
Likely related to #172023.
Experimenting with some custom link sections in Rust for Wasm I hit a bug with dependency sections marked with:
works for most cases, but when in a codegen unit of a dependency that otherwise doesn't contribute symbols to link, it is possible for the custom section to be ignored, and for the section not to be included when expected.
The problem seems to stem from lld's archive extraction being purely symbol-driven: a lazy archive member with one of these custom sections is never extracted.
Likely related to #172023.