Thread (14 messages) 14 messages, 4 authors, 2023-03-10

Re: [PATCH v2] vdso: Improve cmd_vdso_check to check all dynamic relocations

From: Fangrui Song <hidden>
Date: 2023-01-27 23:19:43
Also in: linux-arm-kernel, linux-mips, linux-riscv, linux-s390, lkml, loongarch

On Thu, Dec 29, 2022 at 11:22 AM Palmer Dabbelt [off-list ref] wrote:
On Wed, 21 Dec 2022 15:51:47 PST (-0800), maskray@google.com wrote:
quoted
The actual intention is that no dynamic relocation exists. However, some
GNU ld ports produce unneeded R_*_NONE. (If a port fails to determine
the exact .rel[a].dyn size, the trailing zeros become R_*_NONE
relocations. E.g. ld's powerpc port recently fixed
https://sourceware.org/bugzilla/show_bug.cgi?id=29540) R_*_NONE are
generally no-op in the dynamic loaders. So just ignore them.

With the change, we can remove ARCH_REL_TYPE_ABS. ARCH_REL_TYPE_ABS is a
bit misnomer as ports may check RELAVETIVE/GLOB_DAT/JUMP_SLOT which are
not called "absolute relocations". (The patch is motivated by the arm64
port missing R_AARCH64_RELATIVE.)

Signed-off-by: Fangrui Song <redacted>
Reviewed-by: Christophe Leroy <redacted>
---
Change from v1:
* rebase after 8ac3b5cd3e0521d92f9755e90d140382fc292510 (lib/vdso: use "grep -E" instead of "egrep")
* change the commit message to mention an example GNU ld bug; no longer say the patch fixes a deprecated egrep use
---
  arch/arm/vdso/Makefile            |  3 ---
  arch/arm64/kernel/vdso/Makefile   |  3 ---
  arch/arm64/kernel/vdso32/Makefile |  3 ---
  arch/csky/kernel/vdso/Makefile    |  3 ---
  arch/loongarch/vdso/Makefile      |  3 ---
  arch/mips/vdso/Makefile           |  3 ---
  arch/powerpc/kernel/vdso/Makefile |  1 -
  arch/riscv/kernel/vdso/Makefile   |  3 ---
  arch/s390/kernel/vdso32/Makefile  |  2 --
  arch/s390/kernel/vdso64/Makefile  |  2 --
  arch/x86/entry/vdso/Makefile      |  4 ----
  lib/vdso/Makefile                 | 13 ++++---------
  12 files changed, 4 insertions(+), 39 deletions(-)
[snip]
quoted
diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
index 06e6b27f3bcc..d85c37e11b21 100644
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@ -1,9 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0-only
  # Copied from arch/tile/kernel/vdso/Makefile

-# Absolute relocation type $(ARCH_REL_TYPE_ABS) needs to be defined before
-# the inclusion of generic Makefile.
-ARCH_REL_TYPE_ABS := R_RISCV_32|R_RISCV_64|R_RISCV_JUMP_SLOT
  include $(srctree)/lib/vdso/Makefile
  # Symbols present in the vdso
  vdso-syms  = rt_sigreturn
Acked-by: Palmer Dabbelt <redacted> # RISC-V

Thanks!
Looks like this patch hasn't been picked yet...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help