ObjcopyOpts.td 9.1 KB

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