2015-07-25 05:03:07 +08:00
|
|
|
include "llvm/Option/OptParser.td"
|
|
|
|
|
2016-06-21 07:10:40 +08:00
|
|
|
// For options whose names are multiple letters, either one dash or
|
|
|
|
// two can precede the option name except those that start with 'o'.
|
2016-06-21 16:45:50 +08:00
|
|
|
class F<string name>: Flag<["--", "-"], name>;
|
|
|
|
class J<string name>: Joined<["--", "-"], name>;
|
|
|
|
class S<string name>: Separate<["--", "-"], name>;
|
|
|
|
class JS<string name>: JoinedOrSeparate<["--", "-"], name>;
|
2015-10-14 05:02:34 +08:00
|
|
|
|
2016-09-02 17:13:05 +08:00
|
|
|
def auxiliary: S<"auxiliary">, HelpText<"Set DT_AUXILIARY field to the specified name">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def Bsymbolic: F<"Bsymbolic">, HelpText<"Bind defined symbols locally">;
|
ELF: Implement --build-id.
This patch implements --build-id. After the linker creates an output file
in the memory buffer, it computes the FNV1 hash of the resulting file
and set the hash to the .note section as a build-id.
GNU ld and gold have the same feature, but their default choice of the
hash function is different. Their default is SHA1.
We made a deliberate choice to not use a secure hash function for the
sake of performance. Computing a secure hash is slow -- for example,
MD5 throughput is usually 400 MB/s or so. SHA1 is slower than that.
As a result, if you pass --build-id to gold, then the linker becomes about
10% slower than that without the option. We observed a similar degradation
in an experimental implementation of build-id for LLD. On the other hand,
we observed only 1-2% performance degradation with the FNV hash.
Since build-id is not for digital certificate or anything, we think that
a very small probability of collision is acceptable.
We considered using other signals such as using input file timestamps as
inputs to a secure hash function. But such signals would have an issue
with build reproducibility (if you build a binary from the same source
tree using the same toolchain, the build id should become the same.)
GNU linkers accepts --build-id=<style> option where style is one of
"MD5", "SHA1", or an arbitrary hex string. That option is out of scope
of this patch.
http://reviews.llvm.org/D18091
llvm-svn: 263292
2016-03-12 04:51:53 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def Bsymbolic_functions: F<"Bsymbolic-functions">,
|
|
|
|
HelpText<"Bind defined function symbols locally">;
|
2016-04-08 06:49:21 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">;
|
|
|
|
|
|
|
|
def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">;
|
|
|
|
|
|
|
|
def build_id: F<"build-id">, HelpText<"Generate build ID note">;
|
|
|
|
|
|
|
|
def build_id_eq: J<"build-id=">, HelpText<"Generate build ID note">;
|
|
|
|
|
2016-06-30 16:43:23 +08:00
|
|
|
def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
|
2016-05-27 12:48:26 +08:00
|
|
|
HelpText<"Add a directory to the library search path">;
|
2015-09-12 06:42:45 +08:00
|
|
|
|
2016-06-30 16:43:23 +08:00
|
|
|
def O: Joined<["-"], "O">, HelpText<"Optimize output file size">;
|
2016-06-21 16:45:50 +08:00
|
|
|
|
2016-11-03 20:49:25 +08:00
|
|
|
def Tbss: S<"Tbss">, HelpText<"Same as --section-start with .bss as the sectionname">;
|
2016-09-14 21:07:13 +08:00
|
|
|
|
2016-11-03 20:49:25 +08:00
|
|
|
def Tdata: S<"Tdata">, HelpText<"Same as --section-start with .data as the sectionname">;
|
2016-09-14 21:07:13 +08:00
|
|
|
|
2016-11-03 20:49:25 +08:00
|
|
|
def Ttext: S<"Ttext">, HelpText<"Same as --section-start with .text as the sectionname">;
|
2016-09-14 21:07:13 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def allow_multiple_definition: F<"allow-multiple-definition">,
|
|
|
|
HelpText<"Allow multiple definitions">;
|
|
|
|
|
|
|
|
def as_needed: F<"as-needed">,
|
|
|
|
HelpText<"Only set DT_NEEDED for shared libraries if used">;
|
2015-10-24 03:02:19 +08:00
|
|
|
|
2016-12-22 16:20:28 +08:00
|
|
|
def color_diagnostics: F<"color-diagnostics">,
|
|
|
|
HelpText<"Use colors in diagnostics">;
|
|
|
|
|
|
|
|
def color_diagnostics_eq: J<"color-diagnostics=">,
|
2016-11-26 04:27:32 +08:00
|
|
|
HelpText<"Use colors in diagnostics">;
|
|
|
|
|
2017-01-24 11:41:20 +08:00
|
|
|
def define_common: F<"define-common">,
|
|
|
|
HelpText<"Assign space to common symbols">;
|
|
|
|
|
2017-01-15 11:45:46 +08:00
|
|
|
def demangle: F<"demangle">, HelpText<"Demangle symbol names">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def disable_new_dtags: F<"disable-new-dtags">,
|
|
|
|
HelpText<"Disable new dynamic tags">;
|
2015-09-23 07:38:23 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def discard_all: F<"discard-all">, HelpText<"Delete all local symbols">;
|
|
|
|
|
|
|
|
def discard_locals: F<"discard-locals">,
|
|
|
|
HelpText<"Delete temporary local symbols">;
|
|
|
|
|
|
|
|
def discard_none: F<"discard-none">,
|
|
|
|
HelpText<"Keep all symbols in the symbol table">;
|
|
|
|
|
|
|
|
def dynamic_linker: S<"dynamic-linker">,
|
2015-10-01 08:33:02 +08:00
|
|
|
HelpText<"Which dynamic linker to use">;
|
2015-09-26 03:24:57 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def dynamic_list: S<"dynamic-list">,
|
2016-04-14 02:51:11 +08:00
|
|
|
HelpText<"Read a list of dynamic symbols">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def eh_frame_hdr: F<"eh-frame-hdr">,
|
|
|
|
HelpText<"Request creation of .eh_frame_hdr section and PT_GNU_EH_FRAME segment header">;
|
2016-04-08 03:24:51 +08:00
|
|
|
|
2017-02-09 00:18:10 +08:00
|
|
|
def emit_relocs: F<"emit-relocs">, HelpText<"Generate relocations in output">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def enable_new_dtags: F<"enable-new-dtags">,
|
|
|
|
HelpText<"Enable new dynamic tags">;
|
|
|
|
|
|
|
|
def end_lib: F<"end-lib">,
|
|
|
|
HelpText<"End a grouping of objects that should be treated as if they were together in an archive">;
|
|
|
|
|
|
|
|
def entry: S<"entry">, MetaVarName<"<entry>">,
|
2015-10-01 08:33:02 +08:00
|
|
|
HelpText<"Name of entry point symbol">;
|
2015-09-24 23:08:23 +08:00
|
|
|
|
2016-11-24 02:15:37 +08:00
|
|
|
def error_limit: S<"error-limit">,
|
|
|
|
HelpText<"Maximum number of errors to emit before stopping (0 = no limit)">;
|
|
|
|
|
2017-01-26 10:19:20 +08:00
|
|
|
def error_undef: F<"error-unresolved-symbols">,
|
|
|
|
HelpText<"Report unresolved symbols as errors">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def export_dynamic: F<"export-dynamic">,
|
|
|
|
HelpText<"Put symbols in the dynamic symbol table">;
|
2015-09-28 20:52:21 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def export_dynamic_symbol: S<"export-dynamic-symbol">,
|
2016-04-23 02:44:06 +08:00
|
|
|
HelpText<"Put a symbol in the dynamic symbol table">;
|
|
|
|
|
2016-07-04 21:43:12 +08:00
|
|
|
def fatal_warnings: F<"fatal-warnings">,
|
|
|
|
HelpText<"Treat warnings as errors">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def fini: S<"fini">, MetaVarName<"<symbol>">,
|
2015-10-05 18:29:46 +08:00
|
|
|
HelpText<"Specify a finalizer function">;
|
|
|
|
|
2016-10-27 02:59:00 +08:00
|
|
|
def full_shutdown : F<"full-shutdown">,
|
|
|
|
HelpText<"Perform a full shutdown instead of calling _exit">;
|
|
|
|
|
2016-09-10 06:08:04 +08:00
|
|
|
def format: J<"format=">, MetaVarName<"<input-format>">,
|
|
|
|
HelpText<"Change the input format of the inputs following this option">;
|
|
|
|
|
2016-09-07 19:43:18 +08:00
|
|
|
def gc_sections: F<"gc-sections">,
|
|
|
|
HelpText<"Enable garbage collection of unused sections">;
|
|
|
|
|
2016-10-20 17:19:48 +08:00
|
|
|
def gdb_index: F<"gdb-index">,
|
|
|
|
HelpText<"Generate .gdb_index section">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def hash_style: S<"hash-style">,
|
2015-10-22 16:21:35 +08:00
|
|
|
HelpText<"Specify hash style (sysv, gnu or both)">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def help: F<"help">, HelpText<"Print option help">;
|
|
|
|
|
|
|
|
def icf: F<"icf=all">, HelpText<"Enable identical code folding">;
|
ELF2: Implement --gc-sections.
Section garbage collection is a feature to remove unused sections
from outputs. Unused sections are sections that cannot be reachable
from known GC-root symbols or sections. Naturally the feature is
implemented as a mark-sweep garbage collector.
In this patch, I added Live bit to InputSectionBase. If and only
if Live bit is on, the section will be written to the output.
Starting from GC-root symbols or sections, a new function, markLive(),
visits all reachable sections and sets their Live bits. Writer then
ignores sections whose Live bit is off, so that such sections are
excluded from the output.
This change has small negative impact on performance if you use
the feature because making sections means more work. The time to
link Clang changes from 0.356s to 0.386s, or +8%.
It reduces Clang size from 57,764,984 bytes to 55,296,600 bytes.
That is 4.3% reduction.
http://reviews.llvm.org/D13950
llvm-svn: 251043
2015-10-23 02:49:53 +08:00
|
|
|
|
2016-07-13 03:37:53 +08:00
|
|
|
def image_base : J<"image-base=">, HelpText<"Set the base address">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def init: S<"init">, MetaVarName<"<symbol>">,
|
2015-10-05 18:29:46 +08:00
|
|
|
HelpText<"Specify an initializer function">;
|
|
|
|
|
2016-06-30 16:43:23 +08:00
|
|
|
def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">,
|
2015-10-01 08:33:02 +08:00
|
|
|
HelpText<"Root name of library to use">;
|
2015-09-29 04:30:11 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def lto_O: J<"lto-O">, MetaVarName<"<opt-level>">,
|
2016-04-01 05:00:27 +08:00
|
|
|
HelpText<"Optimization level for LTO">;
|
|
|
|
|
2016-06-30 16:43:23 +08:00
|
|
|
def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
|
2016-06-21 16:45:50 +08:00
|
|
|
|
2017-01-15 10:52:14 +08:00
|
|
|
def Map: JS<"Map">, HelpText<"Print a link map to the specified file">;
|
2017-01-14 05:05:46 +08:00
|
|
|
|
2016-09-03 03:20:33 +08:00
|
|
|
def nostdlib: F<"nostdlib">,
|
|
|
|
HelpText<"Only search directories specified on the command line">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def no_as_needed: F<"no-as-needed">,
|
|
|
|
HelpText<"Always DT_NEEDED for shared libraries">;
|
|
|
|
|
2016-11-26 04:27:32 +08:00
|
|
|
def no_color_diagnostics: F<"no-color-diagnostics">,
|
|
|
|
HelpText<"Do not use colors in diagnostics">;
|
|
|
|
|
2017-01-24 11:41:20 +08:00
|
|
|
def no_define_common: F<"no-define-common">,
|
|
|
|
HelpText<"Do not assign space to common symbols">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def no_demangle: F<"no-demangle">,
|
|
|
|
HelpText<"Do not demangle symbol names">;
|
|
|
|
|
2017-02-24 16:26:18 +08:00
|
|
|
def no_dynamic_linker: F<"no-dynamic-linker">,
|
|
|
|
HelpText<"Inhibit output of .interp section">;
|
|
|
|
|
2017-01-15 11:38:55 +08:00
|
|
|
def no_export_dynamic: F<"no-export-dynamic">;
|
|
|
|
def no_fatal_warnings: F<"no-fatal-warnings">;
|
|
|
|
|
2016-09-07 02:28:49 +08:00
|
|
|
def no_gc_sections: F<"no-gc-sections">,
|
|
|
|
HelpText<"Disable garbage collection of unused sections">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def no_gnu_unique: F<"no-gnu-unique">,
|
|
|
|
HelpText<"Disable STB_GNU_UNIQUE symbol binding">;
|
|
|
|
|
2016-11-16 09:39:50 +08:00
|
|
|
def no_threads: F<"no-threads">,
|
|
|
|
HelpText<"Do not run the linker multi-threaded">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def no_whole_archive: F<"no-whole-archive">,
|
|
|
|
HelpText<"Restores the default behavior of loading archive members">;
|
|
|
|
|
|
|
|
def noinhibit_exec: F<"noinhibit-exec">,
|
|
|
|
HelpText<"Retain the executable output file whenever it is still usable">;
|
2015-10-07 17:13:03 +08:00
|
|
|
|
2016-10-17 22:42:11 +08:00
|
|
|
def nopie: F<"nopie">, HelpText<"Do not create a position independent executable">;
|
|
|
|
|
2016-11-28 18:05:20 +08:00
|
|
|
def no_rosegment: F<"no-rosegment">, HelpText<"Do not put read-only non-executable sections in their own segment">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def no_undefined: F<"no-undefined">,
|
|
|
|
HelpText<"Report unresolved symbols even if the linker is creating a shared library">;
|
2015-10-02 04:14:45 +08:00
|
|
|
|
2016-06-28 16:07:26 +08:00
|
|
|
def no_undefined_version: F<"no-undefined-version">,
|
|
|
|
HelpText<"Report version scripts that refer undefined symbols">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
|
2015-10-01 08:33:02 +08:00
|
|
|
HelpText<"Path to file to write output">;
|
2015-09-28 20:52:21 +08:00
|
|
|
|
2016-08-25 17:05:47 +08:00
|
|
|
def oformat: Separate<["--"], "oformat">, MetaVarName<"<format>">,
|
|
|
|
HelpText<"Specify the binary format for the output object file">;
|
2016-08-25 18:39:04 +08:00
|
|
|
|
2017-03-11 05:22:28 +08:00
|
|
|
def omagic: Flag<["--"], "omagic">, MetaVarName<"<magic>">,
|
2016-11-29 17:43:51 +08:00
|
|
|
HelpText<"Set the text and data sections to be readable and writable">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def pie: F<"pie">, HelpText<"Create a position independent executable">;
|
2015-12-10 17:12:18 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def print_gc_sections: F<"print-gc-sections">,
|
|
|
|
HelpText<"List removed unused sections">;
|
|
|
|
|
2017-01-15 10:52:34 +08:00
|
|
|
def print_map: F<"print-map">,
|
|
|
|
HelpText<"Print a link map to the standard output">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def reproduce: S<"reproduce">,
|
2016-04-26 08:22:24 +08:00
|
|
|
HelpText<"Dump linker invocation and input files for debugging">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def rpath: S<"rpath">, HelpText<"Add a DT_RUNPATH to the output">;
|
|
|
|
|
|
|
|
def relocatable: F<"relocatable">, HelpText<"Create relocatable object file">;
|
|
|
|
|
2016-12-20 02:00:52 +08:00
|
|
|
def retain_symbols_file: J<"retain-symbols-file=">, MetaVarName<"<file>">,
|
|
|
|
HelpText<"Retain only the symbols listed in the file">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def script: S<"script">, HelpText<"Read linker script">;
|
2015-09-28 20:52:21 +08:00
|
|
|
|
2016-09-14 21:07:13 +08:00
|
|
|
def section_start: S<"section-start">, MetaVarName<"<address>">,
|
|
|
|
HelpText<"Set address of section">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def shared: F<"shared">, HelpText<"Build a shared object">;
|
2015-11-13 02:54:15 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def soname: J<"soname=">, HelpText<"Set DT_SONAME">;
|
2015-10-11 11:53:36 +08:00
|
|
|
|
2016-09-17 04:21:55 +08:00
|
|
|
def sort_section: S<"sort-section">, HelpText<"Specifies sections sorting rule when linkerscript is used">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def start_lib: F<"start-lib">,
|
|
|
|
HelpText<"Start a grouping of objects that should be treated as if they were together in an archive">;
|
2015-09-28 23:01:59 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def strip_all: F<"strip-all">, HelpText<"Strip all symbols">;
|
2015-10-02 03:36:04 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def strip_debug: F<"strip-debug">, HelpText<"Strip debugging information">;
|
2016-04-08 05:04:51 +08:00
|
|
|
|
2016-11-10 17:05:20 +08:00
|
|
|
def symbol_ordering_file: S<"symbol-ordering-file">,
|
|
|
|
HelpText<"Layout sections in the order specified by symbol file">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def sysroot: J<"sysroot=">, HelpText<"Set the system root">;
|
2015-10-01 08:33:02 +08:00
|
|
|
|
2016-08-02 03:28:13 +08:00
|
|
|
def target1_rel: F<"target1-rel">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_REL32">;
|
|
|
|
|
|
|
|
def target1_abs: F<"target1-abs">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_ABS32">;
|
|
|
|
|
2016-11-23 04:15:35 +08:00
|
|
|
def target2: J<"target2=">, MetaVarName<"<type>">, HelpText<"Interpret R_ARM_TARGET2 as <type>, where <type> is one of rel, abs, or got-rel">;
|
2016-10-18 02:12:24 +08:00
|
|
|
|
2016-11-16 09:39:50 +08:00
|
|
|
def threads: F<"threads">, HelpText<"Run the linker multi-threaded">;
|
2016-03-29 16:45:40 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def trace: F<"trace">, HelpText<"Print the names of the input files">;
|
|
|
|
|
2017-02-02 10:21:47 +08:00
|
|
|
def trace_symbol : S<"trace-symbol">, HelpText<"Trace references to symbols">;
|
2016-06-23 15:00:17 +08:00
|
|
|
|
2016-09-09 04:35:29 +08:00
|
|
|
def undefined: S<"undefined">,
|
2015-10-05 17:43:57 +08:00
|
|
|
HelpText<"Force undefined symbol during linking">;
|
|
|
|
|
2016-06-29 20:35:04 +08:00
|
|
|
def unresolved_symbols: J<"unresolved-symbols=">,
|
|
|
|
HelpText<"Determine how to handle unresolved symbols">;
|
|
|
|
|
2016-07-07 05:24:34 +08:00
|
|
|
def rsp_quoting: J<"rsp-quoting=">,
|
|
|
|
HelpText<"Quoting style for response files. Values supported: windows|posix">;
|
|
|
|
|
2016-11-20 02:14:24 +08:00
|
|
|
def v: Flag<["-"], "v">, HelpText<"Display the version number">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def verbose: F<"verbose">, HelpText<"Verbose mode">;
|
|
|
|
|
2016-11-20 02:14:24 +08:00
|
|
|
def version: F<"version">, HelpText<"Display the version number and exit">;
|
2016-02-28 11:18:07 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def version_script: S<"version-script">,
|
2016-04-23 04:21:26 +08:00
|
|
|
HelpText<"Read a version script">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def warn_common: F<"warn-common">,
|
|
|
|
HelpText<"Warn about duplicate common symbols">;
|
|
|
|
|
2017-01-26 10:19:20 +08:00
|
|
|
def warn_undef: F<"warn-unresolved-symbols">,
|
|
|
|
HelpText<"Report unresolved symbols as warnings">;
|
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def whole_archive: F<"whole-archive">,
|
|
|
|
HelpText<"Force load of all members in a static library">;
|
2015-10-02 02:02:21 +08:00
|
|
|
|
2016-06-21 16:45:50 +08:00
|
|
|
def wrap: S<"wrap">, MetaVarName<"<symbol>">,
|
2016-01-08 01:20:07 +08:00
|
|
|
HelpText<"Use wrapper functions for symbol">;
|
|
|
|
|
2016-06-30 16:43:23 +08:00
|
|
|
def z: JoinedOrSeparate<["-"], "z">, MetaVarName<"<option>">,
|
2015-10-07 23:00:21 +08:00
|
|
|
HelpText<"Linker option extensions">;
|
|
|
|
|
2015-10-01 08:33:02 +08:00
|
|
|
// Aliases
|
2016-11-10 22:48:39 +08:00
|
|
|
def alias_auxiliary: Separate<["-"], "f">, Alias<auxiliary>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_Bdynamic_call_shared: F<"call_shared">, Alias<Bdynamic>;
|
|
|
|
def alias_Bdynamic_dy: F<"dy">, Alias<Bdynamic>;
|
|
|
|
def alias_Bstatic_dn: F<"dn">, Alias<Bstatic>;
|
|
|
|
def alias_Bstatic_non_shared: F<"non_shared">, Alias<Bstatic>;
|
|
|
|
def alias_Bstatic_static: F<"static">, Alias<Bstatic>;
|
|
|
|
def alias_L__library_path: J<"library-path=">, Alias<L>;
|
2017-01-24 11:41:20 +08:00
|
|
|
def alias_define_common_d: Flag<["-"], "d">, Alias<define_common>;
|
|
|
|
def alias_define_common_dc: F<"dc">, Alias<define_common>;
|
|
|
|
def alias_define_common_dp: F<"dp">, Alias<define_common>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_discard_all_x: Flag<["-"], "x">, Alias<discard_all>;
|
|
|
|
def alias_discard_locals_X: Flag<["-"], "X">, Alias<discard_locals>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_dynamic_list: J<"dynamic-list=">, Alias<dynamic_list>;
|
2017-02-09 00:18:10 +08:00
|
|
|
def alias_emit_relocs: Flag<["-"], "q">, Alias<emit_relocs>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
|
2016-07-05 05:50:50 +08:00
|
|
|
def alias_entry_entry: J<"entry=">, Alias<entry>;
|
2016-11-24 02:15:37 +08:00
|
|
|
def alias_error_limit: J<"error-limit=">, Alias<error_limit>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_export_dynamic_E: Flag<["-"], "E">, Alias<export_dynamic>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_export_dynamic_symbol: J<"export-dynamic-symbol=">,
|
|
|
|
Alias<export_dynamic_symbol>;
|
|
|
|
def alias_fini_fini: J<"fini=">, Alias<fini>;
|
2016-09-10 06:08:04 +08:00
|
|
|
def alias_format_b: S<"b">, Alias<format>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_hash_style_hash_style: J<"hash-style=">, Alias<hash_style>;
|
|
|
|
def alias_init_init: J<"init=">, Alias<init>;
|
|
|
|
def alias_l__library: J<"library=">, Alias<l>;
|
2017-01-14 05:05:46 +08:00
|
|
|
def alias_Map_eq: J<"Map=">, Alias<Map>;
|
2016-11-29 17:43:51 +08:00
|
|
|
def alias_omagic: Flag<["-"], "N">, Alias<omagic>;
|
2016-09-09 08:25:56 +08:00
|
|
|
def alias_o_output: Joined<["--"], "output=">, Alias<o>;
|
|
|
|
def alias_o_output2 : Separate<["--"], "output">, Alias<o>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_pie_pic_executable: F<"pic-executable">, Alias<pie>;
|
2017-01-15 10:52:34 +08:00
|
|
|
def alias_print_map_M: Flag<["-"], "M">, Alias<print_map>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_relocatable_r: Flag<["-"], "r">, Alias<relocatable>;
|
2016-12-20 02:00:52 +08:00
|
|
|
def alias_retain_symbols_file: S<"retain-symbols-file">, Alias<retain_symbols_file>;
|
2016-11-10 00:38:15 +08:00
|
|
|
def alias_rpath_R: JoinedOrSeparate<["-"], "R">, Alias<rpath>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_rpath_rpath: J<"rpath=">, Alias<rpath>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_script_T: JoinedOrSeparate<["-"], "T">, Alias<script>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_shared_Bshareable: F<"Bshareable">, Alias<shared>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_soname_h: JoinedOrSeparate<["-"], "h">, Alias<soname>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_soname_soname: S<"soname">, Alias<soname>;
|
2016-12-16 19:59:52 +08:00
|
|
|
def alias_sort_section: J<"sort-section=">, Alias<sort_section>;
|
2016-11-23 06:54:03 +08:00
|
|
|
def alias_script: J<"script=">, Alias<script>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_strip_all: Flag<["-"], "s">, Alias<strip_all>;
|
|
|
|
def alias_strip_debug_S: Flag<["-"], "S">, Alias<strip_debug>;
|
2016-11-03 00:06:00 +08:00
|
|
|
def alias_Tbss: J<"Tbss=">, Alias<Tbss>;
|
|
|
|
def alias_Tdata: J<"Tdata=">, Alias<Tdata>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_trace: Flag<["-"], "t">, Alias<trace>;
|
2017-02-02 10:21:47 +08:00
|
|
|
def trace_trace_symbol_eq : J<"trace-symbol=">, Alias<trace_symbol>;
|
2016-06-30 16:43:23 +08:00
|
|
|
def alias_trace_symbol_y : JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>;
|
2016-11-03 00:06:00 +08:00
|
|
|
def alias_Ttext: J<"Ttext=">, Alias<Ttext>;
|
2016-12-16 00:12:34 +08:00
|
|
|
def alias_Ttext_segment: S<"Ttext-segment">, Alias<Ttext>;
|
|
|
|
def alias_Ttext_segment_eq: J<"Ttext-segment=">, Alias<Ttext>;
|
2016-09-09 04:35:29 +08:00
|
|
|
def alias_undefined_eq: J<"undefined=">, Alias<undefined>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_undefined_u: JoinedOrSeparate<["-"], "u">, Alias<undefined>;
|
2016-06-27 15:35:00 +08:00
|
|
|
def alias_version_V: Flag<["-"], "V">, Alias<version>;
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_wrap_wrap: J<"wrap=">, Alias<wrap>;
|
2015-10-01 08:24:54 +08:00
|
|
|
|
2015-11-14 02:56:07 +08:00
|
|
|
// Our symbol resolution algorithm handles symbols in archive files differently
|
2015-11-13 08:26:12 +08:00
|
|
|
// than traditional linkers, so we don't need --start-group and --end-group.
|
2015-11-14 02:56:07 +08:00
|
|
|
// These options are recongized for compatibility but ignored.
|
2016-06-21 16:45:50 +08:00
|
|
|
def end_group: F<"end-group">;
|
2016-06-30 16:43:23 +08:00
|
|
|
def end_group_paren: Flag<["-"], ")">;
|
2016-06-21 16:45:50 +08:00
|
|
|
def start_group: F<"start-group">;
|
2016-06-30 16:43:23 +08:00
|
|
|
def start_group_paren: Flag<["-"], "(">;
|
2015-11-13 08:26:12 +08:00
|
|
|
|
2016-03-19 08:40:09 +08:00
|
|
|
// Ignore LTO plugin-related options.
|
|
|
|
// clang -flto passes -plugin and -plugin-opt to the linker. This is required
|
|
|
|
// for ld.gold and ld.bfd to get LTO working. But it's not for lld which doesn't
|
|
|
|
// rely on a plugin. Instead of detecting which linker is used on clang side we
|
|
|
|
// just ignore the option on lld side as it's easier. In fact, the linker could
|
|
|
|
// be called 'ld' and understanding which linker is used would require parsing of
|
|
|
|
// --version output.
|
2016-06-21 16:45:50 +08:00
|
|
|
def plugin: S<"plugin">;
|
|
|
|
def plugin_eq: J<"plugin=">;
|
|
|
|
def plugin_opt: S<"plugin-opt">;
|
|
|
|
def plugin_opt_eq: J<"plugin-opt=">;
|
2016-03-19 08:40:09 +08:00
|
|
|
|
2015-11-13 08:26:12 +08:00
|
|
|
// Options listed below are silently ignored for now for compatibility.
|
2016-06-21 16:45:50 +08:00
|
|
|
def allow_shlib_undefined: F<"allow-shlib-undefined">;
|
2016-11-14 22:45:11 +08:00
|
|
|
def cref: Flag<["--"], "cref">;
|
2016-06-21 16:45:50 +08:00
|
|
|
def detect_odr_violations: F<"detect-odr-violations">;
|
2016-08-03 06:14:00 +08:00
|
|
|
def g: Flag<["-"], "g">;
|
2016-06-21 16:45:50 +08:00
|
|
|
def no_add_needed: F<"no-add-needed">;
|
|
|
|
def no_allow_shlib_undefined: F<"no-allow-shlib-undefined">;
|
|
|
|
def no_copy_dt_needed_entries: F<"no-copy-dt-needed-entries">,
|
|
|
|
Alias<no_add_needed>;
|
|
|
|
def no_mmap_output_file: F<"no-mmap-output-file">;
|
|
|
|
def no_warn_common: F<"no-warn-common">;
|
|
|
|
def no_warn_mismatch: F<"no-warn-mismatch">;
|
|
|
|
def rpath_link: S<"rpath-link">;
|
|
|
|
def rpath_link_eq: J<"rpath-link=">;
|
2016-06-27 10:43:27 +08:00
|
|
|
def sort_common: F<"sort-common">;
|
2016-11-09 16:59:59 +08:00
|
|
|
def stats: F<"stats">;
|
2016-06-21 16:45:50 +08:00
|
|
|
def warn_execstack: F<"warn-execstack">;
|
|
|
|
def warn_shared_textrel: F<"warn-shared-textrel">;
|
2016-08-18 20:44:45 +08:00
|
|
|
def EB : F<"EB">;
|
|
|
|
def EL : F<"EL">;
|
2016-08-17 00:26:46 +08:00
|
|
|
def G: JoinedOrSeparate<["-"], "G">;
|
2016-09-08 05:10:25 +08:00
|
|
|
def Qy : F<"Qy">;
|
2015-12-10 22:08:45 +08:00
|
|
|
|
|
|
|
// Aliases for ignored options
|
2016-06-21 16:45:50 +08:00
|
|
|
def alias_version_script_version_script: J<"version-script=">,
|
|
|
|
Alias<version_script>;
|
2016-03-10 04:01:08 +08:00
|
|
|
|
2016-04-16 06:38:10 +08:00
|
|
|
// LTO-related options.
|
2016-06-21 16:45:50 +08:00
|
|
|
def lto_aa_pipeline: J<"lto-aa-pipeline=">,
|
2016-06-03 06:58:11 +08:00
|
|
|
HelpText<"AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes">;
|
2016-06-21 16:45:50 +08:00
|
|
|
def lto_newpm_passes: J<"lto-newpm-passes=">,
|
2016-05-16 03:29:38 +08:00
|
|
|
HelpText<"Passes to run during LTO">;
|
2016-10-11 07:12:14 +08:00
|
|
|
def lto_partitions: J<"lto-partitions=">,
|
|
|
|
HelpText<"Number of LTO codegen partitions">;
|
2016-06-21 16:45:50 +08:00
|
|
|
def disable_verify: F<"disable-verify">;
|
|
|
|
def mllvm: S<"mllvm">;
|
2017-03-11 05:22:28 +08:00
|
|
|
def opt_remarks_filename: Separate<["--"], "opt-remarks-filename">,
|
2017-02-14 01:49:18 +08:00
|
|
|
HelpText<"YAML output file for optimization remarks">;
|
2017-03-11 05:22:28 +08:00
|
|
|
def opt_remarks_with_hotness: Flag<["--"], "opt-remarks-with-hotness">,
|
2017-02-14 01:49:18 +08:00
|
|
|
HelpText<"Include hotness informations in the optimization remarks file">;
|
2016-06-21 16:45:50 +08:00
|
|
|
def save_temps: F<"save-temps">;
|
2017-03-02 07:00:10 +08:00
|
|
|
def thinlto_cache_dir: J<"thinlto-cache-dir=">,
|
|
|
|
HelpText<"Path to ThinLTO cached object file directory">;
|
2017-03-17 10:24:16 +08:00
|
|
|
def thinlto_cache_policy: S<"thinlto-cache-policy">,
|
|
|
|
HelpText<"Pruning policy for the ThinLTO cache">;
|
2016-10-11 07:12:14 +08:00
|
|
|
def thinlto_jobs: J<"thinlto-jobs=">, HelpText<"Number of ThinLTO jobs">;
|