]> git.ipfire.org Git - thirdparty/glibc.git/commit
aarch64: handle STO_AARCH64_VARIANT_PCS
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 25 Apr 2019 14:35:35 +0000 (15:35 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 12 Jul 2019 09:14:12 +0000 (10:14 +0100)
commit4163c382f05edb5588ae9208c50b90bb4fc12591
tree7a3993ebdd5e32ab4eff213c5342229bf493f331
parent53f48f845c8e4f4fff461c0b537fb4d0228bb0b6
aarch64: handle STO_AARCH64_VARIANT_PCS

Backport of commit 82bc69c012838a381c4167c156a06f4598f34227
and commit 30ba0375464f34e4bf8129f3d3dc14d0c09add17
without using DT_AARCH64_VARIANT_PCS for optimizing the symbol table check.
This is needed so the internal abi between ld.so and libc.so is unchanged.

Avoid lazy binding of symbols that may follow a variant PCS with different
register usage convention from the base PCS.

Currently the lazy binding entry code does not preserve all the registers
required for AdvSIMD and SVE vector calls.  Saving and restoring all
registers unconditionally may break existing binaries, even if they never
use vector calls, because of the larger stack requirement for lazy
resolution, which can be significant on an SVE system.

The solution is to mark all symbols in the symbol table that may follow
a variant PCS so the dynamic linker can handle them specially.  In this
patch such symbols are always resolved at load time, not lazily.

So currently LD_AUDIT for variant PCS symbols are not supported, for that
the _dl_runtime_profile entry needs to be changed e.g. to unconditionally
save/restore all registers (but pass down arg and retval registers to
pltentry/exit callbacks according to the base PCS).

This patch also removes a __builtin_expect from the modified code because
the branch prediction hint did not seem useful.

* sysdeps/aarch64/dl-machine.h (elf_machine_lazy_rel): Check
STO_AARCH64_VARIANT_PCS and bind such symbols at load time.
ChangeLog
sysdeps/aarch64/dl-machine.h