This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Question on ppc64 and --relax
- From: Alan Modra <amodra at gmail dot com>
- To: Douglas B Rupp <rupp at adacore dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 12 Nov 2018 21:46:15 +1030
- Subject: Re: Question on ppc64 and --relax
- References: <b353d4ed-e4c3-2113-cbfa-b0a511a5d9e6@adacore.com>
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