-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[Sframe] Support cfi_escape directives compatibly with gnu-gas #161927
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
Open
Sterling-Augustine
wants to merge
7
commits into
llvm:main
Choose a base branch
from
Sterling-Augustine:sf_cfi_escape
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a7904b2
[Sframe] Support cfi_escape directives compatibly with gnu-gas
Sterling-Augustine 38c3649
Improve test case, fix capitalization.
Sterling-Augustine 4e230d7
Fix comment
Sterling-Augustine 3946b79
Properly handle zero-sized DW_CFA_GNU_args_size
Sterling-Augustine 45f8eee
Fix some typos. Add some comments.
Sterling-Augustine 529700b
Switch assertion because the parser should have failed. Fix comment.
Sterling-Augustine 08df48e
Fix typo
Sterling-Augustine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# RUN: llvm-mc --filetype=obj --gsframe -triple x86_64 %s -o %t.o 2>&1 | FileCheck %s | ||
# RUN: llvm-readelf --sframe %t.o | FileCheck %s --check-prefix=NOFDES | ||
|
||
# Tests that .cfi_escape sequences that are unrepresentable in sframe warn | ||
# and do not produce FDEs. | ||
|
||
.align 1024 | ||
cfi_escape_sp: | ||
.cfi_startproc | ||
.long 0 | ||
# Setting SP via other registers makes it unrepresentable in sframe | ||
# DW_CFA_expression,reg 0x7,length 2,DW_OP_breg6,SLEB(-8) | ||
# CHECK: skipping SFrame FDE; .cfi_escape DW_CFA_expression with SP reg 7 | ||
.cfi_escape 0x10, 0x7, 0x2, 0x76, 0x78 | ||
.long 0 | ||
.cfi_endproc | ||
|
||
cfi_escape_args_sp: | ||
.cfi_startproc | ||
.long 0 | ||
# DW_CFA_GNU_args_size is not OK if cfa is SP | ||
# CHECK: skipping SFrame FDE; .cfi_escape DW_CFA_GNU_args_size with non frame-pointer CFA | ||
.cfi_escape 0x2e, 0x20 | ||
.cfi_endproc | ||
|
||
cfi_escape_val_offset: | ||
.cfi_startproc | ||
.long 0 | ||
.cfi_def_cfa_offset 16 | ||
# DW_CFA_val_offset,rbp,ULEB scaled offset(16) | ||
# CHECK: skipping SFrame FDE; .cfi_escape DW_CFA_val_offset with FP reg 6 | ||
.cfi_escape 0x14,0x6,0x2 | ||
.long 0 | ||
.cfi_endproc | ||
|
||
|
||
# NOFDES: Num FDEs: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# RUN: llvm-mc --filetype=obj --gsframe -triple x86_64 %s -o %t.o | ||
# RUN: llvm-readelf --sframe %t.o | FileCheck %s | ||
|
||
# Tests that .cfi_escape sequences that are ok to pass through work. | ||
|
||
.align 1024 | ||
cfi_escape_ok: | ||
.cfi_startproc | ||
.long 0 | ||
.cfi_def_cfa_offset 16 | ||
# Uninteresting register | ||
# DW_CFA_expression,reg 0xc,length 2,DW_OP_breg6,SLEB(-8) | ||
.cfi_escape 0x10,0xc,0x2,0x76,0x78 | ||
# DW_CFA_nop | ||
.cfi_escape 0x0 | ||
.cfi_escape 0x0,0x0,0x0,0x0 | ||
# Uninteresting register | ||
# DW_CFA_val_offset,reg 0xc,ULEB scaled offset | ||
.cfi_escape 0x14,0xc,0x4 | ||
.long 0 | ||
.cfi_endproc | ||
|
||
cfi_escape_gnu_args_fp: | ||
.cfi_startproc | ||
.long 0 | ||
# DW_CFA_GNU_args_size is OK if arg size is zero | ||
.cfi_escape 0x2e, 0x0 | ||
.long 0 | ||
.cfi_def_cfa_register 6 | ||
.long 0 | ||
# DW_CFA_GNU_args_size is OK if cfa is FP | ||
.cfi_escape 0x2e, 0x20 | ||
.cfi_endproc | ||
|
||
cfi_escape_long_expr: | ||
.cfi_startproc | ||
.long 0 | ||
.cfi_def_cfa_offset 16 | ||
# This is a long, but valid, dwarf expression without sframe | ||
# implications. An FDE can still be created. | ||
# DW_CFA_val_offset,rcx,ULEB scaled offset(16), DW_CFA_expr,r10,length,DW_OP_deref,SLEB(-8) | ||
.cfi_escape 0x14,0x2,0x2,0x10,0xa,0x2,0x76,0x78 | ||
.long 0 | ||
.cfi_endproc | ||
|
||
# CHECK: Num FDEs: 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.