-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[RISCV] Basic Objdump Mapping Symbol Support #151452
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
lenary
wants to merge
4
commits into
llvm:main
Choose a base branch
from
lenary:pr/riscv-objdump-basic-mapping
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
4 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
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,20 @@ | ||
# RUN: llvm-mc --triple=riscv32-unknown-none-elf %s -filetype=obj -o - \ | ||
# RUN: | llvm-objdump -dr - \ | ||
# RUN: | FileCheck %s | ||
# RUN: llvm-mc --triple=riscv64-unknown-none-elf %s -filetype=obj -o - \ | ||
# RUN: | llvm-objdump -dr - \ | ||
# RUN: | FileCheck %s | ||
|
||
|
||
# CHECK: 00000013 nop | ||
nop | ||
|
||
# CHECK-NEXT: 55 55 55 55 .word 0x55555555 | ||
.word 0x55555555 | ||
|
||
# CHECK-NEXT: 00 00 00 00 .word 0x00000000 | ||
# CHECK-NEXT: R_RISCV_32 foo | ||
.word foo | ||
|
||
# CHECK-NEXT: 00000013 nop | ||
nop |
This file was deleted.
Oops, something went wrong.
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,60 @@ | ||
# RUN: yaml2obj %s -o %t | ||
# RUN: llvm-objdump -d %t | FileCheck %s | ||
|
||
## This CHECKs objdump's handling of wide instruction encodings, and how it | ||
## groups the instruction bytes when disassembling. | ||
## | ||
## This is written in YAML because using `.byte` emits the wrong mapping | ||
## symbols. | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS32 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_RISCV | ||
SectionHeaderStringTable: .strtab | ||
Sections: | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
AddressAlign: 0x1 | ||
ContentArray: [ | ||
# CHECK: 011f 4523 8967 <unknown> | ||
0x1f, 0x01, 0x23, 0x45, 0x67, 0x89, | ||
|
||
# CHECK: 4523013f cdab8967 <unknown> | ||
0x3f, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, | ||
|
||
# CHECK: 007f 4523 8967 cdab feef <unknown> | ||
0x7f, 0x00, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, | ||
|
||
# CHECK: 4523107f cdab8967 badcfeef <unknown> | ||
0x7f, 0x10, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, | ||
|
||
# CHECK: 207f 4523 8967 cdab feef badc 7698 <unknown> | ||
0x7f, 0x20, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, | ||
|
||
# CHECK: 4523307f cdab8967 badcfeef 32547698 <unknown> | ||
0x7f, 0x30, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, | ||
|
||
# CHECK: 407f 4523 8967 cdab feef badc 7698 3254 1210 <unknown> | ||
0x7f, 0x40, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x12, | ||
|
||
# CHECK: 4523507f cdab8967 badcfeef 32547698 56341210 <unknown> | ||
0x7f, 0x50, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x12, 0x34, 0x56, | ||
|
||
# CHECK: 607f 4523 8967 cdab feef badc 7698 3254 1210 5634 9a78 <unknown> | ||
0x7f, 0x60, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x12, 0x34, 0x56, 0x78, 0x9a, | ||
] | ||
|
||
- Type: SectionHeaderTable | ||
Sections: | ||
- Name: .strtab | ||
- Name: .symtab | ||
- Name: .text | ||
Symbols: | ||
- Name: "$x" | ||
Section: .text | ||
Value: 0x0 | ||
... |
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
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.
Minor nit: single blank line, please.
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.
Done