llvm-nm.rst 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. llvm-nm - list LLVM bitcode and object file's symbol table
  2. ==========================================================
  3. SYNOPSIS
  4. --------
  5. :program:`llvm-nm` [*options*] [*filenames...*]
  6. DESCRIPTION
  7. -----------
  8. The :program:`llvm-nm` utility lists the names of symbols from the LLVM bitcode
  9. files, object files, or :program:`ar` archives containing them, named on the
  10. command line. Each symbol is listed along with some simple information about
  11. its provenance. If no file name is specified, or *-* is used as a file name,
  12. :program:`llvm-nm` will process a file on its standard input stream.
  13. :program:`llvm-nm`'s default output format is the traditional BSD :program:`nm`
  14. output format. Each such output record consists of an (optional) 8-digit
  15. hexadecimal address, followed by a type code character, followed by a name, for
  16. each symbol. One record is printed per line; fields are separated by spaces.
  17. When the address is omitted, it is replaced by 8 spaces.
  18. Type code characters currently supported, and their meanings, are as follows:
  19. U
  20. Named object is referenced but undefined in this bitcode file
  21. C
  22. Common (multiple definitions link together into one def)
  23. W
  24. Weak reference (multiple definitions link together into zero or one definitions)
  25. t
  26. Local function (text) object
  27. T
  28. Global function (text) object
  29. d
  30. Local data object
  31. D
  32. Global data object
  33. ?
  34. Something unrecognizable
  35. Because LLVM bitcode files typically contain objects that are not considered to
  36. have addresses until they are linked into an executable image or dynamically
  37. compiled "just-in-time", :program:`llvm-nm` does not print an address for any
  38. symbol in an LLVM bitcode file, even symbols which are defined in the bitcode
  39. file.
  40. OPTIONS
  41. -------
  42. .. program:: llvm-nm
  43. .. option:: -B (default)
  44. Use BSD output format. Alias for :option:`--format=bsd`.
  45. .. option:: -P
  46. Use POSIX.2 output format. Alias for :option:`--format=posix`.
  47. .. option:: --debug-syms, -a
  48. Show all symbols, even debugger only.
  49. .. option:: --defined-only
  50. Print only symbols defined in this file (as opposed to
  51. symbols which may be referenced by objects in this file, but not
  52. defined in this file.)
  53. .. option:: --dynamic, -D
  54. Display dynamic symbols instead of normal symbols.
  55. .. option:: --extern-only, -g
  56. Print only symbols whose definitions are external; that is, accessible
  57. from other files.
  58. .. option:: --format=format, -f format
  59. Select an output format; *format* may be *sysv*, *posix*, or *bsd*. The default
  60. is *bsd*.
  61. .. option:: -help
  62. Print a summary of command-line options and their meanings.
  63. .. option:: --no-sort, -p
  64. Shows symbols in order encountered.
  65. .. option:: --numeric-sort, -n, -v
  66. Sort symbols by address.
  67. .. option:: --print-file-name, -A, -o
  68. Precede each symbol with the file it came from.
  69. .. option:: --print-size, -S
  70. Show symbol size instead of address.
  71. .. option:: --size-sort
  72. Sort symbols by size.
  73. .. option:: --undefined-only, -u
  74. Print only symbols referenced but not defined in this file.
  75. BUGS
  76. ----
  77. * :program:`llvm-nm` cannot demangle C++ mangled names, like GNU :program:`nm`
  78. can.
  79. * :program:`llvm-nm` does not support the full set of arguments that GNU
  80. :program:`nm` does.
  81. EXIT STATUS
  82. -----------
  83. :program:`llvm-nm` exits with an exit code of zero.
  84. SEE ALSO
  85. --------
  86. llvm-dis, ar(1), nm(1)