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 オプションを使用して 1 つ以上のセクションをプロセスに指定した場合、指定したセクションのみが処理され、ほかのすべてのセクションは変更されません。
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 セクションフラグが設定され、圧縮が使用されたことが示されます。
GNU セクション圧縮形式を使用して、ZLIB 圧縮でデバッグセクションを圧縮します。候補セクションは、割り当て不可能 (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 GNU スタイル形式を使用して、.debug_info セクションを圧縮します
% 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)