[lld] [ELF] AArch64: Handle DT_AARCH64_VARIANT_PCS
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 10 Dec 2020 14:06:49 +0000 (14:06 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 17 Dec 2020 14:09:55 +0000 (11:09 -0300)
commit978eb3b87bca0837d52d096c343fc70b06d9a04d
treeb3dbb6ce48a0f05172ab251c7476f81dea1b9be8
parente04dc5f557c585f19d5abc73d1e71af81e8d5243
[lld] [ELF] AArch64: Handle DT_AARCH64_VARIANT_PCS

As indicated by AArch64 ELF specification, symbols with st_other
marked with STO_AARCH64_VARIANT_PCS indicates it may follow a variant
procedure call standard with different register usage convention
(for instance SVE calls).

Static linkers must preserve the marking and propagate it to the dynamic
symbol table if any reference or definition of the symbol is marked with
STO_AARCH64_VARIANT_PCS, and add a DT_AARCH64_VARIANT_PCS dynamic tag if
there are R_<CLS>_JUMP_SLOT relocations that reference that symbols.

It implements https://bugs.llvm.org/show_bug.cgi?id=48368.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D93045
lld/ELF/SyntheticSections.cpp
lld/test/ELF/aarch64-variant_pcs.s [new file with mode: 0644]