Skip to content

specs: document ELF note-merging semantics for dlopen and package metadata - #222

Open
xnox wants to merge 2 commits into
uapi-group:mainfrom
xnox:elf-notes-merging
Open

specs: document ELF note-merging semantics for dlopen and package metadata#222
xnox wants to merge 2 commits into
uapi-group:mainfrom
xnox:elf-notes-merging

Conversation

@xnox

@xnox xnox commented Jul 7, 2026

Copy link
Copy Markdown

Linkers concatenate same-named sections from multiple input files, so a
linked binary can carry multiple .note.dlopen or .note.package notes even
when each producer emitted only one. Parsers must therefore iterate over
one or more Note structures rather than assuming a single note.

Add a "Guidance on parsing ELF sections" section to both specs describing
this, with a readelf example. Make the two specs share the same parsing
procedure: this behavior is forced by the ELF spec and by the binutils ld
and LLVM lld implementations, and was already the long-standing status quo
for dlopen metadata (one note per dependency or one combined note), so the
package metadata spec now inherits it.

For package metadata, note the SCA/SBOM/vulnerability-matching implication:
multiple notes indicate a likely statically linked binary composed from
several packages, all of which must be enumerated.

…adata

Linkers concatenate same-named sections from multiple input files, so a
linked binary can carry multiple .note.dlopen or .note.package notes even
when each producer emitted only one. Parsers must therefore iterate over
one or more Note structures rather than assuming a single note.

Add a "Guidance on parsing ELF sections" section to both specs describing
this, with a readelf example. Make the two specs share the same parsing
procedure: this behavior is forced by the ELF spec and by the binutils ld
and LLVM lld implementations, and was already the long-standing status quo
for dlopen metadata (one note per dependency or one combined note), so the
package metadata spec now inherits it.

For package metadata, note the SCA/SBOM/vulnerability-matching implication:
multiple notes indicate a likely statically linked binary composed from
several packages, all of which must be enumerated.
Comment thread specs/package_metadata_for_executable_files.md Outdated
Comment thread specs/elf_dlopen_metadata.md Outdated
@poettering

Copy link
Copy Markdown
Collaborator

lgtm, but be more precise regarding the padding/alignment, as suggested

@xnox
xnox requested a review from poettering July 23, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants