Next: PowerPC64 ELF64, Previous: Nios II, Up: Machine Dependent
Branches on PowerPC processors are limited to a signed 26-bit displacement, which may result in ld giving ‘relocation truncated to fit’ errors with very large programs. ‘--relax’ enables the generation of trampolines that can access the entire 32-bit address space. These trampolines are inserted at section boundaries, so may not themselves be reachable if an input section exceeds 33M in size. You may combine ‘-r’ and ‘--relax’ to add trampolines in a partial link. In that case both branches to undefined symbols and inter-section branches are also considered potentially out of range, and trampolines inserted.
.plt
must change because the new secure PLT is an initialized
section while the old PLT is uninitialized. The reason for the
.got
change is more subtle: The new placement allows
.got
to be read-only in applications linked with
‘-z relro -z now’. However, this placement means that
.sdata
cannot always be used in shared libraries, because the
PowerPC ABI accesses .sdata
in shared libraries from the GOT
pointer. ‘--sdata-got’ forces the old GOT placement. PowerPC
GCC doesn't use .sdata
in shared libraries, so this option is
really only useful for other compilers that may do so.