ObjcopyOpts.td 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. include "CommonOpts.td"
  2. defm binary_architecture
  3. : Eq<"binary-architecture", "Ignored for compatibility">;
  4. def B : JoinedOrSeparate<["-"], "B">,
  5. Alias<binary_architecture>,
  6. HelpText<"Alias for --binary-architecture">;
  7. defm target : Eq<"target", "Format of the input and output file">,
  8. Values<"binary">;
  9. def F : JoinedOrSeparate<["-"], "F">,
  10. Alias<target>,
  11. HelpText<"Alias for --target">;
  12. defm input_target : Eq<"input-target", "Format of the input file">,
  13. Values<"binary">;
  14. def I : JoinedOrSeparate<["-"], "I">,
  15. Alias<input_target>,
  16. HelpText<"Alias for --input-target">;
  17. defm output_target : Eq<"output-target", "Format of the output file">,
  18. Values<"binary">;
  19. def O : JoinedOrSeparate<["-"], "O">,
  20. Alias<output_target>,
  21. HelpText<"Alias for --output-target">;
  22. defm new_symbol_visibility : Eq<"new-symbol-visibility", "Visibility of "
  23. "symbols generated for binary input or added"
  24. " with --add-symbol unless otherwise"
  25. " specified. The default value is 'default'.">;
  26. def compress_debug_sections : Flag<["--"], "compress-debug-sections">;
  27. def compress_debug_sections_eq
  28. : Joined<["--"], "compress-debug-sections=">,
  29. MetaVarName<"[ zlib | zlib-gnu ]">,
  30. HelpText<"Compress DWARF debug sections using specified style. Supported "
  31. "styles: 'zlib-gnu' and 'zlib'">;
  32. def decompress_debug_sections : Flag<["--"], "decompress-debug-sections">,
  33. HelpText<"Decompress DWARF debug sections.">;
  34. defm split_dwo
  35. : Eq<"split-dwo", "Equivalent to extract-dwo on the input file to "
  36. "<dwo-file>, then strip-dwo on the input file">,
  37. MetaVarName<"dwo-file">;
  38. defm add_gnu_debuglink
  39. : Eq<"add-gnu-debuglink", "Add a .gnu_debuglink for <debug-file>">,
  40. MetaVarName<"debug-file">;
  41. defm rename_section
  42. : Eq<"rename-section",
  43. "Renames a section from old to new, optionally with specified flags. "
  44. "Flags supported for GNU compatibility: alloc, load, noload, "
  45. "readonly, debug, code, data, rom, share, contents, merge, strings.">,
  46. MetaVarName<"old=new[,flag1,...]">;
  47. defm redefine_symbol
  48. : Eq<"redefine-sym", "Change the name of a symbol old to new">,
  49. MetaVarName<"old=new">;
  50. defm redefine_symbols
  51. : Eq<"redefine-syms",
  52. "Reads a list of symbol pairs from <filename> and runs as if "
  53. "--redefine-sym=<old>=<new> is set for each one. <filename> "
  54. "contains two symbols per line separated with whitespace and may "
  55. "contain comments beginning with '#'. Leading and trailing "
  56. "whitespace is stripped from each line. May be repeated to read "
  57. "symbols from many files.">,
  58. MetaVarName<"filename">;
  59. defm only_section : Eq<"only-section", "Remove all but <section>">,
  60. MetaVarName<"section">;
  61. def j : JoinedOrSeparate<["-"], "j">,
  62. Alias<only_section>,
  63. HelpText<"Alias for --only-section">;
  64. defm add_section
  65. : Eq<"add-section",
  66. "Make a section named <section> with the contents of <file>.">,
  67. MetaVarName<"section=file">;
  68. defm set_section_alignment
  69. : Eq<"set-section-alignment", "Set alignment for a given section.">,
  70. MetaVarName<"section=align">;
  71. defm set_section_flags
  72. : Eq<"set-section-flags",
  73. "Set section flags for a given section. Flags supported for GNU "
  74. "compatibility: alloc, load, noload, readonly, debug, code, data, "
  75. "rom, share, contents, merge, strings.">,
  76. MetaVarName<"section=flag1[,flag2,...]">;
  77. def S : Flag<["-"], "S">,
  78. Alias<strip_all>,
  79. HelpText<"Alias for --strip-all">;
  80. def strip_dwo : Flag<["--"], "strip-dwo">,
  81. HelpText<"Remove all DWARF .dwo sections from file">;
  82. def strip_non_alloc
  83. : Flag<["--"], "strip-non-alloc">,
  84. HelpText<"Remove all non-allocated sections outside segments">;
  85. defm strip_unneeded_symbol
  86. : Eq<"strip-unneeded-symbol",
  87. "Remove symbol <symbol> if it is not needed by relocations">,
  88. MetaVarName<"symbol">;
  89. defm strip_unneeded_symbols
  90. : Eq<"strip-unneeded-symbols",
  91. "Reads a list of symbols from <filename> and removes them "
  92. "if they are not needed by relocations">,
  93. MetaVarName<"filename">;
  94. def extract_dwo
  95. : Flag<["--"], "extract-dwo">,
  96. HelpText<
  97. "Remove all sections that are not DWARF .dwo sections from file">;
  98. defm extract_partition
  99. : Eq<"extract-partition", "Extract named partition from input file">,
  100. MetaVarName<"name">;
  101. def extract_main_partition
  102. : Flag<["--"], "extract-main-partition">,
  103. HelpText<"Extract main partition from the input file">;
  104. def localize_hidden
  105. : Flag<["--"], "localize-hidden">,
  106. HelpText<
  107. "Mark all symbols that have hidden or internal visibility as local">;
  108. defm localize_symbol : Eq<"localize-symbol", "Mark <symbol> as local">,
  109. MetaVarName<"symbol">;
  110. defm localize_symbols
  111. : Eq<"localize-symbols",
  112. "Reads a list of symbols from <filename> and marks them local.">,
  113. MetaVarName<"filename">;
  114. def L : JoinedOrSeparate<["-"], "L">,
  115. Alias<localize_symbol>,
  116. HelpText<"Alias for --localize-symbol">;
  117. defm globalize_symbol : Eq<"globalize-symbol", "Mark <symbol> as global">,
  118. MetaVarName<"symbol">;
  119. defm globalize_symbols
  120. : Eq<"globalize-symbols",
  121. "Reads a list of symbols from <filename> and marks them global.">,
  122. MetaVarName<"filename">;
  123. defm keep_global_symbol
  124. : Eq<"keep-global-symbol",
  125. "Convert all symbols except <symbol> to local. May be repeated to "
  126. "convert all except a set of symbols to local.">,
  127. MetaVarName<"symbol">;
  128. def G : JoinedOrSeparate<["-"], "G">,
  129. Alias<keep_global_symbol>,
  130. HelpText<"Alias for --keep-global-symbol">;
  131. defm keep_global_symbols
  132. : Eq<"keep-global-symbols",
  133. "Reads a list of symbols from <filename> and runs as if "
  134. "--keep-global-symbol=<symbol> is set for each one. <filename> "
  135. "contains one symbol per line and may contain comments beginning with "
  136. "'#'. Leading and trailing whitespace is stripped from each line. May "
  137. "be repeated to read symbols from many files.">,
  138. MetaVarName<"filename">;
  139. defm weaken_symbol : Eq<"weaken-symbol", "Mark <symbol> as weak">,
  140. MetaVarName<"symbol">;
  141. defm weaken_symbols
  142. : Eq<"weaken-symbols",
  143. "Reads a list of symbols from <filename> and marks them weak.">,
  144. MetaVarName<"filename">;
  145. def W : JoinedOrSeparate<["-"], "W">,
  146. Alias<weaken_symbol>,
  147. HelpText<"Alias for --weaken-symbol">;
  148. def weaken : Flag<["--"], "weaken">,
  149. HelpText<"Mark all global symbols as weak">;
  150. defm strip_symbols
  151. : Eq<"strip-symbols",
  152. "Reads a list of symbols from <filename> and removes them.">,
  153. MetaVarName<"filename">;
  154. defm keep_symbols
  155. : Eq<"keep-symbols",
  156. "Reads a list of symbols from <filename> and runs as if "
  157. "--keep-symbol=<symbol> is set for each one. <filename> "
  158. "contains one symbol per line and may contain comments beginning with "
  159. "'#'. Leading and trailing whitespace is stripped from each line. May "
  160. "be repeated to read symbols from many files.">,
  161. MetaVarName<"filename">;
  162. defm dump_section
  163. : Eq<"dump-section",
  164. "Dump contents of section named <section> into file <file>">,
  165. MetaVarName<"section=file">;
  166. defm prefix_symbols
  167. : Eq<"prefix-symbols", "Add <prefix> to the start of every symbol name">,
  168. MetaVarName<"prefix">;
  169. defm prefix_alloc_sections
  170. : Eq<"prefix-alloc-sections", "Add <prefix> to the start of every allocated section name">,
  171. MetaVarName<"prefix">;
  172. defm build_id_link_dir
  173. : Eq<"build-id-link-dir", "Set directory for --build-id-link-input and "
  174. "--build-id-link-output to <dir>">,
  175. MetaVarName<"dir">;
  176. defm build_id_link_input
  177. : Eq<"build-id-link-input", "Hard-link the input to <dir>/xx/xxx<suffix> "
  178. "name derived from hex build ID">,
  179. MetaVarName<"suffix">;
  180. defm build_id_link_output
  181. : Eq<"build-id-link-output", "Hard-link the output to <dir>/xx/xxx<suffix> "
  182. "name derived from hex build ID">,
  183. MetaVarName<"suffix">;
  184. defm set_start : Eq<"set-start", "Set the start address to <addr>. Overrides "
  185. "any previous --change-start or --adjust-start values.">,
  186. MetaVarName<"addr">;
  187. defm change_start : Eq<"change-start", "Add <incr> to the start address. Can be "
  188. "specified multiple times, all values will be applied "
  189. "cumulatively.">,
  190. MetaVarName<"incr">;
  191. def adjust_start : JoinedOrSeparate<["--"], "adjust-start">,
  192. Alias<change_start>,
  193. HelpText<"Alias for --change-start">;
  194. defm add_symbol
  195. : Eq<"add-symbol", "Add new symbol <name> to .symtab. Accepted flags: "
  196. "global, local, weak, default, hidden, protected, file, section, object, "
  197. "function, indirect-function. Accepted but ignored for "
  198. "compatibility: debug, constructor, warning, indirect, synthetic, "
  199. "unique-object, before.">,
  200. MetaVarName<"name=[section:]value[,flags]">;