[PATCH] D154641: [ELF] Add --compress-ections
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 16:19:11 PDT 2023
ikudrin added a comment.
The code overall looks OK, but am I understand it right that the discussion on the Generic System V ABI mailing list is not finished yet?
> [ELF] Add --compress-ections
Please, don't forget to fix the typo in the title and in the first line of the description.
================
Comment at: lld/ELF/OutputSections.cpp:334-339
+ for (auto &[glob, t] : config->compressSections)
+ if (glob.match(name))
+ type = t;
+ if (config->compressDebugSections != DebugCompressionType::None &&
+ !(flags & SHF_ALLOC) && name.starts_with(".debug_") && size)
+ type = config->compressDebugSections;
----------------
================
Comment at: lld/ELF/OutputSections.cpp:459-461
// If --compress-debug-section is specified and if this is a debug section,
// we've already compressed section contents. If that's the case,
// just write it down.
----------------
The comment needs to be updated
================
Comment at: lld/ELF/Writer.cpp:540-541
// If --compressed-debug-sections is specified, compress .debug_* sections.
// Do it right now because it changes the size of output sections.
----------------
This comment should be removed
================
Comment at: lld/ELF/Writer.cpp:1621-1623
+ // Compress SHF_COMPRESSED sections using the sizes computed by
+ // assignAddresses. We require that future assignAddresses calls cannot change
+ // the sizes of these sections.
----------------
A few words about how this requirement is enforced would be great.
By the way, where does this requirement come from? Do you think that code sections shouldn't be compressed at all, or only those that need thunks or other fixes? Why?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154641/new/
https://reviews.llvm.org/D154641
More information about the llvm-commits
mailing list