-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[ARMAsmBackend] Add checks for relocation addends in assembler #109969
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // RUN: not llvm-mc -triple armv7-apple-darwin -filetype=obj %s 2>&1 | FileCheck %s | ||
|
|
||
| // Check that the relocation size is valid. | ||
| // Check lower bound of edge case. | ||
| _foo1_valid: | ||
| // CHECK-NOT: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| b _foo1_valid+0x2000004 | ||
| // Check outside of range of the largest accepted positive number | ||
| _foo1: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| b _foo1+0x2000008 | ||
|
|
||
| // Check Same as above, for smallest negative value | ||
| _foo2_valid: | ||
| // CHECK-NOT: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| b _foo2_valid-0x1FFFFF8 | ||
| _foo2: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| b _foo2-0x1FFFFFC | ||
|
|
||
| // Edge case - subtracting positive number | ||
| _foo3: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| b _foo3-0x2000010 | ||
|
|
||
| // Edge case - adding negative number | ||
| _foo4: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| b _foo4+0x2000008 | ||
|
|
||
| _foo5: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| bl _foo5+0x2000008 | ||
|
|
||
| _foo6: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| blx _foo6+0x2000008 | ||
|
|
||
| // blx instruction is aligned to 16-bits. | ||
| _foo7_blx: | ||
| // CHECK-NOT:[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned | ||
| blx _foo7_blx+0x1FFFFFE | ||
|
|
||
| // Other branch instructions require 32-bit alignment. | ||
| _foo7: | ||
| // CHECK:[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned | ||
| bl _foo7_blx+0x1FFFFFE | ||
|
|
||
| _foo8: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| ble _foo8+0x2000008 | ||
|
|
||
| _foo9: | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range | ||
| beq _foo9+0x2000008 | ||
|
|
||
| // Check that the relocation alignment is valid. | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned | ||
| bl _foo1+0x101 | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned | ||
| blx _foo1+0x101 | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned | ||
| b _foo1+0x101 | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned | ||
| ble _foo1+0x101 | ||
| // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned | ||
| beq _foo1+0x101 | ||
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
Oops, something went wrong.
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.