Go to main content

マニュアルページ セクション 1: ユーザーコマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

elfcompress (1)

名前

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 セクションフラグが設定されています。elfcompressSHT_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.

オプション

サポートしているオプションは、次のとおりです。

–c [!]class1,[!]class2,...

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.

次のクラスのセクションを定義できます。

nonalloc

Process any non-allocatable section.これらのセクションは、SHF_ALLOC セクションフラグを含んでいないとものとして識別されます。This class encapsulates all of the other classes, except for the shstrtab class.

annotate

Process any annotation section.これらのセクションは、メモリーアクセスツールや、カバレージ関連のツールによって使用される情報を提供します。これらのセクションは、SHT_SUNW_ANNOTATE セクションタイプを指定することで識別します。

comment

Process any comment section.これらのセクションは、.comment セクション名を指定することで識別します。

compcom

Compress any compiler commentary section.These sections are identified by having a .compcom section name.

debug

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.

shstrtab

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.

sort_sym_addr, sort_sym_name, sort, sort_sym

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.

sort_sym_addr

By-address .symtab symbol sort sections (SHT_SUNW_symsort, SHT_SUNW_tlssort).

sort_sym_name

By-name .symtab symbol sort sections (SHT_SUNW_symnsort).

sort, sort_sym

All .symtab symbol sort sections.Equivalent to specifying both sort_sym_addr and sort_sym_name.

symbol

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.

–f

デフォルトでは、elfcompress は圧縮後のサイズが元のデータと同じか小さくなる場合にのみセクションを圧縮します。圧縮後のサイズが元より大きくても圧縮を強制的に実行する場合は、–f を指定します。The –f option is equivalent to specifying the –t force option.

–n name

処理するセクションの名前を指定します。elfcompress では複数の –n オプションが受け入れられ、複数のセクションを指定できます。–n を使用しない場合、elfcompress は指定された圧縮操作と互換性があるすべてのデバッグセクションを選択します。–t オプションおよびノートを参照してください。

–t cmp-type[,cmp-opt...]

実行する圧縮操作を指定します。If the –t option is not specified, elfcompress will default to zlib.次の圧縮タイプが認識されます。

none

圧縮されたセクションが圧縮解除されます。

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

GNU セクション圧縮形式を使用して、ZLIB 圧縮でデバッグセクションを圧縮します。候補セクションは、割り当て不可能 (SHF_ALLOC フラグが設定されていない) でタイプ SHT_NOBITS ではなく、名前が .debug で始まる必要があります。結果のセクションは、名前が .zdebug で始まるように変更され、圧縮が使用されたことが示されます。

The following cmp-opt option can be specified.

force

デフォルトでは、elfcompress は圧縮後のサイズが元のデータと同じか小さくなる場合にのみセクションを圧縮します。Specify force to force compression even when the resulting size is larger than the original.

–V
–-version

バージョン情報を出力します。

–?
–-help

使用法に関するメッセージを出力したあと、すぐに終了します。

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) を参照してください。

使用例 1 zlib 圧縮をすべてのデバッグセクションに適用します
% 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

ファイル

/tmp/elfcompress_*

temporary files

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

属性タイプ
属性値
使用条件
developer/base-developer-utilities
インタフェースの安定性
確実

関連項目

ar(1), as(1), ld(1), mcs(1), strip(1), elf(3ELF), ar.h(3HEAD), zlib(3), a.out(5), attributes(7)

OracleSolaris 11.4 リンカーとライブラリガイド