llvm-strings - 文字列の表示

概要

llvm-strings [オプション] [入力…]

説明

llvm-strings は、GNU の strings の代替として意図されたツールで、ファイル内の印刷可能な文字列を探し、標準出力ストリームに書き込みます。印刷可能な文字列とは、4つ(デフォルト)以上の印刷可能な ASCII 文字の任意のシーケンスです。ファイルの末尾またはその他の任意のバイトで、現在のシーケンスが終了します。

llvm-strings は、指定された各 入力 ファイル内で文字列を探します。GNU strings とは異なり、オブジェクトファイルの特定のセクションへの検索を制限するのではなく、ファイル形式に関係なく、入力ファイル全体を検索します。入力 として “-” が指定されている場合、または 入力 が指定されていない場合は、プログラムは標準入力ストリームから読み込みます。

$ cat input.txt
bars
foo
wibble blob
$ llvm-strings input.txt
bars
wibble blob

オプション

--all, -a

サイレントに無視されます。GNU strings との互換性のために存在します。

--bytes=<length>, -n

バイトシーケンスを文字列と見なすために必要な印刷可能な ASCII 文字の最小数を設定します。デフォルト値は 4 です。

--help, -h

コマンドラインオプションの概要を表示します。

--print-file-name, -f

各文字列の前に、含まれているファイルの名前を表示します。

$ llvm-strings --print-file-name test.o test.elf
test.o: _Z5hellov
test.o: some_bss
test.o: test.cpp
test.o: main
test.elf: test.cpp
test.elf: test2.cpp
test.elf: _Z5hellov
test.elf: main
test.elf: some_bss
--radix=<radix>, -t

各文字列の前に、ファイル内でのオフセットを指定された基数を使用して表示します。有効な <radix> の値は、8進数、10進数、16進数それぞれに対して odx です。

$ llvm-strings --radix=o test.o
    1054 _Z5hellov
    1066 .rela.text
    1101 .comment
    1112 some_bss
    1123 .bss
    1130 test.cpp
    1141 main
$ llvm-strings --radix=d test.o
    556 _Z5hellov
    566 .rela.text
    577 .comment
    586 some_bss
    595 .bss
    600 test.cpp
    609 main
$ llvm-strings -t x test.o
    22c _Z5hellov
    236 .rela.text
    241 .comment
    24a some_bss
    253 .bss
    258 test.cpp
    261 main
--version

llvm-strings 実行可能ファイルのバージョンを表示します。

@<FILE>

応答ファイル <FILE> からコマンドラインオプションを読み取ります。

終了ステータス

llvm-strings は、エラーが発生した場合、0 以外の終了コードで終了します。それ以外の場合は、コード 0 で終了します。

バグ

バグを報告するには、<https://github.com/llvm/llvm-project/labels/tools:llvm-strings/> を参照してください。