Skip to content

[wasm-ld] lazy archive custom Wasm sections not included #200083

@guybedford

Description

@guybedford

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lld:wasmquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions