-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[LLVM][AArch64] Build attributes: Support switching to a defined subsection by name only #154159
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
39 changes: 39 additions & 0 deletions
39
llvm/test/MC/AArch64/build-attributes-asm-aeabi-switch_using_name_only.s
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,39 @@ | ||
| // RUN: llvm-mc -triple=aarch64 %s -o - | FileCheck %s --check-prefix=ASM | ||
| // RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o - | llvm-readelf --hex-dump=.ARM.attributes - | FileCheck %s --check-prefix=ELF | ||
|
|
||
| // ASM: .aeabi_subsection aeabi_pauthabi, required, uleb128 | ||
| // ASM: .aeabi_subsection aeabi_feature_and_bits, optional, uleb128 | ||
| // ASM: .aeabi_attribute 0, 1 // Tag_Feature_BTI | ||
| // ASM: .aeabi_attribute 2, 1 // Tag_PAuth_Schema | ||
| // ASM: .aeabi_attribute 1, 1 // Tag_PAuth_Platform | ||
| // ASM: .aeabi_attribute 2, 1 // Tag_Feature_GCS | ||
| // ASM: .aeabi_attribute 1, 0 // Tag_Feature_PAC | ||
| // ASM: .aeabi_attribute 7, 1 | ||
| // ASM: .aeabi_attribute 7, 0 | ||
|
|
||
| // ELF: Hex dump of section '.ARM.attributes': | ||
| // ELF-NEXT: 0x00000000 411b0000 00616561 62695f70 61757468 A....aeabi_pauth | ||
| // ELF-NEXT: 0x00000010 61626900 00000201 01010700 25000000 abi.........%... | ||
| // ELF-NEXT: 0x00000020 61656162 695f6665 61747572 655f616e aeabi_feature_an | ||
| // ELF-NEXT: 0x00000030 645f6269 74730001 00000102 01010007 d_bits.......... | ||
| // ELF-NEXT: 0x00000040 01 | ||
|
|
||
|
|
||
| .aeabi_subsection aeabi_pauthabi, required, uleb128 | ||
| .aeabi_subsection aeabi_feature_and_bits, optional, uleb128 | ||
| .aeabi_attribute Tag_Feature_BTI, 1 | ||
| .aeabi_subsection aeabi_feature_and_bits | ||
| .aeabi_subsection aeabi_pauthabi | ||
| .aeabi_attribute Tag_PAuth_Schema, 1 | ||
| .aeabi_subsection aeabi_pauthabi | ||
| .aeabi_attribute Tag_PAuth_Platform, 1 | ||
| .aeabi_subsection aeabi_pauthabi | ||
| .aeabi_subsection aeabi_feature_and_bits | ||
| .aeabi_attribute Tag_Feature_GCS, 1 | ||
| .aeabi_subsection aeabi_pauthabi | ||
| .aeabi_subsection aeabi_feature_and_bits | ||
| .aeabi_attribute Tag_Feature_PAC, 0 | ||
| .aeabi_subsection aeabi_feature_and_bits | ||
| .aeabi_attribute 7, 1 | ||
| .aeabi_subsection aeabi_pauthabi | ||
| .aeabi_attribute 7, 0 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can simplify the change by moving the call to SubsectionExists here. This can supply the parameters for
emitAttributesSubsectionso you wouldn't need to change anything in theAArch64TargetStreamer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, comment addressed.