Go to main content

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

印刷ビューの終了

更新: 2022年7月27日
 
 

size(1)

名前

size - オブジェクトファイルのセクションサイズをバイトで出力

形式

size [-fFhnoVx] [--scale[=item1,item2,...]] file...

説明

size コマンドは、ELF オブジェクトファイル内の各ロード済みセクションのセグメントまたはセクションのサイズ情報 (バイト単位) を生成します。size はテキスト、データ、bss (初期化されていないデータ) セグメント (またはセクション) およびその合計のサイズを出力します。

size は、コマンド行に入力された ELF オブジェクトファイルを処理します。アーカイブファイルが size コマンドに入力された場合、アーカイブ内の各オブジェクトファイルの情報が表示されます。

セグメント情報を計算する際、size コマンドは、書き込み不可セグメントの合計ファイルサイズ、書き込み可能セグメントの合計ファイルサイズ、および書き込み可能セグメントの合計メモリーサイズから書き込み可能セグメントの合計ファイルサイズを引いたものを出力します。

セグメント情報を計算できない場合、size はセクション情報を計算します。セクション情報を計算する際、これは割り当て可能で、書き込み不可、かつ NOBITS ではないセクションの合計サイズ、割り当て可能で、書き込み可能、かつ NOBITS ではないセクションの合計サイズ、および NOBITS タイプの書き込み可能セクションの合計サイズを出力します。NOBITS セクションは、実際には file 内で領域を占有しません。

size は、セグメントもセクション情報も計算できない場合、エラーメッセージを出力します。

オプション

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

–f

各割り当て可能セクションのサイズ、セクションの名前、およびセクションサイズの合計を出力します。セクションデータが存在しない場合、size はエラーメッセージを出力します。

–F

各ロード可能セグメントのサイズ、セグメントのアクセス権フラグ、およびロード可能セグメントの合計サイズを出力します。セグメントデータが存在しない場合、size はエラーメッセージを出力します。

–h

人間が読める形式にスケーリングされた 10 進数で数値を出力します。The –h option is equivalent to using the –scale=max,1024 option.

–n

ロード不可のセグメントまたは割り当て不可のセクションのサイズを出力します。セグメントデータが存在する場合、size は、各ロード可能セグメントのメモリーサイズまたは各ロード不可セグメントのファイルサイズ、アクセス権フラグ、およびセグメントの合計サイズを出力します。セグメントデータが存在しない場合、size は、割り当て可能および割り当て不可のセクションごとに、メモリーサイズ、セクション名、およびセクションの合計サイズを出力します。セグメントまたはセクションデータが存在しない場合、size はエラーメッセージを出力します。

–o

数値を 10 進数ではなく、8 進数で出力します。

–scale[=item1,item2,...]

人間が読める形式にスケーリングされた 10 進数で数値を出力します。Scaling is done by repetitively dividing by 1024, unless otherwise specified.

–scale specified without arguments enables default scaled output, and is equivalent to –scale=max,1024.

–scale can be specified with the following arguments.

binary

Scaling is done by repetitively dividing by a scale factor of 1024.The use of binary scaling is indicated by the addition of an 'i' modifier to the suffix (Ki, Mi, Gi, ...).

max

Values are scaled to the largest unit for which the result retains a non-zero integer part.Up to 2 decimal places of fractional output may be shown.

min

Values are scaled to the smallest unit capable of showing the full value within the allotted space of 5 columns, and displayed without the use of fractional output.

minwide

Values are scaled to the smallest unit capable of showing the full value within the allotted space of 8 columns, and displayed without the use of fractional output.

1000

Scaling is done by repetitively dividing by a scale factor of 1000.

1024

Scaling is done by repetitively dividing by a scale factor of 1024.

–V
–-version

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

–x

数値を 10 進数ではなく 16 進数で出力します。

–?
–-help

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

次の例は、size の一般的な出力です。

使用例 1 サイズ情報の生成
example% size filename
2724 + 88 + 0 = 2812 
使用例 2 割り当て可能セクションのサイズ情報の生成
example% size -f filename
26(.text) + 5(.init) + 5(.fini) = 36 
使用例 3 ロード可能セグメントのサイズ情報の生成
example% size -F filename
2724(r-x) + 88(rwx) + 0(rwx) = 2812

属性

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

属性タイプ
属性値
使用条件
developer/base-developer-utilities

関連項目

as(1), ld(1), ar.h(3HEAD), a.out(5), attributes(7)