Skip to content

Make version script pattern matching GNU-compatible#1151

Open
parth-07 wants to merge 1 commit into
qualcomm:mainfrom
parth-07:VersionScriptPatternMatching
Open

Make version script pattern matching GNU-compatible#1151
parth-07 wants to merge 1 commit into
qualcomm:mainfrom
parth-07:VersionScriptPatternMatching

Conversation

@parth-07
Copy link
Copy Markdown
Contributor

@parth-07 parth-07 commented May 8, 2026

This commit makes version script pattern matching GNU-compatible. Uptil now, eld version script pattern matching was very intuitive, and straightforward. Iterate the version nodes and blocks in order and match them with the global symbols, and the first match wins. However, GNU version script pattern matching are a little complex. The updated version script pattern matching follows the below rules:

  1. Phase 1: Iterate the version nodes and blocks in order, match symbols
    with the non-wildcard patterns. The first match wins.
  2. Phase 2: Iterate the version nodes and blocks in order, match
    unmatched symbols with the non-* wildcard patterns. The last match wins.
  3. Phase 3: Iterate the version nodes and blocks in order, match
    unmatched symbols with the '*' wildcard pattern. The last match wins.

Resolves #1132

@parth-07 parth-07 force-pushed the VersionScriptPatternMatching branch 2 times, most recently from c4d2c69 to 5c4474a Compare May 8, 2026 10:19
Comment thread include/eld/Diagnostics/DiagDynamicLink.inc Outdated
Comment thread include/eld/Diagnostics/DiagDynamicLink.inc Outdated
@parth-07 parth-07 force-pushed the VersionScriptPatternMatching branch 2 times, most recently from b121455 to 437c734 Compare May 12, 2026 09:44
This commit makes version script pattern matching GNU-compatible.
Uptil now, eld version script pattern matching was very intuitive,
and straightforward. Iterate the version nodes and blocks in order and
match them with the global symbols, and the first match wins. However,
GNU version script pattern matching rules are a little complex. The updated
GNU-compatible version script pattern matching follows the below rules:

1) Phase 1: Iterate the version nodes and blocks in order, match symbols
   with the non-wildcard patterns. The first match wins.
2) Phase 2: Iterate the version nodes and blocks in order, match
   unmatched symbols with the non-* wildcard patterns. The last match wins.
3) Phase 3: Iterate the version nodes and blocks in order, match
   unmatched symbols with the '*' wildcard pattern. The last match wins.

Resolves qualcomm#1132

Signed-off-by: Parth Arora <partaror@qti.qualcomm.com>
@quic-seaswara quic-seaswara force-pushed the VersionScriptPatternMatching branch from 437c734 to 39530bb Compare May 12, 2026 23:34
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.

Version script symbol descriptions matching needs to be improved

2 participants