Index: ELF/Options.td =================================================================== --- ELF/Options.td +++ ELF/Options.td @@ -58,8 +58,8 @@ "Do not allow multiple definitions (default)">; defm apply_dynamic_relocs: B<"apply-dynamic-relocs", - "Apply dynamic relocations to place", - "Do not apply dynamic relocations to place">; + "Apply link-time values for dynamic relocations", + "Do not apply link-time values for dynamic relocations">; defm as_needed: B<"as-needed", "Only set DT_NEEDED for shared libraries if used", Index: docs/ld.lld.1 =================================================================== --- docs/ld.lld.1 +++ docs/ld.lld.1 @@ -30,6 +30,8 @@ .It Fl -allow-multiple-definition Do not error if a symbol is defined multiple times. The first definition will be used. +.It Fl -apply-dynamic-relocs +Apply link-time values for dynamic relocations. .It Fl -as-needed Only set .Dv DT_NEEDED @@ -38,9 +40,9 @@ Set the .Dv DT_AUXILIARY field to the specified name. -.It Fl -Bdynamic +.It Fl -Bdynamic | Fl -dy Link against shared libraries. -.It Fl -Bstatic +.It Fl -Bstatic | Fl -static | Fl -dn Do not link against shared libraries. .It Fl -Bsymbolic-functions Bind defined function symbols locally. @@ -93,7 +95,9 @@ .Cm none or .Cm zlib . -.It Fl -define-common +.It Fl -cref +Output cross reference table. +.It Fl -define-common | Fl d Assign space to common symbols. .It Fl -defsym Ns = Ns Ar symbol Ns = Ns Ar expression Define a symbol alias. @@ -103,13 +107,11 @@ .Ql --defsym=foo=bar or .Ql --defsym=foo=bar+0x100 . -.It Fl -demangle -Demangle symbol names. .It Fl -disable-new-dtags Disable new dynamic tags. -.It Fl -discard-all +.It Fl -discard-all | Fl x Delete all local symbols. -.It Fl -discard-locals +.It Fl -discard-locals | Fl X Delete temporary local symbols. .It Fl -discard-none Keep all symbols in the symbol table. @@ -126,10 +128,8 @@ section and .Dv PT_GNU_EH_FRAME segment header. -.It Fl -emit-relocs +.It Fl -emit-relocs | Fl q Generate relocations in the output. -.It Fl -enable-new-dtags -Enable new dynamic tags. .It Fl -end-lib End a grouping of objects that should be treated as if they were together in an archive. @@ -150,7 +150,7 @@ Put symbols in the dynamic symbol table. .It Fl -fatal-warnings Treat warnings as errors. -.It Fl -filter Ns = Ns Ar value +.It Fl -filter Ns = Ns Ar value | Fl F Ar value Set the .Dv DT_FILTER field to the specified value. @@ -210,7 +210,7 @@ Add a directory to the library search path. .It Fl l Ar libName Root name of library to use. -.It Fl -Map Ns = Ns Ar file +.It Fl -Map Ns = Ns Ar file | Fl M Ar file Print a link map to .Ar file . .It Fl m Ar value @@ -229,8 +229,6 @@ Inhibit output of an .Li .interp section. -.It Fl -no-gc-sections -Disable garbage collection of unused sections. .It Fl -no-gnu-unique Disable STB_GNU_UNIQUE symbol binding. .It Fl -no-rosegment @@ -245,8 +243,6 @@ Restores the default behavior of loading archive members. .It Fl -noinhibit-exec Retain the executable output file whenever it is still usable. -.It Fl -no-pie -Do not create a position independent executable. .It Fl -nostdlib Only search directories specified on the command line. .It Fl -oformat Ns = Ns Ar format @@ -300,7 +296,7 @@ .It Fl -pop-state Undo the effect of .Fl -push-state. -.It Fl -relocatable +.It Fl -relocatable | Fl r Create relocatable object file. .It Fl -reproduce Ns = Ns Ar value Dump linker invocation and input files for debugging. @@ -321,7 +317,7 @@ .Ar file . .It Fl -section-start Ns = Ar section Ns = Ns Ar address Set address of section. -.It Fl -shared +.It Fl -shared | Fl -Bsharable Build a shared object. .It Fl -soname Ns = Ns Ar value Set @@ -333,9 +329,9 @@ .It Fl -start-lib Start a grouping of objects that should be treated as if they were together in an archive. -.It Fl -strip-all +.It Fl -strip-all | Fl s Strip all symbols. -.It Fl -strip-debug +.It Fl -strip-debug | Fl S Strip debugging information. .It Fl -symbol-ordering-file Ns = Ns Ar file Lay out sections in the order specified by @@ -385,7 +381,7 @@ .It Fl -threads Run the linker multi-threaded. This option is enabled by default. -.It Fl -trace-symbol Ns = Ns Ar symbol +.It Fl -trace-symbol Ns = Ns Ar symbol | Fl y Ar symbol Trace references to .Ar symbol . .It Fl -trace @@ -396,22 +392,22 @@ with .Li .text as the sectionname. -.It Fl -undefined Ns = Ns Ar symbol +.It Fl -undefined Ns = Ns Ar symbol | Fl u Ar symbol Force .Ar symbol to be an undefined symbol during linking. .It Fl -unresolved-symbols Ns = Ns Ar value Determine how to handle unresolved symbols. +.It Fl v +Display the version number and proceed with linking if object files are +specified. .It Fl -verbose Verbose mode. +.It Fl -version | Fl V +Display the version number and exit. .It Fl -version-script Ns = Ns Ar file Read version script from .Ar file . -.It Fl V , Fl -version -Display the version number and exit. -.It Fl v -Display the version number and proceed with linking if object files are -specified. .It Fl -warn-backrefs Warn about reverse or cyclic dependencies to or between static archives. This can be used to ensure linker invocation remains compatible with @@ -432,6 +428,10 @@ Stack permissions are recorded in the .Dv PT_GNU_STACK segment. +.It Cm initfirst +Sets the +.Dv DF_1_INITFIRST +flag to indicate the module should be initialized first. .It Cm muldefs Do not error if a symbol is defined multiple times. The first definition will be used.