Compressed Sections in ELF Files
In the version v4.2 of the ELF standard, sections containing compressed data are introduced. References into sections always assume normal, i.e. not compressed data in a section. Thus, before a reference into a compressed section can be evaluated the section needs to be decompressed.
As of now, Ozone does not support decompressing sections. So the content of such sections is meaningless to Ozone.
Normally, sections containing debug information are affected by compression. Therefore, when operating on an ELF file containing compressed sections, Ozone is lacking information vital for debug tasks such as connecting disassembly and source code, stepping through the code on the source level, or filling windows such as call stack, source files, functions, etc. Long story short: The debug experience is likely to be quite limited when handling ELF files containing compressed sections.
Compressed sections affect only the file size of ELF files. It has no advantages or influence on the firmware binary.
Hence we strongly recommend to disable section compression in the build tool chain.
Disabling Section Compression in LLVM/Clang
Clang (since 12.0.0) offers the command line option -gz which defaults to -gz=zlib. To disable section compression either set -gz=none or remove -gz completely.
Disabling Section Compression in GCC
GCC (since gcc 13.0) offers the command line option -gz which defaults to -gz=zlib. To disable section compression either set -gz=none or remove -gz completely.
Disabling Section Compression in Zephyr
The Kconfig symbol CONFIG_BUILD_OUTPUT_COMPRESS_DEBUG_SECTIONS controls the section compression. Setting this option to n will disable it.
Checking for Compressed Sections
Ozone v3.50b and later checks for compressed sections when loading an ELF file. In case a compressed section is found, a warning message is displayed in the console window.
You may also use readelf --section-details <ELF-file> to inspect the section information. The generated report contains a list of all flags attached to a section. The presence of the flag COMPRESSEED indicates that the section is compressed.
References
ELF spec v4.2: https://gabi.xinuos.com/v42/index.html