Bug 31884 - Compressed .strtab and .symtab
Summary: Compressed .strtab and .symtab
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-12 06:04 UTC by Fangrui Song
Modified: 2024-09-01 09:47 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2024-06-12 06:04:15 UTC
In ELF executables and DSOs, .symtab and .strtab sections can consume a significant portion of the file size (10+% or even 20+%). In many scenarios, we cannot remove them due to symbolizers (crash reporters, Linux perf, etc) and other analysis tools.
When .gnu_debugdata (MiniDebugInfo) is used, the separate debug files contain .symtab/.strtab.

The standard SHF_COMPRESSED feature can be used with non-SHF_ALLOC sections.
It’s natural to compress .symtab and .strtab. This usage doesn't need amendment to the generic ABI.

* ld/objcopy: If --compress-sections (PR 27452) is supported, just specify: --compress-sections .strtab=zstd --compress-sections .symtab=zstd
* BFD (nm, objdump, etc): reader support
* readelf: reader support
Comment 1 Sam James 2024-08-30 23:22:54 UTC
In PR29584, mjw was keen on switching to making .gnu_debugdata a proper SHF_COMPRESSED section.
Comment 2 Sam James 2024-09-01 09:47:32 UTC
We're currently considering (_very_ provisionally) whether to (start to) adopt MiniDebugInfo in Gentoo.

Are we going to bother trying to migrate to this, or should we go ahead with the MDI form?