riscv: Change the relocations handled for RTLD_BOOTSTRAP
authorFangrui Song <maskray@google.com>
Thu, 16 Jun 2022 01:42:03 +0000 (18:42 -0700)
committerFangrui Song <maskray@google.com>
Thu, 16 Jun 2022 01:42:03 +0000 (18:42 -0700)
commit57919813e732dff2c6cfd1c95056cbc265058bc2
tree5b354599bdf496f4fd7b360e019c103d20c616da
parent89a25c6f64746732b87eaf433af0964b564d4a92
riscv: Change the relocations handled for RTLD_BOOTSTRAP

The RTLD_BOOTSTRAP branch is used to relocate ld.so itself.  It only
needs to handle RELATIVE, GLOB_DAT, and the symbolic relocation type
(R_RISCV_{32,64}).  NONE and IRELATIVE can be removed.

The code relies on ld.so having DT_RELACOUNT so that the RTLD_BOOTSTRAP
branch does not need handle RELATIVE.  Drop this minor size
optimization for clarity.

Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
sysdeps/riscv/dl-machine.h