-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[lld] Add infrastructure for handling RISCV vendor-specific relocations. #159987
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 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fc46315
[lld] Add infrastructure for handling RISCV vendor-specific relocations.
resistor 6a20ab8
Update for review feedback
resistor 1b6be66
Update for review feedback.
resistor a269770
Update test for review feedback
resistor a1bbc93
Update error messages per review feedback.
resistor 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,18 @@ | ||
| # RUN: llvm-mc -triple riscv32 %s -filetype=obj -o %t.o | ||
| # RUN: not ld.lld -pie %t.o -o /dev/null 2>&1 | FileCheck %s | ||
|
|
||
| .option exact | ||
|
|
||
| .global TARGET | ||
| TARGET: | ||
| nop | ||
|
|
||
| .global INVALID_VENDOR | ||
| .reloc 1f, R_RISCV_VENDOR, INVALID_VENDOR+0 | ||
| .reloc 1f, R_RISCV_VENDOR, INVALID_VENDOR+0 | ||
| .reloc 1f, R_RISCV_CUSTOM255, TARGET | ||
| 1: | ||
| nop | ||
|
|
||
| # CHECK: error: {{.*}}:(.text+0x4): malformed consecutive R_RISCV_VENDOR relocations | ||
| # CHECK: error: {{.*}}:(.text+0x4): unknown vendor-specific relocation (255) in vendor namespace "INVALID_VENDOR" against symbol TARGET | ||
resistor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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.
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.
The idea is that, once implemented, we'll override
typein here to become a vendor-specific value (i.e. a value that can differentiate QUALCOMM's CUSTOM192 from e.g. CherIoT's CUSTOM192)?And then those will be mapped back to the conventional RelExpr?
This is not a blocking comment, I'm just trying to understand the next step for someone implementing their relocations.
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.
That's my general idea, but I have not yet implemented it for CHERIoT. It's possible that there ends up being an issue that requires us to pass the vendor string further down.