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

[lld] Error on unsupported split stack #88063

Merged
merged 2 commits into from
May 4, 2024

Conversation

patrick-rivos
Copy link
Contributor

@patrick-rivos patrick-rivos commented Apr 8, 2024

Targets with no -fstack-split support now emit ld.lld: error: target doesn't support split stacks instead of UNREACHABLE executed with a backtrace asking the user to report a bug.

Resolves #88061

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2024

@llvm/pr-subscribers-lld-elf

Author: Patrick O'Neill (patrick-rivos)

Changes

Targets with no -fstack-split support now emit ld.lld: error: Target doesn't support split stacks. instead of UNREACHABLE executed with a backtrace asking the user to report a bug.

Resolves #88061


Full diff: https://github.com/llvm/llvm-project/pull/88063.diff

1 Files Affected:

  • (modified) lld/ELF/Target.cpp (+1-1)
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index d879a427e9c096..735b2a82d851b4 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -141,7 +141,7 @@ bool TargetInfo::needsThunk(RelExpr expr, RelType type, const InputFile *file,
 
 bool TargetInfo::adjustPrologueForCrossSplitStack(uint8_t *loc, uint8_t *end,
                                                   uint8_t stOther) const {
-  llvm_unreachable("Target doesn't support split stacks.");
+  fatal("Target doesn't support split stacks.");
 }
 
 bool TargetInfo::inBranchRange(RelType type, uint64_t src, uint64_t dst) const {

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2024

@llvm/pr-subscribers-lld

Author: Patrick O'Neill (patrick-rivos)

Changes

Targets with no -fstack-split support now emit ld.lld: error: Target doesn't support split stacks. instead of UNREACHABLE executed with a backtrace asking the user to report a bug.

Resolves #88061


Full diff: https://github.com/llvm/llvm-project/pull/88063.diff

1 Files Affected:

  • (modified) lld/ELF/Target.cpp (+1-1)
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index d879a427e9c096..735b2a82d851b4 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -141,7 +141,7 @@ bool TargetInfo::needsThunk(RelExpr expr, RelType type, const InputFile *file,
 
 bool TargetInfo::adjustPrologueForCrossSplitStack(uint8_t *loc, uint8_t *end,
                                                   uint8_t stOther) const {
-  llvm_unreachable("Target doesn't support split stacks.");
+  fatal("Target doesn't support split stacks.");
 }
 
 bool TargetInfo::inBranchRange(RelType type, uint64_t src, uint64_t dst) const {

Copy link

github-actions bot commented Apr 8, 2024

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

@MaskRay
Copy link
Member

MaskRay commented Apr 8, 2024

Test?

@patrick-rivos
Copy link
Contributor Author

Will do - I'm not familiar with stack splitting/how to write a concise testcase that triggers it so it might take me some time.

Targets with no `-fstack-split` support now emit `ld.lld: error: Target doesn't support split stacks.` instead of `UNREACHABLE executed` with a backtrace asking the user to report a bug.

Resolves llvm#88061
@patrick-rivos
Copy link
Contributor Author

Added testcase and force-pushed to get rid of the github email address from the commit.

@patrick-rivos
Copy link
Contributor Author

Ping.

lld/ELF/Target.cpp Outdated Show resolved Hide resolved
@patrick-rivos
Copy link
Contributor Author

Thanks for the review!
I don't have write permission. Could you land these changes for me?

@MaskRay MaskRay merged commit 96aac67 into llvm:main May 4, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LLD] Unreachable executed with -fsplit-stack
3 participants