-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[XCOFF] Display branch-absolute targets in hex. #72532
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
8 commits
Select commit
Hold shift + click to select a range
eefa464
Display branch-absolute targets in hex.
stephenpeckham 0af8513
Fix ELF testcase
stephenpeckham 93096eb
Fix additional ELF tests
stephenpeckham 6fdbc8f
Updated test
stephenpeckham d59c994
Update branch-absolute tests
stephenpeckham 3294c7d
Use cast to convert to 32-bit value
stephenpeckham e443364
Use yaml2obj instead of raw object files
stephenpeckham 76aab8a
Update testcase to use yaml2obj
stephenpeckham 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
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# RUN: llvm-mc -triple powerpc-unknown-unknown --show-encoding %s | FileCheck %s | ||
|
||
# Check that large immediates in 32bit mode are accepted. | ||
# Check that large and/or negative immediates in 32-bit mode are accepted. | ||
|
||
# CHECK: ba -33554432 # encoding: [0x4a,0x00,0x00,0x02] | ||
# CHECK: ba 0xfe000000 # encoding: [0x4a,0x00,0x00,0x02] | ||
# CHECK-NEXT: ba 0xfe000000 # encoding: [0x4a,0x00,0x00,0x02] | ||
# CHECK-NEXT: ba 0xfffffc00 # encoding: [0x4b,0xff,0xfc,0x02] | ||
ba 0xfe000000 | ||
ba (-33554432) | ||
ba (-1024) |
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
158 changes: 158 additions & 0 deletions
158
llvm/test/tools/llvm-objdump/XCOFF/disassemble-abs.test
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,158 @@ | ||
## Object files assembled on AIX from the following source: | ||
## .csect [PR] | ||
##.main: | ||
## .globl .main | ||
## .extern .function | ||
## bla .function | ||
## btla .function | ||
## ba 0x1234 | ||
## ba -32 | ||
## bta 0x2348 | ||
## bta -256 | ||
# | ||
# RUN: yaml2obj %s --docnum=1 -o %t32.o | ||
# RUN: llvm-objdump -d %t32.o | FileCheck %s | ||
# | ||
# CHECK: : file format aixcoff-rs6000 | ||
# CHECK: Disassembly of section .text: | ||
# CHECK: 00000000 <.main>: | ||
# CHECK: 0: 48 00 00 03 bla 0x0 | ||
# CHECK-NEXT: 4: 41 80 00 03 btla 0, 0x0 | ||
# CHECK-NEXT: 8: 48 00 12 36 ba 0x1234 | ||
# CHECK-NEXT: c: 4b ff ff e2 ba 0xffffffe0 | ||
# CHECK-NEXT: 10: 41 80 23 4a bta 0, 0x2348 | ||
# CHECK-NEXT: 14: 41 80 ff 02 bta 0, 0xffffff00 | ||
|
||
--- !XCOFF | ||
FileHeader: | ||
MagicNumber: 0x1DF | ||
NumberOfSections: 1 | ||
CreationTime: 1700148622 | ||
OffsetToSymbolTable: 0x68 | ||
EntriesInSymbolTable: 8 | ||
AuxiliaryHeaderSize: 0 | ||
Flags: 0x0 | ||
Sections: | ||
- Name: .text | ||
Address: 0x0 | ||
Size: 0x18 | ||
FileOffsetToData: 0x3C | ||
FileOffsetToRelocations: 0x54 | ||
FileOffsetToLineNumbers: 0x0 | ||
NumberOfRelocations: 0x2 | ||
NumberOfLineNumbers: 0x0 | ||
Flags: [ STYP_TEXT ] | ||
SectionData: 4800000341800003480012364BFFFFE24180234A4180FF02 | ||
Relocations: | ||
- Address: 0x0 | ||
Symbol: 0x2 | ||
Info: 0x99 | ||
Type: 0x18 | ||
- Address: 0x6 | ||
Symbol: 0x2 | ||
Info: 0x8F | ||
Type: 0x18 | ||
Symbols: | ||
- Name: .file | ||
Value: 0x0 | ||
Section: N_DEBUG | ||
Type: 0xC03 | ||
StorageClass: C_FILE | ||
NumberOfAuxEntries: 1 | ||
- Name: .function | ||
Value: 0x0 | ||
Section: N_UNDEF | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
- Name: '' | ||
Value: 0x0 | ||
Section: .text | ||
Type: 0x0 | ||
StorageClass: C_HIDEXT | ||
NumberOfAuxEntries: 1 | ||
- Name: .main | ||
Value: 0x0 | ||
Section: .text | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
StringTable: {} | ||
... | ||
|
||
# RUN: yaml2obj %s --docnum=2 -o %t64.o | ||
# RUN: llvm-objdump -d %t64.o | FileCheck --check-prefixes=CHECK64 %s | ||
# | ||
|
||
# CHECK64: : file format aix5coff64-rs6000 | ||
# CHECK64: Disassembly of section .text: | ||
# CHECK64: 0000000000000000 <.main>: | ||
# CHECK64-NEXT: 0: 48 00 00 03 bla 0x0 | ||
# CHECK64-NEXT: 4: 41 80 00 03 btla 0, 0x0 | ||
# CHECK64-NEXT: 8: 48 00 12 36 ba 0x1234 | ||
# CHECK64-NEXT: c: 4b ff ff e2 ba 0xffffffffffffffe0 | ||
# CHECK64-NEXT: 10: 41 80 23 4a bta 0, 0x2348 | ||
# CHECK64-NEXT: 14: 41 80 ff 02 bta 0, 0xffffffffffffff00 | ||
# | ||
--- !XCOFF | ||
FileHeader: | ||
MagicNumber: 0x1F7 | ||
NumberOfSections: 1 | ||
CreationTime: 1701859282 | ||
AuxiliaryHeaderSize: 0 | ||
Flags: 0x0 | ||
Sections: | ||
- Name: .text | ||
Address: 0x0 | ||
Size: 0x18 | ||
FileOffsetToData: 0x60 | ||
FileOffsetToRelocations: 0x78 | ||
FileOffsetToLineNumbers: 0x0 | ||
NumberOfRelocations: 0x2 | ||
NumberOfLineNumbers: 0x0 | ||
Flags: [ STYP_TEXT ] | ||
SectionData: 4800000341800003480012364BFFFFE24180234A4180FF02 | ||
Relocations: | ||
- Address: 0x0 | ||
Symbol: 0x1 | ||
Info: 0x99 | ||
Type: 0x18 | ||
- Address: 0x6 | ||
Symbol: 0x1 | ||
Info: 0x8F | ||
Type: 0x18 | ||
Symbols: | ||
- Name: .file | ||
Section: N_DEBUG | ||
StorageClass: C_FILE | ||
NumberOfAuxEntries: 0 | ||
- Name: .function | ||
Section: N_UNDEF | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
StorageMappingClass: XMC_PR | ||
SymbolAlignmentAndType: 0 | ||
- Name: '' | ||
Section: .text | ||
StorageClass: C_HIDEXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
StorageMappingClass: XMC_PR | ||
SymbolAlignmentAndType: 1 | ||
- Name: .main | ||
Section: .text | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
StorageMappingClass: XMC_PR | ||
SymbolAlignmentAndType: 2 | ||
StringTable: | ||
Strings: | ||
- .file | ||
- .function | ||
- .text | ||
- .main |
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.
This seems like a bug related to branch instruction decode?
Normally we need another patch to fix this as the fix here is not same with this patch's purpose.
Since this change is quite small, let's put them together.