Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6179467rwl; Thu, 29 Dec 2022 08:36:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXtyZ7A0c/dx+MfMLduMAAZj3xewO++LPboY6fM5MfyF8EjJ2ULGpD03cL5rzYdPh6cSCMmy X-Received: by 2002:a17:907:9a85:b0:81b:fc79:be51 with SMTP id km5-20020a1709079a8500b0081bfc79be51mr24729909ejc.50.1672331782284; Thu, 29 Dec 2022 08:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672331782; cv=none; d=google.com; s=arc-20160816; b=CHuHY0nLcJzW8tRCZ8vBt2Gum1deYhp5mDPYNiy/PtQ+CbtnpTXVysTC+a9mR93j3a 5I+8hRgCPltZ9QMyi0MZAD7IhsC4sndjIq8JWpUAeiBx2ehQJqqemWi95sbvcYnKexC4 vn1E3K1GOU2O6SMAKpbuO3NROr2QDF9VlPwSUbiTq+Tvv6+tb5LoMyi3cS4j4ZaMKaiU I0t1G4X1/IZLrYfhlEWOXm6MLSYHdlLN/Qp7HSVjk8baz2hqNX/Jt0eeaXbu9Rpc2SMB WGDiWRfvJpDC2GwE1CIzLtX45TvuOkjVmuiamh0Y9sYuHiVt1cOblC2vjVBaM7/g7gY/ D9yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=lGyrD0+PhkAL5dbAeObFs9RwoqBo5ONG0NwovuaDsrM=; b=r3AGezNLR/9a8e9eYQABs6j6kjLhmyRBazUpU64DGz3JDe8yjR42c+YhFrVkpezZUc biqKRrfgP1p7VTvsM5Ew+5VgByyFUvjP/qn8zTU0LyrSAcY1S2HyV21TIL/fN4g6pJ6a pZgerLH5LvLVT7vHegY6XaNpCjsWqoWXq4SjgffKukn9B/I/hV70XEUQIcIeLHHGPkkL oyOvuaPAws6zu5+ZvmjndIZMUUe5kE+Zj2tJWZKrJFsjnZvkTomPAZoS32DmS2wxduz9 sRO96hbaeJ2OmEvqFL7g0KpZH9W45E5kkqgCvhXsoaNoi5wChNVrDGgBCzoXhN3+eRj2 M1uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=dahVygbd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a056402354d00b00478215c1d6esi17854164edd.553.2022.12.29.08.36.08; Thu, 29 Dec 2022 08:36:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=dahVygbd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233730AbiL2QW4 (ORCPT + 61 others); Thu, 29 Dec 2022 11:22:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233657AbiL2QW1 (ORCPT ); Thu, 29 Dec 2022 11:22:27 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2FAA13DD4 for ; Thu, 29 Dec 2022 08:22:25 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id s67so3349696pgs.3 for ; Thu, 29 Dec 2022 08:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=lGyrD0+PhkAL5dbAeObFs9RwoqBo5ONG0NwovuaDsrM=; b=dahVygbdXamhJiKEgN7Jyg1lXYgvfTSo1DMUkYl6yXrdIMvfnyRS0HpjAJGhYD3IFg E+JY0GnUUwwkM2h9ox2Zgy/UxJJ4gx7kMRbUi8BoQs1MkH7ANMKs27AnO7PEO784TqXp ruuAqGepnkn93qVt3OFjdbG1AsqdvffnpusA3lSTC6zFKd8HiqB0qYg9fELjUJN4UbO/ 3lnm7IU3UfXKaT3AUgnmQMHaYpOZ2VZND7TcbraC5FIjkTHVAEIVzHPRo5TQwNIMJbMP q3kZJpTtujX11O+tGSd8oHpehkbK7CbScXp9TvIT0cj2FcWn3tOzaHwI3gNMSd/9wBDx rNGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lGyrD0+PhkAL5dbAeObFs9RwoqBo5ONG0NwovuaDsrM=; b=5I+JMHTGBp/kr9QA0SZgySyHn5bnfQvqyOlrfgATBx+OqtFPkDQr+BPN45cKxuOklg DPPXhGCbzs0AlRvde/NQhwEXKqtFOPABYONHr08/nImWmsJWEOeZvm92OtqKswtLrMM2 me8RF5ZxKbHsYV8WZLSEL5chnW5qFKUaqk9HVIXkGHxibuR3RobBRgGl5AgFLGzGiYFk pGjuDUXr9kjmaImTIMeMSIDkGKmlsck0U4j/wmRrWDXFo/3kLBTCtPLpHEF+O/GQQ37y EaUU9xYoYaXIqwd8dQyBFZYolv6FruQLEnVCxuWpDGx2LwhRNG9fVQ7Zf3ap/CUwUNuu hPYA== X-Gm-Message-State: AFqh2kogJq5IrR02oE/eNZuUi2Wa1HD1Vw1oVwoyFZ0yVA9CXmh6bm2g xP3nkeaix5v1Q6XDxkndAGHRoBw6a5o0aOf8 X-Received: by 2002:aa7:99cb:0:b0:580:d188:f516 with SMTP id v11-20020aa799cb000000b00580d188f516mr22924872pfi.19.1672330945228; Thu, 29 Dec 2022 08:22:25 -0800 (PST) Received: from localhost ([135.180.226.51]) by smtp.gmail.com with ESMTPSA id x185-20020a6286c2000000b0056bfebfa6e4sm12277463pfd.190.2022.12.29.08.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 08:22:24 -0800 (PST) Date: Thu, 29 Dec 2022 08:22:24 -0800 (PST) X-Google-Original-Date: Thu, 29 Dec 2022 07:53:04 PST (-0800) Subject: Re: [PATCH v2] vdso: Improve cmd_vdso_check to check all dynamic relocations In-Reply-To: <20221221235147.45lkqmosndritfpe@google.com> CC: christophe.leroy@csgroup.eu, luto@kernel.org, tglx@linutronix.de, vincenzo.frascino@arm.com, Arnd Bergmann , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-mips@vger.kernel.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org From: Palmer Dabbelt To: maskray@google.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Dec 2022 15:51:47 PST (-0800), maskray@google.com wrote: > 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 > Reviewed-by: Christophe Leroy > --- > 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] > 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 # RISC-V Thanks!