Skip to content

Give patchable relocation globals protected visibility. - #902

Merged
maleadt merged 1 commit into
mainfrom
tb/patch-protected-visibility
Aug 21, 2026
Merged

Give patchable relocation globals protected visibility.#902
maleadt merged 1 commit into
mainfrom
tb/patch-protected-visibility

Conversation

@maleadt

@maleadt maleadt commented Aug 21, 2026

Copy link
Copy Markdown
Member

Julia emits relocation globals dso_local, so backends address them PC-relatively (@rel32 on AMDGPU). :patch lowering defined them as weak ODR with default visibility, which ELF treats as preemptible; lld then rejects the R_AMDGPU_REL32_* relocations in AMDGPU.jl's -shared link ("recompile with -fPIC").

Mark the record globals protected: non-preemptible, consistent with dso_local, yet still in the dynamic symbol table so loaders (CUDA, HIP, ORC) keep resolving them by name. NVPTX ignores visibility, and JITLink/RuntimeDyld export STV_PROTECTED symbols like default ones.

Add a patch option to the GCN test helper and a regression test.

Julia emits relocation globals `dso_local`, so backends address them
PC-relatively (`@rel32` on AMDGPU). `:patch` lowering defined them as
weak ODR with default visibility, which ELF treats as preemptible; lld
then rejects the `R_AMDGPU_REL32_*` relocations in AMDGPU.jl's `-shared`
link ("recompile with -fPIC").

Mark the record globals protected: non-preemptible, consistent with
`dso_local`, yet still in the dynamic symbol table so loaders (CUDA,
HIP, ORC) keep resolving them by name. NVPTX ignores visibility, and
JITLink/RuntimeDyld export STV_PROTECTED symbols like default ones.

Add a `patch` option to the GCN test helper and a regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.02%. Comparing base (410ba6d) to head (2708ed2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #902   +/-   ##
=======================================
  Coverage   84.01%   84.02%           
=======================================
  Files          28       28           
  Lines        5381     5382    +1     
=======================================
+ Hits         4521     4522    +1     
  Misses        860      860           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit 478d08d into main Aug 21, 2026
30 checks passed
@maleadt
maleadt deleted the tb/patch-protected-visibility branch August 21, 2026 19:09
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.

1 participant