elfcompress - 目标文件的压缩/解压调试节
elfcompress [-fV] [-c [!]class1,[!]class2,... | -n name] [-t cmp-type[,cmp-opt...]] file...
The elfcompress command is used to compress or decompress sections in ELF object files.除非另有说明,否则会处理所有调试和注释节。
如果输入文件是归档文件(请参见 ar.h (3HEAD)),则会将归档文件视为一组独立文件。如果归档成员并非目标文件,则会保留不变。
elfcompress 无法修改包含在分段中的节。此类可分配的节会设置其 SHF_ALLOC 节标志。elfcompress 无法修改类型为 SHT_NOBITS 的节。–t 选项指定的压缩操作可能对候选节带来额外限制。请参见 –t 选项和附注。
当使用 –n 选项指定一个或多个要处理的节时,只会处理指定的节,其他所有节会保留未修改状态。
When the –n option is not used, elfcompress processes sections selected by the –c option that are compatible with the compression format specified with the –t option.By default, debug and annotate sections are compressed using the zlib format.
支持以下选项:
Specify candidate sections.This option provides fine grained control over the selection of candidate sections to be manipulated. –c is used in conjunction with the –t option.If the –c option is not specified, elfcompress will default to the annotate and debug classes.
Some classes cause other classes to be implicitly included, or encapsulated.Such cases are noted in the class descriptions below.Each class token can be prepended with a '!' to indicate that the class should not be included.This definition can be useful to prevent a class from including another normally encapsulated class.For example, while the symbol class encapsulates non-allocable sort sections, symbol,!sort targets the non-allocable symbol table, but excludes any associated ELF sort sections.
可以定义以下部分类。
Process any non-allocatable section.这些部分标识为不包括 SHF_ALLOC 节标志。This class encapsulates all of the other classes, except for the shstrtab class.
Process any annotation section.这些部分提供内存访问工具和覆盖相关工具使用的信息。这些部分通过 SHT_SUNW_ANNOTATE 节类型来进行标识。
Process any comment section.这些部分通过 .comment 节名称来进行标识。
Compress any compiler commentary section.These sections are identified by having a .compcom section name.
Process sections commonly used to contain debugging data.Debug sections are identified by having a .debug*, .line, .stab*, .SUNW_ctf, or .zdebug* section name.These sections are also identified by having an SHT_PROGBITS, SHT_SUNW_DEBUG, or SHT_SUNW_DEBUGSTR section type.This class also encapsulates the compcom class.
Process the .shstrtab section used to hold ELF section names.This option is intended for specialized dynamic objects, and is not recommended for general use.
Process the symbol sort sections associated to SHT_SYMTAB symbol tables.Each of these symbol tables typically have associated symbol sort sections, sorted by address, and by name.
By-address .symtab symbol sort sections (SHT_SUNW_symsort, SHT_SUNW_tlssort).
By-name .symtab symbol sort sections (SHT_SUNW_symnsort).
All .symtab symbol sort sections.Equivalent to specifying both sort_sym_addr and sort_sym_name.
Process any non-allocatable symbol table.这些部分通过 SHT_SYMTAB 节类型来进行标识。This class also encapsulates the sort classes.Any associated string table or symbol sort sections are also processed.
缺省情况下,仅当压缩后生成的大小不超过原始数据大小时,elfcompress 才会压缩节。指定 –f 进行强制压缩,即使生成大小超过原始大小。The –f option is equivalent to specifying the –t force option.
指定要处理的节的名称。elfcompress 可采用多个 –n 选项,以允许指定多个节。如果没有使用 –n,则 elfcompress 会选择与指定的压缩操作兼容的所有调试节。请参见 –t 选项和附注。
指定要执行的压缩操作。If the –t option is not specified, elfcompress will default to zlib.以下是可识别的压缩类型。
压缩的节已解压。
使用 ZLIB 压缩来压缩调试节。The candidate sections for compression can be specified using the –c option.If –c is not present, elfcompress defaults to compressing annotate and debug sections, as if the –c annotate,debug option had been set.生成的节将设置 SHF_COMPRESSED 节标志来标识使用了压缩。
使用 ZLIB 压缩来压缩调试节,使用 GNU 节压缩格式。候选节必须不可分配(未设置 SHF_ALLOC 标志)、无法拥有 SHT_NOBITS 类型,且必须拥有以 .debug 开始的名称。生成的节将重命名为以 .zdebug 开头来标识使用了压缩。
The following cmp-opt option can be specified.
缺省情况下,仅当压缩后生成的大小不超过原始数据大小时,elfcompress 才会压缩节。Specify force to force compression even when the resulting size is larger than the original.
输出版本信息。
输出用法消息并立即退出。
zlib-gnu 压缩格式限制为名称以 .debug 开始的节,同时可将缺省 zlib 压缩格式应用于具有任意名称的节。如果指定了 –t zlib-gnu,但未指定 –n 选项,则会解压名称与 zlib-gnu 格式不兼容的之前压缩的任何节。
elfcompress 命令无法修改核心文件。
The elfcompress –c and –t options correspond to the ld –z compress-class and –z compress-sections options, respectively.Performing these operations at link-edit time, rather than using elfcompress to post process objects is more efficient, but otherwise equivalent.请参见 ld(1)。
% elfcompress file示例 2 解压所有调试节
% elfcompress -t none file示例 3 压缩 .debug_info 节,使用 GNU 类型格式
% elfcompress -t zlib-gnu -n .debug_info file示例 4 Compress the .symtab symbol table and all related sections
% elfcompress -c symbol file示例 5 Compress .symtab symbol table and all related sections, excluding symbol sort sections
% elfcompress -c 'symbol,!sort' file
temporary files
有关下列属性的说明,请参见 attributes(7):
|
ar(1), as(1), ld(1), mcs(1), strip(1), elf(3ELF), ar.h(3HEAD), zlib(3), a.out(5), attributes(7)