ObjcopyOpts.td 9.3 KB

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