-
Couldn't load subscription status.
- Fork 15k
[llvm][yaml2obj] Modify section header overriding timing #130942
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
Changes from 5 commits
701efbe
f079240
9260c30
db32881
2b7f229
f943ab1
7908868
4d88fa5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,25 +44,25 @@ Sections: | |
| - Name: .text | ||
| Type: SHT_PROGBITS | ||
| Size: 4 | ||
| ShOffset: 0x1000 | ||
| Offset: 0x1000 | ||
| AddressAlign: 0x1000 | ||
| - Name: .rodata | ||
| Type: SHT_PROGBITS | ||
| Size: 4 | ||
| ShOffset: 0x2000 | ||
| Offset: 0x2000 | ||
| AddressAlign: 0x1000 | ||
| - Name: .data | ||
| Type: SHT_PROGBITS | ||
| ShOffset: 0x2004 | ||
| Offset: 0x2004 | ||
| Size: 4 | ||
| - Name: .nobits1 | ||
| Type: SHT_NOBITS | ||
| ShOffset: 0x2008 | ||
| Offset: 0x2008 | ||
| Size: 1 | ||
| - Name: .nobits2 | ||
| Type: SHT_NOBITS | ||
| # Intentionally set to 0x2009 though the previous section is SHT_NOBITS. | ||
| ShOffset: 0x2009 | ||
| Offset: 0x2009 | ||
| Size: 1 | ||
| ProgramHeaders: | ||
| # Program header with no sections. | ||
|
|
@@ -180,15 +180,16 @@ ProgramHeaders: | |
|
|
||
| # INVALID-OFFSET: yaml2obj: error: 'Offset' for segment with index 1 must be less than or equal to the minimum file offset of all included sections (0x78) | ||
|
|
||
| ## Document that the "Offset" value is checked after the section offset is overriden using "ShOffset". | ||
| ## Document that the "Offset" value should be checked before the section offset is overriden using "ShOffset". | ||
| ## And the offset of the first section in a segment should not greater than the offset of the segment. | ||
|
||
| # RUN: yaml2obj --docnum=4 %s -o %t5 | ||
| # RUN: llvm-readelf %t5 --sections --program-headers | FileCheck %s --check-prefix=SHOFFSET | ||
|
|
||
| # SHOFFSET: [Nr] Name Type Address Off | ||
| # SHOFFSET: [ 1] .foo PROGBITS 0000000000000000 ffffffff | ||
| # SHOFFSET: [ 1] .foo PROGBITS 0000000000000000 0000ff | ||
|
|
||
| # SHOFFSET: Type Offset | ||
| # SHOFFSET-NEXT: LOAD 0xffffff00 | ||
| # SHOFFSET-NEXT: LOAD 0x000078 | ||
|
|
||
| --- !ELF | ||
| FileHeader: | ||
|
|
@@ -202,9 +203,10 @@ Sections: | |
| Size: 0x1 | ||
| ## Note: the real .foo offset is much less than 0xFFFFFFFF or | ||
| ## 0xFFFFFF00, but no error is reported. | ||
| ShOffset: 0xFFFFFFFF | ||
| ShOffset: 0xFF | ||
|
||
| ProgramHeaders: | ||
| - Type: PT_LOAD | ||
| Offset: 0xFFFFFF00 | ||
| Offset: 0x78 | ||
jh7370 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| FirstSec: .foo | ||
| LastSec: .foo | ||
|
|
||
|
||
Uh oh!
There was an error while loading. Please reload this page.