Note that ‘--stub-group-size’ does not split input sections. A single input section larger than the group size specified will of course create a larger group (of one section). If input sections are too large, it may not be possible for a branch to reach its stub.
__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.
.opd
section entries
corresponding to deleted link-once functions, or functions removed by
the action of ‘--gc-sections’ or linker script /DISCARD/
.
Use this option to disable .opd
optimization.
.opd
entries spaced 16 bytes apart, overlapping the third word,
the static chain pointer (unused in C) with the first word of the next
entry. This option expands such entries to the full 24 bytes.
.toc
section
entries. Such entries are detected by examining relocations that
reference the TOC in code sections. A reloc in a deleted code section
marks a TOC word as unneeded, while a reloc in a kept code section
marks a TOC word as needed. Since the TOC may reference itself, TOC
relocs are also examined. TOC words marked as both needed and
unneeded will of course be kept. TOC words without any referencing
reloc are assumed to be part of a multi-word entry, and are kept or
discarded as per the nearest marked preceding word. This works
reliably for compiler generated code, but may be incorrect if assembly
code is used to insert TOC entries. Use this option to disable the
optimization.
-mcmodel=medium
or
-mcmodel=large
, PowerPC64 GCC generates code for a TOC model
where TOC
entries are accessed with a 16-bit offset from r2. This limits the
total TOC size to 64K. PowerPC64 ld extends this limit by
grouping code sections such that each group uses less than 64K for its
TOC entries, then inserts r2 adjusting stubs between inter-group
calls. ld does not split apart input sections, so cannot
help if a single input file has a .toc
section that exceeds
64K, most likely from linking multiple files with ld -r.
Use this option to turn off this feature.
.init
or .fini
are
placed first, followed by TOC sections referenced by code generated
with PowerPC64 gcc's -mcmodel=small
, and lastly TOC sections
referenced only by code generated with PowerPC64 gcc's
-mcmodel=medium
or -mcmodel=large
options. Doing this
results in better TOC grouping for multi-TOC. Use this option to turn
off this feature.
--plt-align=
. Note
that this isn't alignment in the usual sense. By default PLT call
stubs are packed tightly.
ld
defaults to not loading the static
chain since there is never any need to do so on a PLT call.
ld
looks for calls to commonly used functions that create threads, and if
seen, adds the necessary barriers. Use these options to change the
default behaviour.