riscv: Resolve symbols directly for symbols with STO_RISCV_VARIANT_CC.
authorHsiangkai Wang <kai.wang@sifive.com>
Tue, 14 Mar 2023 16:25:12 +0000 (00:25 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 28 Apr 2023 14:02:42 +0000 (07:02 -0700)
commit117e8b341c5c0ace8d65feeef136fececb3fdc9c
tree38aa30211c5aee3e6a1f15d3fec86bf18508608c
parent2fa7fd1af733e323fa90d059e2ba60ec965d2cbb
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>
elf/elf.h
manual/platform.texi
sysdeps/riscv/dl-dtprocnum.h [new file with mode: 0644]
sysdeps/riscv/dl-machine.h