X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Fld.texinfo;h=90194beabf8c57ebb1dd082b3e99af1e00c91001;hb=5fe2850dd96483f176858fd75c098313d5b20bc2;hp=bddf926b3c77cb868bb96841b724d8a15c76d523;hpb=0a61824343c98b9440fe13752f800d65f765c4c1;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/ld.texinfo b/ld/ld.texinfo index bddf926b3c..90194beabf 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -1001,6 +1001,35 @@ with @samp{-Ur}; once the constructor table has been built, it cannot be added to. Use @samp{-Ur} only for the last partial link, and @samp{-r} for the others. +@kindex --orphan-handling=@var{MODE} +@cindex orphan sections +@cindex sections, orphan +@item --orphan-handling=@var{MODE} +Control how orphan sections are handled. An orphan section is one not +specifically mentioned in a linker script. @xref{Orphan Sections}. + +@var{MODE} can have any of the following values: + +@table @code +@item place +Orphan sections are placed into a suitable output section following +the strategy described in @ref{Orphan Sections}. The option +@samp{--unique} also effects how sections are placed. + +@item discard +All orphan sections are discarded, by placing them in the +@samp{/DISCARD/} section (@pxref{Output Section Discarding}). + +@item warn +The linker will place the orphan section as for @code{place} and also +issue a warning. + +@item error +The linker will exit with an error if any orphan section is found. +@end table + +The default if @samp{--orphan-handling} is not given is @code{place}. + @kindex --unique[=@var{SECTION}] @item --unique[=@var{SECTION}] Creates a separate output section for every input section matching @@ -1426,6 +1455,13 @@ generating dynamically linked ELF executables. The default dynamic linker is normally correct; don't use this unless you know what you are doing. +@kindex --no-dynamic-linker +@item --no-dynamic-linker +When producing an executable file, omit the request for a dynamic +linker to be used at load-time. This is only meaningful for ELF +executables that contain dynamic relocations, and usually requires +entry point code that is capable of processing these relocations. + @kindex --fatal-warnings @kindex --no-fatal-warnings @item --fatal-warnings @@ -2105,17 +2141,6 @@ option causes a warning to be issued whenever this case occurs. Only warn once for each undefined symbol, rather than once per module which refers to it. -@kindex --warn-orphan -@kindex --no-warn-orphan -@cindex warnings, on orphan sections -@cindex orphan sections, warnings on -@item --warn-orphan -The @option{--warn-orphan} option tells the linker to generate a -warning message whenever it has to place an orphan section into the -output file. @xref{Orphan Sections}. The @option{--no-warn-orphan} -option restores the default behaviour of just silently placing these -sections. - @kindex --warn-section-align @cindex warnings, on section alignment @cindex section alignment, warnings on @@ -2271,7 +2296,7 @@ enable other tradeoffs in future versions of the linker. @item --build-id @itemx --build-id=@var{style} Request the creation of a @code{.note.gnu.build-id} ELF note section -or a @code{.build-id} COFF section. The contents of the note are +or a @code{.buildid} COFF section. The contents of the note are unique bits identifying this linked file. @var{style} can be @code{uuid} to use 128 random bits, @code{sha1} to use a 160-bit @sc{SHA1} hash on the normative parts of the output contents, @@ -3853,7 +3878,7 @@ linker script contains these declarations: @smallexample @group start_of_ROM = .ROM; - end_of_ROM = .ROM + sizeof (.ROM) - 1; + end_of_ROM = .ROM + sizeof (.ROM); start_of_FLASH = .FLASH; @end group @end smallexample @@ -3869,6 +3894,19 @@ Then the C source code to perform the copy would be: @end smallexample Note the use of the @samp{&} operators. These are correct. +Alternatively the symbols can be treated as the names of vectors or +arrays and then the code will again work as expected: + +@smallexample +@group + extern char start_of_ROM[], end_of_ROM[], start_of_FLASH[]; + + memcpy (start_of_FLASH, start_of_ROM, end_of_ROM - start_of_ROM); +@end group +@end smallexample + +Note how using this method does not require the use of @samp{&} +operators. @node SECTIONS @section SECTIONS Command @@ -5569,6 +5607,10 @@ at the end of the file. For ELF targets, the attribute of the section includes section type as well as section flag. +The command line options @samp{--orphan-handling} and @samp{--unique} +(@pxref{Options,,Command Line Options}) can be used to control which +output sections an orphan is placed in. + If an orphaned section's name is representable as a C identifier then the linker will automatically @pxref{PROVIDE} two symbols: __start_SECNAME and __stop_SECNAME, where SECNAME is the name of the @@ -5992,7 +6034,7 @@ to the next @var{align} boundary. The single operand @code{ALIGN} doesn't change the value of the location counter---it just does arithmetic on it. The two operand @code{ALIGN} allows an arbitrary expression to be aligned upwards (@code{ALIGN(@var{align})} is -equivalent to @code{ALIGN(., @var{align})}). +equivalent to @code{ALIGN(ABSOLUTE(.), @var{align})}). Here is an example which aligns the output @code{.data} section to the next @code{0x2000} byte boundary after the preceding section and sets a @@ -7080,7 +7122,8 @@ symbol that encodes the stub type and destination. @cindex PowerPC64 dot symbols @kindex --dotsyms @kindex --no-dotsyms -@item --dotsyms, --no-dotsyms +@item --dotsyms +@itemx --no-dotsyms These two options control how @command{ld} interprets version patterns in a version script. Older PowerPC64 compilers emitted both a function descriptor symbol with the same name as the function, and a @@ -7091,6 +7134,17 @@ to control both @samp{foo} and @samp{.foo}. The option dot-prefixed patterns. Use @samp{--no-dotsyms} to disable this feature. +@cindex PowerPC64 register save/restore functions +@kindex --save-restore-funcs +@kindex --no-save-restore-funcs +@item --save-restore-funcs +@itemx --no-save-restore-funcs +These two options control whether PowerPC64 @command{ld} automatically +provides out-of-line register save and restore functions used by +@samp{-Os} code. The default is to provide any such referenced +function for a normal final link, and to not do so for a relocatable +link. + @cindex PowerPC64 TLS optimization @kindex --no-tls-optimize @item --no-tls-optimize @@ -7098,6 +7152,22 @@ PowerPC64 @command{ld} normally performs some optimization of code sequences used to access Thread-Local Storage. Use this option to disable the optimization. +@cindex PowerPC64 __tls_get_addr optimization +@kindex --tls-get-addr-optimize +@kindex --no-tls-get-addr-optimize +@item --tls-get-addr-optimize +@itemx --no-tls-get-addr-optimize +These options control whether PowerPC64 @command{ld} uses a special +stub to call __tls_get_addr. PowerPC64 glibc 2.22 and later support +an optimization that allows the second and subsequent calls to +@code{__tls_get_addr} for a given symbol to be resolved by the special +stub without calling in to glibc. By default the linker enables this +option when glibc advertises the availability of __tls_get_addr_opt. +Forcing this option on when using an older glibc won't do much besides +slow down your applications, but may be useful if linking an +application against an older glibc with the expectation that it will +normally be used on systems having a newer glibc. + @cindex PowerPC64 OPD optimization @kindex --no-opd-optimize @item --no-opd-optimize