Question on ppc64 and --relax

Alan Modra amodra@gmail.com
Mon Nov 12 11:16:00 GMT 2018


On Mon, Nov 12, 2018 at 11:56:50AM +0100, Douglas B Rupp wrote:
> Greetings,
> 
> I understand that ppc64 makes function calls through function descriptors,
> but afaict these function descriptors are all output at the beginning of the
> .text section so the range of a function call (without resorting to
> -mlongcall) isn't substantially better than that found on ppc32.

powerpc64 ELFv1 uses function descriptors, placed in the .opd section
which is near other relro sections.  These are used when making calls
via the PLT and when taking the address of a function.  They aren't
used when making a direct call.

powerpc64le ELFv2 doesn't use function descriptors.

GNU ld will add stubs between direct calls that don't reach, for both
ELFv1 and ELFv2.  So will gold.  This works provided you don't make
object file text sections too large (33M is the limit) either with
huge source files (where -ffunction-sections may help) or by mashing
together files with ld -r (in which case don't be so silly).

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list