Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cranelift: AArch64 backend uses absolute relocations instead of GOT-relative relocations when using is_pic #5544

Closed
Tracked by #1248
bjorn3 opened this issue Jan 7, 2023 · 0 comments · Fixed by #5550
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Jan 7, 2023

.clif Test Case

Any code which uses global_value or a call to a function not marked as colocated.

Steps to Reproduce

  • Compile with is_pic for AArch64

Expected Results

Object file has a GOT relocation and loads the address from the GOT.

Actual Results

Object file has an absolute relocation in a text section. This causes the dynamic linker to crash on macOS as the text segment is read-only.

Versions and Environment

Cranelift version or commit: 4491382

Operating system: macOS

Architecture: AArch64

Extra Info

Likely the root cause of https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/Tricks.20with.20linkage.20internal.20.2F.20module.20external.20functions.3F

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant