Skip to content

FEAT: Implemented Linux ELF import symbol versioning#5749

Open
qtxie wants to merge 2 commits into
masterfrom
elf-symbol-ver
Open

FEAT: Implemented Linux ELF import symbol versioning#5749
qtxie wants to merge 2 commits into
masterfrom
elf-symbol-ver

Conversation

@qtxie

@qtxie qtxie commented May 29, 2026

Copy link
Copy Markdown
Contributor

Changed:

  • system/compiler.r:1972: parses optional @Version refs, keeps versioned imports distinct, and rejects unsupported targets/static imports.
  • system/formats/ELF.r:71: emits .gnu.version, .gnu.version_r, DT_VERSYM, DT_VERNEED, and DT_VERNEEDNUM for versioned imports.
  • system/linker.r:265: handles block import keys during import cleanup.
  • docs/red-system/red-system-specs.txt:3534: documents [@].
  • system/tests/source/compiler/regression-test-rsc.r:1598: adds compile coverage for memcpy: "memcpy" @GLIBC_2.14 [...].

qtxie added 2 commits May 29, 2026 19:23
Changed:

- system/compiler.r:1972: parses optional @Version refs, keeps versioned imports distinct, and rejects
  unsupported targets/static imports.
- system/formats/ELF.r:71: emits .gnu.version, .gnu.version_r, DT_VERSYM, DT_VERNEED, and DT_VERNEEDNUM for
  versioned imports.
- system/linker.r:265: handles block import keys during import cleanup.
- docs/red-system/red-system-specs.txt:3534: documents [@<version>].
- system/tests/source/compiler/regression-test-rsc.r:1598: adds compile coverage for memcpy: "memcpy"
  @GLIBC_2.14 [...].
size [integer!]
return: [c-string!]
]
memcpy-214: "memcpy" @GLIBC_2.14 [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that work if GLIBC 2.14 is not installed?

Comment thread system/linker.r Outdated
][
pos: skip pos 2
]
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that change?

#import [
"<library>" <convention> [
<function name>: "<ID>" [
<function name>: "<ID>" [@<version>] [

@dockimbel dockimbel May 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a problem with this syntax. [...] can't be used to denote an optional feature when it's already part of the overall syntax.

*The optional symbol version ref is only supported by dynamic Linux ELF
imports. If it is omitted, the platform dynamic linker resolves the default
symbol version exported by the shared library.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description should start by explaning clearly what that option does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants