-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm-objcopy] --[de]compress-debug-sections: don't compress SHF_ALLOC sections, only decompress .debug sections #84885
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
MaskRay
merged 6 commits into
main
from
users/MaskRay/spr/llvm-objcopy-simplify-decompress-debug-sections-and-dont-compress-shf_alloc-sections
Mar 13, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5b3743b
[𝘀𝗽𝗿] changes to main this commit is based on
MaskRay d2e0085
[𝘀𝗽𝗿] initial version
MaskRay a3e946c
[𝘀𝗽𝗿] changes introduced through rebase
anbbna a91b72c
fix another problem. improve tests
MaskRay c8844ac
don't copy Config
MaskRay bf00730
fix test
MaskRay 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,10 @@ | |
# CHECK: Name Type Address Off Size ES Flg Lk Inf Al | ||
# COMPRESSED: .debug_foo PROGBITS 0000000000000000 000040 {{.*}} 00 C 0 0 8 | ||
# COMPRESSED-NEXT: .notdebug_foo PROGBITS 0000000000000000 {{.*}} 000008 00 0 0 0 | ||
# COMPRESSED: .debug_alloc PROGBITS 0000000000000000 {{.*}} 000040 00 A 0 0 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You presumably need changes to the zstd version of this test too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed |
||
# UNCOMPRESSED: .debug_foo PROGBITS 0000000000000000 000040 000008 00 0 0 0 | ||
# UNCOMPRESSED-NEXT: .notdebug_foo PROGBITS 0000000000000000 {{.*}} 000008 00 0 0 0 | ||
# UNCOMPRESSED: .debug_alloc PROGBITS 0000000000000000 {{.*}} 000040 00 A 0 0 0 | ||
|
||
## Relocations do not change. | ||
# CHECK: Relocation section '.rela.debug_foo' at offset {{.*}} contains 2 entries: | ||
|
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,36 @@ | ||
# REQUIRES: zlib | ||
## Test decompression for different sections. | ||
|
||
# RUN: yaml2obj %s -o %t | ||
# RUN: llvm-objcopy --decompress-debug-sections %t %t.de | ||
# RUN: llvm-readelf -S %t.de | FileCheck %s | ||
|
||
# CHECK: Name Type Address Off Size ES Flg Lk Inf Al | ||
# CHECK: .debug_alloc PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 AC 0 0 0 | ||
# CHECK-NEXT: .debug_nonalloc PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 1 | ||
# CHECK-NEXT: .debugx PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 1 | ||
# CHECK-NEXT: nodebug PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 C 0 0 0 | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_REL | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .debug_alloc | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_COMPRESSED ] | ||
Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f800151 | ||
- Name: .debug_nonalloc | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_COMPRESSED ] | ||
Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f800151 | ||
- Name: .debugx | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_COMPRESSED ] | ||
Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f800151 | ||
- Name: nodebug | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_COMPRESSED ] | ||
Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f800151 |
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.