llvm-strings.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. llvm-strings - print strings
  2. ============================
  3. .. program:: llvm-strings
  4. SYNOPSIS
  5. --------
  6. :program:`llvm-strings` [*options*] [*input...*]
  7. DESCRIPTION
  8. -----------
  9. :program:`llvm-strings` is a tool intended as a drop-in replacement for GNU's
  10. :program:`strings`, which looks for printable strings in files and writes them
  11. to the standard output stream. A printable string is any sequence of four (by
  12. default) or more printable ASCII characters. The end of the file, or any other
  13. byte, terminates the current sequence.
  14. :program:`llvm-strings` looks for strings in each ``input`` file specified.
  15. Unlike GNU :program:`strings` it looks in the entire input file, regardless of
  16. file format, rather than restricting the search to certain sections of object
  17. files. If "``-``" is specified as an ``input``, or no ``input`` is specified,
  18. the program reads from the standard input stream.
  19. EXAMPLE
  20. -------
  21. .. code-block:: console
  22. $ cat input.txt
  23. bars
  24. foo
  25. wibble blob
  26. $ llvm-strings input.txt
  27. bars
  28. wibble blob
  29. OPTIONS
  30. -------
  31. .. option:: --all, -a
  32. Silently ignored. Present for GNU :program:`strings` compatibility.
  33. .. option:: --bytes=<length>, -n
  34. Set the minimum number of printable ASCII characters required for a sequence of
  35. bytes to be considered a string. The default value is 4.
  36. .. option:: --help, -h
  37. Display a summary of command line options.
  38. .. option:: --help-list
  39. Display an uncategorized summary of command line options.
  40. .. option:: --print-file-name, -f
  41. Display the name of the containing file before each string.
  42. Example:
  43. .. code-block:: console
  44. $ llvm-strings --print-file-name test.o test.elf
  45. test.o: _Z5hellov
  46. test.o: some_bss
  47. test.o: test.cpp
  48. test.o: main
  49. test.elf: test.cpp
  50. test.elf: test2.cpp
  51. test.elf: _Z5hellov
  52. test.elf: main
  53. test.elf: some_bss
  54. .. option:: --radix=<radix>, -t
  55. Display the offset within the file of each string, before the string and using
  56. the specified radix. Valid ``<radix>`` values are ``o``, ``d`` and ``x`` for
  57. octal, decimal and hexadecimal respectively.
  58. Example:
  59. .. code-block:: console
  60. $ llvm-strings --radix=o test.o
  61. 1054 _Z5hellov
  62. 1066 .rela.text
  63. 1101 .comment
  64. 1112 some_bss
  65. 1123 .bss
  66. 1130 test.cpp
  67. 1141 main
  68. $ llvm-strings --radix=d test.o
  69. 556 _Z5hellov
  70. 566 .rela.text
  71. 577 .comment
  72. 586 some_bss
  73. 595 .bss
  74. 600 test.cpp
  75. 609 main
  76. $ llvm-strings -t x test.o
  77. 22c _Z5hellov
  78. 236 .rela.text
  79. 241 .comment
  80. 24a some_bss
  81. 253 .bss
  82. 258 test.cpp
  83. 261 main
  84. .. option:: --version
  85. Display the version of the :program:`llvm-strings` executable.
  86. .. option:: @<FILE>
  87. Read command-line options from response file ``<FILE>``.
  88. EXIT STATUS
  89. -----------
  90. :program:`llvm-strings` exits with a non-zero exit code if there is an error.
  91. Otherwise, it exits with code 0.
  92. BUGS
  93. ----
  94. To report bugs, please visit <http://llvm.org/bugs/>.