NAME elf_compress, elf_compress_gnu SYNOPSIS cc [ flag ... ] file ... -lelf [ library ... ] #include int elf_compress(Elf_Scn *scn, int type); int elf_compress_gnu(Elf_Scn *scn, int inflate); DESCRIPTION elf_compress is used to compress or decompress an ELF section. The type argument specifies the desired compression type, and can be one of the following. 0 Decompress any compressed content. ELF_COMPRESS_ZLIB ZLIB compression, ELF ABI format. elf_compress_gnu is used to compress or decompress an ELF section using the original GNU compression format. inflate is set to 1 to decompress, and 0 to compress. RETURN VALUE Upon failure, elf_compress and elf_compress_gnu return -1 and set elf_errno. Otherwise, 0 is returned. On success, elf_compress and elf_compress_gnu update the section header, and the original data associated with the section is replaced. Any information previously returned for the section by elf32_getshdr, elf64_shdr, or elf_getdata, is invalidated, and should no longer be referenced by the caller. The caller should defer calling those functions until after calling elf_compress, or should call them again afterwards in order to obtain the new information. NOTES elf_compress and elf_compress_gnu do not set the the ELF_F_DIRTY bit for the section. The caller must explicitly call elf_flagshdr in order to keep the changes when elf_update is used. elf_compress and elf_compress_gnu will reject a compression attempt for a section that is already compressed. The caller must first decompress the section, and then compress it into the desired format. elf_compress and elf_compress_gnu will silently ignore a decompression attempt for an already decompressed section. The original GNU compression format is deprecated. elf_compress_gnu is provided in order to support existing objects. The use of elf_compress when creating new objects is recommended. The original GNU compression format can only be applied to sections with names that start with .debug. On compression, that type requires the name to be altered to start with .zdebug. elf_compress_gnu does not provide the replacement name. The caller is responsible for providing the replacement name. SEE ALSO elf32_getshdr(3ELF), elf64_getshdr(3ELF), elf_errno(3ELF), elf_flagshdr(3ELF), elf_getdata(3ELF), elf_update(3ELF), libelf(3LIB)