Options.td 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. //===- Options.td ---------------------------------------------------------===//
  2. //
  3. // The MCLinker Project
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. include "llvm/Option/OptParser.td"
  10. //===----------------------------------------------------------------------===//
  11. // Dynamic
  12. //===----------------------------------------------------------------------===//
  13. def DynamicGroup : OptionGroup<"dynamic">,
  14. HelpText<"DYNAMIC OPTIONS">;
  15. def Entry : Joined<["--"], "entry=">,
  16. Group<DynamicGroup>,
  17. HelpText<"Use the explicit symbol as the entrance of your program">;
  18. def EntryAlias : Separate<["-"], "e">,
  19. Alias<Entry>;
  20. def Bsymbolic : Flag<["-"], "Bsymbolic">,
  21. Group<DynamicGroup>,
  22. HelpText<"Bind references within the shared library">;
  23. def Bgroup : Flag<["-"], "Bgroup">,
  24. Group<DynamicGroup>,
  25. HelpText<"Info the dynamic linker to lookup only inside the group">;
  26. def SOName : Joined<["-"], "soname=">,
  27. Group<DynamicGroup>,
  28. HelpText<"Set internal name of shared library">;
  29. def SONameAlias : Separate<["-"], "soname">,
  30. Group<DynamicGroup>,
  31. Alias<SOName>;
  32. def NoUndef : Flag<["--"], "no-undefined">,
  33. Group<DynamicGroup>,
  34. HelpText<"Do not allow unresolved references">;
  35. def AllowMulDefs : Flag<["--"], "allow-multiple-definition">,
  36. Group<DynamicGroup>,
  37. HelpText<"Allow multiple definitions">;
  38. def Z : Separate<["-"], "z">,
  39. Group<DynamicGroup>,
  40. HelpText<"Extensions for GNU ld compatibility">;
  41. def Dyld : Joined<["--"], "dynamic-linker=">,
  42. Group<DynamicGroup>,
  43. HelpText<"Set the name of the dynamic linker">;
  44. def DyldAlias : Separate<["-"], "dynamic-linker">,
  45. Group<DynamicGroup>,
  46. Alias<Dyld>;
  47. def EnableNewDTags : Flag<["--"], "enable-new-dtags">,
  48. Group<DynamicGroup>,
  49. HelpText<"Enable use of DT_RUNPATH and DT_FLAGS">;
  50. def SpareDTags: Separate<["--"], "spare-dynamic-tags">,
  51. Group<DynamicGroup>,
  52. HelpText<"Set the number of spare dyanmic tags (DT_NULL)">;
  53. //===----------------------------------------------------------------------===//
  54. // Optimization
  55. //===----------------------------------------------------------------------===//
  56. def OptimizationGroup : OptionGroup<"optimization">,
  57. HelpText<"OPTIMIZATION OPTIONS">;
  58. def GCSections : Flag<["--"], "gc-sections">,
  59. Group<OptimizationGroup>,
  60. HelpText<"Enable garbage collection of unused input sections">;
  61. def NoGCSections : Flag<["--"], "no-gc-sections">,
  62. Group<OptimizationGroup>,
  63. HelpText<"Disable garbage collection of unused input sections">;
  64. def PrintGCSections : Flag<["--"], "print-gc-sections">,
  65. Group<OptimizationGroup>,
  66. HelpText<"List all sections removed by garbage collection">;
  67. def NoPrintGCSections : Flag<["--"], "no-print-gc-sections">,
  68. Group<OptimizationGroup>,
  69. HelpText<"Do not list sections removed by garbage collection">;
  70. def LDGeneratedUnwindInfo : Flag<["--"], "ld-generated-unwind-info">,
  71. Group<OptimizationGroup>,
  72. HelpText<"Request creation of unwind info for linker generated code sections like PLT">;
  73. def NoLDGeneratedUnwindInfo : Flag<["--"], "no-ld-generated-unwind-info">,
  74. Group<OptimizationGroup>,
  75. HelpText<"Don't create unwind info for linker generated sections to save size">;
  76. def ICF : Joined<["--"], "icf=">,
  77. Group<OptimizationGroup>,
  78. HelpText<"Identical Code Folding">;
  79. def ICFIters : Separate<["--"], "icf-iterations">,
  80. Group<OptimizationGroup>,
  81. HelpText<"Set number of iterations to do ICF">;
  82. def PrintICFSections : Flag<["--"], "print-icf-sections">,
  83. Group<OptimizationGroup>,
  84. HelpText<"List all sections folded by ICF">;
  85. def NoPrintICFSections : Flag<["--"], "no-print-icf-sections">,
  86. Group<OptimizationGroup>,
  87. HelpText<"Do not list sections folded by ICF">;
  88. //===----------------------------------------------------------------------===//
  89. // Output
  90. //===----------------------------------------------------------------------===//
  91. def OutputGroup : OptionGroup<"output">,
  92. HelpText<"OUTPUT OPTIONS">;
  93. def Output : Separate<["-"], "o">,
  94. Group<OutputGroup>,
  95. HelpText<"Output filename">;
  96. def OutputAlias : Joined<["--"], "output=">,
  97. Group<OutputGroup>,
  98. Alias<Output>;
  99. def OutputFormat: Joined<["--"], "oformat=">,
  100. Group<OutputGroup>,
  101. HelpText<"Output format">;
  102. def Shared : Flag<["-"], "shared">,
  103. Group<OutputGroup>,
  104. HelpText<"Create a shared library">;
  105. def Bshareable : Flag<["-"], "Bshareable">,
  106. Group<OutputGroup>,
  107. Alias<Shared>;
  108. def Bdynamic : Flag<["-"], "Bdynamic">,
  109. Group<OutputGroup>,
  110. HelpText<"Link against dynamic library">;
  111. def BdynamicAlias1 : Flag<["-"], "dy">,
  112. Group<OutputGroup>,
  113. Alias<Bdynamic>;
  114. def BdynamicAlias2 : Flag<["-"], "call_shared">,
  115. Group<OutputGroup>,
  116. Alias<Bdynamic>;
  117. def Bstatic : Flag<["-"], "Bstatic">,
  118. Group<OutputGroup>,
  119. HelpText<"Link against static library">;
  120. def BstaticAlias1 : Flag<["-"], "dn">,
  121. Group<OutputGroup>,
  122. Alias<Bstatic>;
  123. def BstaticAlias2 : Flag<["-"], "non_shared">,
  124. Group<OutputGroup>,
  125. Alias<Bstatic>;
  126. def BstaticAlias3 : Flag<["-"], "static">,
  127. Group<OutputGroup>,
  128. Alias<Bstatic>;
  129. def PIE : Flag<["-"], "pie">,
  130. Group<OutputGroup>,
  131. HelpText<"Emit a position-independent executable file">;
  132. def PICExec : Flag<["--"], "pic-executable">,
  133. Group<OutputGroup>,
  134. Alias<PIE>;
  135. def Relocatable : Flag<["--"], "relocatable">,
  136. Group<OutputGroup>,
  137. HelpText<"Generate relocatable output">;
  138. def RelocatableAlias : Flag<["-"], "r">,
  139. Group<OutputGroup>,
  140. Alias<Relocatable>;
  141. def InputFormat : Joined<["--"], "format=">,
  142. Group<OutputGroup>,
  143. HelpText<"Specify the binary format for input object files that follow this option on the command line">;
  144. def InputFormatAlias : Separate<["-"], "b">,
  145. Group<OutputGroup>,
  146. Alias<InputFormat>;
  147. def StripDebug : Flag<["--"], "strip-debug">,
  148. Group<OutputGroup>,
  149. HelpText<"Omit debugger symbol information from the output file">;
  150. def StripDebugAlias : Flag<["-"], "S">,
  151. Group<OutputGroup>,
  152. Alias<StripDebug>;
  153. def StripAll : Flag<["--"], "strip-all">,
  154. Group<OutputGroup>,
  155. HelpText<"Omit all symbol information from the output file">;
  156. def StripAllAlias : Flag<["-"], "s">,
  157. Group<OutputGroup>,
  158. Alias<StripAll>;
  159. def DiscardLocals : Flag<["--"], "discard-debug">,
  160. Group<OutputGroup>,
  161. HelpText<"Discard all temporary local symbols">;
  162. def DiscardLocalsAlias : Flag<["-"], "X">,
  163. Group<OutputGroup>,
  164. Alias<DiscardLocals>;
  165. def DiscardAll : Flag<["--"], "discard-all">,
  166. Group<OutputGroup>,
  167. HelpText<"Discard all local symbols">;
  168. def DiscardAllAlias : Flag<["-"], "x">,
  169. Group<OutputGroup>,
  170. Alias<DiscardAll>;
  171. def EHFrameHdr : Flag<["--"], "eh-frame-hdr">,
  172. Group<OutputGroup>,
  173. HelpText<"Request creation of .eh_frame_hdr section and PT_GNU_EH_FRAME segment">;
  174. def NMagic : Flag<["--"], "nmagic">,
  175. Group<OutputGroup>,
  176. HelpText<"Do not page align data">;
  177. def NMagicAlias : Flag<["-"], "n">,
  178. Group<OutputGroup>,
  179. Alias<NMagic>;
  180. def OMagic : Flag<["--"], "omagic">,
  181. Group<OutputGroup>,
  182. HelpText<"Do not page align data, do not make text readonly">;
  183. def OMagicAlias : Flag<["-"], "N">,
  184. Group<OutputGroup>,
  185. Alias<OMagic>;
  186. def HashStyle : Joined<["--"], "hash-style=">,
  187. Group<OutputGroup>,
  188. HelpText<"Set the type of linker's hash table(s)">;
  189. def ExportDynamic : Flag<["--"], "export-dynamic">,
  190. Group<OutputGroup>,
  191. HelpText<"Export all dynamic symbols">;
  192. def ExportDynamicAlias : Flag<["-"], "E">,
  193. Group<OutputGroup>,
  194. Alias<ExportDynamic>;
  195. def NoExportDynamic : Flag<["--"], "no-export-dynamic">,
  196. Group<OutputGroup>,
  197. HelpText<"Not export all dynamic symbols">;
  198. def NoWarnMismatch : Flag<["--"], "no-warn-mismatch">,
  199. Group<OutputGroup>,
  200. HelpText<"Allow linking together mismatched input files">;
  201. def ExcludeLibs : Separate<["--"], "exclude-libs">,
  202. Group<OutputGroup>,
  203. HelpText<"Allow linking together mismatched input files">;
  204. //===----------------------------------------------------------------------===//
  205. // Positional
  206. //===----------------------------------------------------------------------===//
  207. def PositionalGroup : OptionGroup<"positional">,
  208. HelpText<"POSITIONAL OPTIONS">;
  209. def Script : Joined<["--"], "script=">,
  210. Group<PositionalGroup>,
  211. HelpText<"Use the given file as the linker script">;
  212. def ScriptAlias : Separate<["-"], "T">,
  213. Group<PositionalGroup>,
  214. Alias<Script>;
  215. def Namespec : Joined<["--"], "library=">,
  216. Group<PositionalGroup>,
  217. HelpText<"Add the archive or object file specified by namespec to the list of files to link">;
  218. def NamespecAlias : Joined<["-"], "l">,
  219. Group<PositionalGroup>,
  220. Alias<Namespec>;
  221. def WholeArchive : Flag<["--"], "whole-archive">,
  222. Group<PositionalGroup>,
  223. HelpText<"Include every object file in the archive in the link">;
  224. def NoWholeArchive : Flag<["--"], "no-whole-archive">,
  225. Group<PositionalGroup>,
  226. HelpText<"Turn off the effect of the --whole-archive option">;
  227. def AsNeeded : Flag<["--"], "as-needed">,
  228. Group<PositionalGroup>,
  229. HelpText<"Add the dynamic libraries mentioned to DT_NEEDED where there is "
  230. "a non-weak undefined symbol reference from">;
  231. def NoAsNeeded : Flag<["--"], "no-as-needed">,
  232. Group<PositionalGroup>,
  233. HelpText<"Turn off the effect of the --as-needed">;
  234. def AddNeeded : Flag<["--"], "add-needed">,
  235. Group<PositionalGroup>,
  236. HelpText<"Deprecated">;
  237. def NoAddNeeded : Flag<["--"], "no-add-needed">,
  238. Group<PositionalGroup>,
  239. HelpText<"Deprecated">;
  240. def CopyDTNeeded : Flag<["--"], "copy-dt-needed-entries">,
  241. Group<PositionalGroup>,
  242. HelpText<"Add the dynamic libraries mentioned to DT_NEEDED">;
  243. def NoCopyDTNeeded : Flag<["--"], "no-copy-dt-needed-entries">,
  244. Group<PositionalGroup>,
  245. HelpText<"Turn off the effect of the --copy-dt-needed-entries">;
  246. def StartGroup : Flag<["--"], "start-group">,
  247. Group<PositionalGroup>,
  248. HelpText<"Start to record a group of archives">;
  249. def StartGroupAlias : Flag<["-"], "(">,
  250. Group<PositionalGroup>,
  251. Alias<StartGroup>;
  252. def EndGroup : Flag<["--"], "end-group">,
  253. Group<PositionalGroup>,
  254. HelpText<"Stop recording a group of archives">;
  255. def EndGroupAlias : Flag<["-"], ")">,
  256. Group<PositionalGroup>,
  257. Alias<EndGroup>;
  258. //===----------------------------------------------------------------------===//
  259. // Preference
  260. //===----------------------------------------------------------------------===//
  261. def PreferenceGroup : OptionGroup<"preference">,
  262. HelpText<"PREFERENCE OPTIONS">;
  263. def Color : Joined<["--"], "color=">,
  264. Group<PreferenceGroup>,
  265. HelpText<"Surround the result strings with the marker">;
  266. def Trace : Flag<["--"], "trace">,
  267. Group<PreferenceGroup>,
  268. HelpText<"Print the names of the input files as ld processes them">;
  269. def TraceAlias : Flag<["-"], "t">,
  270. Group<PreferenceGroup>,
  271. Alias<Trace>;
  272. def Help : Flag<["-", "--"], "help">,
  273. Group<PreferenceGroup>,
  274. HelpText<"Display available options (to standard output)">;
  275. def HelpAlias : Flag<["-"], "h">,
  276. Group<PreferenceGroup>,
  277. Alias<Help>;
  278. def Verbose : Joined<["--"], "verbose=">,
  279. Group<PreferenceGroup>,
  280. HelpText<"Set linker diagnostic output level">;
  281. def Version : Flag<["--"], "version">,
  282. Group<PreferenceGroup>,
  283. HelpText<"Display MCLinker version">;
  284. def VersionAlias1 : Flag<["-"], "v">,
  285. Group<PreferenceGroup>,
  286. Alias<Version>;
  287. def VersionAlias2 : Flag<["-"], "V">,
  288. Group<PreferenceGroup>,
  289. Alias<Version>;
  290. def ErrorLimit : Joined<["--"], "error-limit=">,
  291. Group<PreferenceGroup>,
  292. HelpText<"Set the maximum limit of errors">;
  293. def WarningLimit : Joined<["--"], "warning-limit=">,
  294. Group<PreferenceGroup>,
  295. HelpText<"Set the maximum limit of warnings">;
  296. def FatalWarnings : Flag<["--"], "fatal-warnings">,
  297. Group<PreferenceGroup>,
  298. HelpText<"Turn all warnings into errors">;
  299. def NoFatalWarnings : Flag<["--"], "no-fatal-warnings">,
  300. Group<PreferenceGroup>,
  301. HelpText<"Do not turn all warnings into errors">;
  302. def WarnSharedTextrel : Flag<["--"], "warn-shared-textrel">,
  303. Group<PreferenceGroup>,
  304. HelpText<"Warn if there is a text relocation in the output shared object">;
  305. //===----------------------------------------------------------------------===//
  306. // Script
  307. //===----------------------------------------------------------------------===//
  308. def ScriptGroup : OptionGroup<"script">,
  309. HelpText<"SCRIPT OPTIONS">;
  310. def DefSym : Joined<["--"], "defsym=">,
  311. Group<ScriptGroup>,
  312. HelpText<"Define a symbol">;
  313. def Wrap : Joined<["--"], "wrap=">,
  314. Group<ScriptGroup>,
  315. HelpText<"Use a wrap function for the symbol">;
  316. def Portable : Joined<["--"], "portable=">,
  317. Group<ScriptGroup>,
  318. HelpText<"Use a portable function for the symbol">;
  319. def SectionStart : Joined<["--"], "section-start=">,
  320. Group<ScriptGroup>,
  321. HelpText<"Locate a output section at the given absolute address">;
  322. def Tbss : Joined<["-"], "Tbss=">,
  323. Group<ScriptGroup>,
  324. HelpText<"Set the address of the bss segment">;
  325. def Tdata : Joined<["-"], "Tdata=">,
  326. Group<ScriptGroup>,
  327. HelpText<"Set the address of the data segment">;
  328. def Ttext : Joined<["-"], "Ttext=">,
  329. Group<ScriptGroup>,
  330. HelpText<"Set the address of the text segment">;
  331. //===----------------------------------------------------------------------===//
  332. // Search Path
  333. //===----------------------------------------------------------------------===//
  334. def SearchpathGroup : OptionGroup<"searchpath">,
  335. HelpText<"SEARCHPATH OPTIONS">;
  336. def Sysroot : Joined<["--"], "sysroot=">,
  337. Group<SearchpathGroup>,
  338. HelpText<"Use the given directory as the location of the sysroot">;
  339. def LibraryPath : Joined<["--"], "library-path=">,
  340. Group<SearchpathGroup>,
  341. HelpText<"Add the given directory to the list of search paths">;
  342. def LibraryPathAlias : Joined<["-"], "L">,
  343. Group<SearchpathGroup>,
  344. Alias<LibraryPath>;
  345. def NoStdlib : Flag<["-"], "nostdlib">,
  346. Group<SearchpathGroup>,
  347. HelpText<"Only search lib dirs explicitly specified on cmdline">;
  348. def RPath : Joined<["-"], "rpath=">,
  349. Group<SearchpathGroup>,
  350. HelpText<"Add a directory to the runtime library search path">;
  351. //===----------------------------------------------------------------------===//
  352. // Symbol
  353. //===----------------------------------------------------------------------===//
  354. def SymbolGroup : OptionGroup<"symbol">,
  355. HelpText<"SYMBOL OPTIONS">;
  356. def Undefined : Joined<["--"], "undefined=">,
  357. Group<SymbolGroup>,
  358. HelpText<"Force symbol to be undefined in the output file">;
  359. def UndefinedAlias : Separate<["-"], "u">,
  360. Group<SymbolGroup>,
  361. Alias<Undefined>;
  362. def DefineCommon : Flag<["-"], "d">,
  363. Group<SymbolGroup>,
  364. HelpText<"Define common symbol">;
  365. def DefineCommonAlias1 : Flag<["-"], "dc">,
  366. Group<SymbolGroup>,
  367. Alias<DefineCommon>;
  368. def DefineCommonAlias2 : Flag<["-"], "dp">,
  369. Group<SymbolGroup>,
  370. Alias<DefineCommon>;
  371. //===----------------------------------------------------------------------===//
  372. // Target
  373. //===----------------------------------------------------------------------===//
  374. def TargetGroup : OptionGroup<"target">,
  375. HelpText<"TARGET OPTIONS">;
  376. def GPSize : Joined<["--"], "gpsize=">,
  377. Group<TargetGroup>,
  378. HelpText<"Set the maximum size of objects to be optimized using GP">;
  379. def GPSizeAlias : Separate<["-"], "G">,
  380. Group<TargetGroup>,
  381. Alias<GPSize>;
  382. def Triple : Joined<["-"], "mtriple=">,
  383. Group<TargetGroup>,
  384. HelpText<"Override target triple for module">;
  385. def Arch : Joined<["-"], "march=">,
  386. Group<TargetGroup>,
  387. HelpText<"Architecture to generate code for">;
  388. def CPU : Joined<["-"], "mcpu=">,
  389. Group<TargetGroup>,
  390. HelpText<"Set a specific cpu type">;
  391. def Emulation : Separate<["-"], "m">,
  392. Group<TargetGroup>,
  393. HelpText<"Set GNU linker emulation">;
  394. def StubGroupSize : Joined<["--"], "stub-group-size=">,
  395. Group<TargetGroup>,
  396. HelpText<"Set the group size to place stubs between sections">;
  397. def FixCA53Erratum835769 : Flag<["--"], "fix-cortex-a53-835769">,
  398. Group<TargetGroup>,
  399. HelpText<"Enable fix for cortex a53 erratum 835769">;
  400. def FixCA53Erratum843419 : Flag<["--"], "fix-cortex-a53-843419">,
  401. Group<TargetGroup>,
  402. HelpText<"Enable fix for cortex a53 erratum 843419">;