1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC.

In some cases, we do not want to go through the resolver for function
calls. For example, functions with vector arguments will use vector
registers to pass arguments. In the resolver, we do not save/restore the
vector argument registers for lazy binding efficiency. To avoid ruining
the vector arguments, functions with vector arguments will not go
through the resolver.

To achieve the goal, we will annotate the function symbols with
STO_RISCV_VARIANT_CC flag and add DT_RISCV_VARIANT_CC tag in the dynamic
section. In the first pass on PLT relocations, we do not set up to call
_dl_runtime_resolve. Instead, we resolve the functions directly.

Signed-off-by: Hsiangkai Wang <kai.wang@sifive.com>
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://inbox.sourceware.org/libc-alpha/20230314162512.35802-1-kito.cheng@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
Hsiangkai Wang
2023-03-15 00:25:12 +08:00
committed by Palmer Dabbelt
parent 2fa7fd1af7
commit 117e8b341c
4 changed files with 60 additions and 0 deletions

View File

@@ -121,6 +121,12 @@ when it is not allowed, the priority is set to medium.
@node RISC-V
@appendixsec RISC-V-specific Facilities
Functions that are lazily bound must be compatible with the standard calling
convention. When a function is annotated with STO_RISCV_VARIANT_CC, it means
this function is not compatible with the standard calling convention. The
dynamic linker will directly resolve it instead of using the lazy binding
mechanism.
Cache management facilities specific to RISC-V systems that implement the Linux
ABI are declared in @file{sys/cachectl.h}.