powerpc: Define USE_PPC64_NOTOC iff compiler supports it

System Internals / glibc - Adhemerval Zanella [linaro.org] - 22 November 2021 17:49 UTC

The @notoc usage only yields an advantage on ISA 3.1+ machine (power10) and for ld.bfd also when it sees pcrel relocations used on the code (generated if compiler targets ISA 3.1+). On bfd case ISA 3.1+ instruction on stubs are used iff linker also sees the new pc-relative relocations (for instance R_PPC64_D34), otherwise it generates default stubs (ppc64_elf_check_relocs:4700).

This patch also help on linkers that do not implement this optimization, since building for older ISA (such as 3.0 / power9) will also trigger power10 stubs generation in the assembly code uses the NOTOC imacro.

Checked on powerpc64le-linux-gnu.

aac54dcd37 powerpc: Define USE_PPC64_NOTOC iff compiler supports it
sysdeps/powerpc/powerpc64/configure | 42 +++++++++++++++++++++-------------
sysdeps/powerpc/powerpc64/configure.ac | 25 +++++++++++++-------
2 files changed, 43 insertions(+), 24 deletions(-)

Upstream: sourceware.org

  • Share