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

Mach-O check for improperly nested .cfi_* regions doesn't take .alt_entry into account #82261

Closed
Amanieu opened this issue Feb 19, 2024 · 0 comments · Fixed by #82268
Closed
Labels
llvm:asmparser mc Machine (object) code

Comments

@Amanieu
Copy link
Contributor

Amanieu commented Feb 19, 2024

This issue was hit in Amanieu/corosensei#23 where we have code that looks like this:

.globl _stack_init_trampoline
.private_extern _stack_init_trampoline
_stack_init_trampoline:
.cfi_startproc
[...]
.alt_entry _stack_init_trampoline_return
.globl _stack_init_trampoline_return
.private_extern _stack_init_trampoline_return
_stack_init_trampoline_return:
[...]
.cfi_endproc

This currently produces the following error due to https://reviews.llvm.org/D155245:

error: non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairs

However I think (I am not an expert in Mach-O) that this should be valid since the inner label is properly marked with .alt_entry.

cc @jroelofs

@EugeneZelenko EugeneZelenko added llvm:asmparser mc Machine (object) code and removed new issue labels Feb 19, 2024
jroelofs added a commit to jroelofs/llvm-project that referenced this issue Feb 19, 2024
jroelofs added a commit that referenced this issue Feb 28, 2024
A symbol with an `N_ALT_ENTRY` attribute may be defined in the middle of
a subsection, so it is reasonable to opt them out of the
`.cfi_{start,end}proc` nesting check.

Fixes: #82261
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Feb 28, 2024
A symbol with an `N_ALT_ENTRY` attribute may be defined in the middle of
a subsection, so it is reasonable to opt them out of the
`.cfi_{start,end}proc` nesting check.

Fixes: llvm#82261
(cherry picked from commit 5b91647)
ForsakenHarmony pushed a commit to ForsakenHarmony/llvm-project that referenced this issue Feb 29, 2024
A symbol with an `N_ALT_ENTRY` attribute may be defined in the middle of
a subsection, so it is reasonable to opt them out of the
`.cfi_{start,end}proc` nesting check.

Fixes: llvm#82261
(cherry picked from commit 5b91647)
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Mar 11, 2024
A symbol with an `N_ALT_ENTRY` attribute may be defined in the middle of
a subsection, so it is reasonable to opt them out of the
`.cfi_{start,end}proc` nesting check.

Fixes: llvm#82261
(cherry picked from commit 5b91647)
mylai-mtk pushed a commit to mylai-mtk/llvm-project that referenced this issue Jul 12, 2024
A symbol with an `N_ALT_ENTRY` attribute may be defined in the middle of
a subsection, so it is reasonable to opt them out of the
`.cfi_{start,end}proc` nesting check.

Fixes: llvm#82261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:asmparser mc Machine (object) code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants