-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[yaml2obj][XOFF] Update yaml2obj for XCOFF to create valid XCOFF files in more cases. #77620
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 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
97f907f
Update yaml for XCOFF to create valid XCOFF files in more cases.
stephenpeckham 4f94966
Update formatting
stephenpeckham f54af06
Clean up code; add testcase
stephenpeckham b3ff586
Updated based on review comments
stephenpeckham 5fbf95a
Undo optional on AuxHeaderSize
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
Large diffs are not rendered by default.
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
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
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 |
---|---|---|
@@ -0,0 +1,156 @@ | ||
## Case 1: an error is reported when FileOffsetToData is too small | ||
## RUN: not yaml2obj --docnum=1 %s -o %t 2>&1 | \ | ||
## RUN: FileCheck %s --check-prefix=ERROR1 | ||
# | ||
# ERROR1: error: current file offset (60) is bigger than the specified FileOffsetToData for the .text section (48) | ||
jh7370 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--- !XCOFF | ||
FileHeader: | ||
MagicNumber: 0x1DF | ||
NumberOfSections: 1 | ||
CreationTime: 1705445558 | ||
OffsetToSymbolTable: 0x4E | ||
AuxiliaryHeaderSize: 0 | ||
Flags: 0x0 | ||
Sections: | ||
- Name: .text | ||
Address: 0x0 | ||
Size: 0x8 | ||
FileOffsetToData: 0x30 | ||
FileOffsetToRelocations: 0x44 | ||
NumberOfRelocations: 0x1 | ||
Flags: [ STYP_TEXT ] | ||
SectionData: '480000014E800020' | ||
Relocations: | ||
- Address: 0x0 | ||
Symbol: 0x0 | ||
Info: 0x99 | ||
Type: 0x1A | ||
Symbols: | ||
- Name: .bar | ||
Value: 0x0 | ||
Section: N_UNDEF | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
SymbolAlignmentAndType: 0 | ||
StorageMappingClass: XMC_PR | ||
SectionOrLength: 0 | ||
- Name: .foo | ||
Value: 0x0 | ||
Section: .text | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
SymbolAlignmentAndType: 17 | ||
StorageMappingClass: XMC_PR | ||
SectionOrLength: 8 | ||
StringTable: {} | ||
... | ||
## Case 2: an error is reported when FileOffsetToRelocations is too small | ||
jh7370 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## RUN: not yaml2obj --docnum=2 %s -o %t 2>&1 | \ | ||
## RUN: FileCheck %s --check-prefix=ERROR2 | ||
# | ||
# ERROR2: current file offset (68) is bigger than the specified FileOffsetToRelocations for the .text section (64) | ||
--- !XCOFF | ||
FileHeader: | ||
MagicNumber: 0x1DF | ||
NumberOfSections: 1 | ||
CreationTime: 1705445558 | ||
OffsetToSymbolTable: 0x4E | ||
AuxiliaryHeaderSize: 0 | ||
Flags: 0x0 | ||
Sections: | ||
- Name: .text | ||
Address: 0x0 | ||
Size: 0x8 | ||
FileOffsetToData: 0x3C | ||
FileOffsetToRelocations: 0x40 | ||
NumberOfRelocations: 0x1 | ||
Flags: [ STYP_TEXT ] | ||
SectionData: '480000014E800020' | ||
Relocations: | ||
- Address: 0x0 | ||
Symbol: 0x0 | ||
Info: 0x99 | ||
Type: 0x1A | ||
Symbols: | ||
- Name: .bar | ||
Value: 0x0 | ||
Section: N_UNDEF | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
SymbolAlignmentAndType: 0 | ||
StorageMappingClass: XMC_PR | ||
SectionOrLength: 0 | ||
- Name: .foo | ||
Value: 0x0 | ||
Section: .text | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
SymbolAlignmentAndType: 17 | ||
StorageMappingClass: XMC_PR | ||
SectionOrLength: 8 | ||
StringTable: {} | ||
... | ||
## Case 1: an error is reported when the OffsetToSymbolTable is too small | ||
jh7370 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## RUN: not yaml2obj --docnum=3 %s -o %t 2>&1 | \ | ||
## RUN: FileCheck %s --check-prefix=ERROR3 | ||
# | ||
# ERROR3: current file offset (78) is bigger than the specified SymbolTableOffset (64) | ||
--- !XCOFF | ||
FileHeader: | ||
MagicNumber: 0x1DF | ||
NumberOfSections: 1 | ||
CreationTime: 1705445558 | ||
OffsetToSymbolTable: 0x40 | ||
AuxiliaryHeaderSize: 0 | ||
Flags: 0x0 | ||
Sections: | ||
- Name: .text | ||
Address: 0x0 | ||
Size: 0x8 | ||
FileOffsetToData: 0x3C | ||
FileOffsetToRelocations: 0x44 | ||
NumberOfRelocations: 0x1 | ||
Flags: [ STYP_TEXT ] | ||
SectionData: '480000014E800020' | ||
Relocations: | ||
- Address: 0x0 | ||
Symbol: 0x0 | ||
Info: 0x99 | ||
Type: 0x1A | ||
Symbols: | ||
- Name: .bar | ||
Value: 0x0 | ||
Section: N_UNDEF | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
SymbolAlignmentAndType: 0 | ||
StorageMappingClass: XMC_PR | ||
SectionOrLength: 0 | ||
- Name: .foo | ||
Value: 0x0 | ||
Section: .text | ||
Type: 0x0 | ||
StorageClass: C_EXT | ||
NumberOfAuxEntries: 1 | ||
AuxEntries: | ||
- Type: AUX_CSECT | ||
SymbolAlignmentAndType: 17 | ||
StorageMappingClass: XMC_PR | ||
SectionOrLength: 8 | ||
StringTable: {} | ||
... |
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.