From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC0CCC433E1 for ; Mon, 29 Jun 2020 20:56:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3EE520724 for ; Mon, 29 Jun 2020 20:56:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="EVDjc0Vq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732497AbgF2Uz6 (ORCPT ); Mon, 29 Jun 2020 16:55:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729296AbgF2TNL (ORCPT ); Mon, 29 Jun 2020 15:13:11 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDE45C08EAEF for ; Sun, 28 Jun 2020 23:18:45 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id j4so6691601plk.3 for ; Sun, 28 Jun 2020 23:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4bArInUOY6/vKGVdecpLjfb0/2uC+GzWucHk89/LRTo=; b=EVDjc0VqYgRB2DG2EzHcBoN2SoQ4nLRItPJPDmHm0b1Z1rE2TFzvswTjV0UFJMg0A+ zk7wDPwhAdhR5pkqtDyugtOi4viSQFRF681TEkB9AOAbZShiWouWaRwMeqnrq0qniejQ Np9npLPCvLOYdVSL9z4v5SRp3hcbR0u8c56Q0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4bArInUOY6/vKGVdecpLjfb0/2uC+GzWucHk89/LRTo=; b=CEC/5DNupJFRGO3HF+WYS6zMljHVyfg4uHb1Kmu/1RbahXNB6N/p9J9YF2e8hjpDz0 C5ZDxvhfgxYixFEibOfTa30ZvIWAM1noFZlIFVjz2HiGUrIpK+KXXH/j6JPQlEBc6QHE FcoxKOztHqRmiO7a9Z0TSQ3E9xs+39/aFqYz+byMIlxG7rEWBC5pv14nxfyrbKPLaF3F XaLh2kPXXy/UAhRvUX7+T570hVPhovJFUInP5ymhFwQEFC3ytyqX/1ikT2Gi4QsPBXtJ A6NaPIAmpCmlWNemxgHWeMoSMFAPtKMwlkwu4C3Oa7ui+yA6ocGIU+Z7z5jfNZPIlvBj fbFQ== X-Gm-Message-State: AOAM530viCutOJoykGMm/EQwcGgqR4YGZSZVmTEo6Jc/YX5RKPogbo3q mTX2ZW5QfS3yfy8uoEm4xa9wPg== X-Google-Smtp-Source: ABdhPJxYBenbTI5DJ7oZajl9d4KYYFff7a69/j4AFC+Rq7Vn12vxMy0qYgcyv5UfojptE8ebjeq4/Q== X-Received: by 2002:a17:902:8491:: with SMTP id c17mr4942997plo.262.1593411525398; Sun, 28 Jun 2020 23:18:45 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u26sm2979285pfn.54.2020.06.28.23.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jun 2020 23:18:43 -0700 (PDT) From: Kees Cook To: Will Deacon Cc: Kees Cook , Fangrui Song , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 01/17] vmlinux.lds.h: Add .gnu.version* to DISCARDS Date: Sun, 28 Jun 2020 23:18:24 -0700 Message-Id: <20200629061840.4065483-2-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629061840.4065483-1-keescook@chromium.org> References: <20200629061840.4065483-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For vmlinux linking, no architecture uses the .gnu.version* sections, so remove it via the common DISCARDS macro in preparation for adding --orphan-handling=warn more widely. This is a work-around for what appears to be a bug[1] in ld.bfd which warns for this synthetic section even when none is found in input objects, and even when no section is emitted for an output object[2]. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=26153 [2] https://lore.kernel.org/lkml/202006221524.CEB86E036B@keescook/ Reviewed-by: Fangrui Song Signed-off-by: Kees Cook --- include/asm-generic/vmlinux.lds.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index db600ef218d7..1248a206be8d 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -934,6 +934,8 @@ *(.discard) \ *(.discard.*) \ *(.modinfo) \ + /* ld.bfd warns about .gnu.version* even when not emitted */ \ + *(.gnu.version*) \ } /** -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Subject: [PATCH v4 01/17] vmlinux.lds.h: Add .gnu.version* to DISCARDS Date: Sun, 28 Jun 2020 23:18:24 -0700 Message-ID: <20200629061840.4065483-2-keescook@chromium.org> References: <20200629061840.4065483-1-keescook@chromium.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20200629061840.4065483-1-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org To: Will Deacon Cc: Kees Cook , Fangrui Song , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel List-Id: linux-arch.vger.kernel.org For vmlinux linking, no architecture uses the .gnu.version* sections, so remove it via the common DISCARDS macro in preparation for adding --orphan-handling=warn more widely. This is a work-around for what appears to be a bug[1] in ld.bfd which warns for this synthetic section even when none is found in input objects, and even when no section is emitted for an output object[2]. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=26153 [2] https://lore.kernel.org/lkml/202006221524.CEB86E036B@keescook/ Reviewed-by: Fangrui Song Signed-off-by: Kees Cook --- include/asm-generic/vmlinux.lds.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index db600ef218d7..1248a206be8d 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -934,6 +934,8 @@ *(.discard) \ *(.discard.*) \ *(.modinfo) \ + /* ld.bfd warns about .gnu.version* even when not emitted */ \ + *(.gnu.version*) \ } /** -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 617F9C433E0 for ; Mon, 29 Jun 2020 06:21:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2EEC523131 for ; Mon, 29 Jun 2020 06:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0m0fZ0AR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="EVDjc0Vq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EEC523131 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dnvc3pJoDEALW9Ni+U/RjvVFUad3YMbC7fvwTK1Jv0U=; b=0m0fZ0ARsH+/YC4nT+w7VBLdr 9QN5zFiaTqa1L1uP0AxWpqotRtqH3lq7mlT65qVMWUJyObRgyixXyqJh3P+NEpx/t0hXChTzdKtfP WAaURy8SZIvheSkoTHzIOgNlCNBWt789Ck5rDZ5TBuJWiPd+UTssuSV49/FvcNmaeIDfQdeSqLX6U gxm6XgLZZwhorn4jxWD1wXCM25hbeVQ0NJ74RlumMrq3NXTShmn6RdeVFvrHcdUditlzuFdtONZUV 9EPXc1lRlSi6yBbxEUZ0tqmCYgHm3P36GIfcndVZ5SzId/GGtbnVEGKHjoYQsqhOV2BOAEGEAWSx4 eks2pOizg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpn8F-0005uu-Vk; Mon, 29 Jun 2020 06:19:08 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpn7x-0005p3-0d for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 06:18:54 +0000 Received: by mail-pl1-x644.google.com with SMTP id g17so6674631plq.12 for ; Sun, 28 Jun 2020 23:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4bArInUOY6/vKGVdecpLjfb0/2uC+GzWucHk89/LRTo=; b=EVDjc0VqYgRB2DG2EzHcBoN2SoQ4nLRItPJPDmHm0b1Z1rE2TFzvswTjV0UFJMg0A+ zk7wDPwhAdhR5pkqtDyugtOi4viSQFRF681TEkB9AOAbZShiWouWaRwMeqnrq0qniejQ Np9npLPCvLOYdVSL9z4v5SRp3hcbR0u8c56Q0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4bArInUOY6/vKGVdecpLjfb0/2uC+GzWucHk89/LRTo=; b=bnf47c1j0FX27Va8paDTAS3KFNY3SX4BrdiM2ShwWYM7nhaA3JDswQUrOyDPsfb2dI BbbKOcvBM3h/M6SBEhqCQAloMbLkuJO8glZX1BiMZJmfG6mnH2rLDpRy2aYYKpfvZR6Y bS2CVZI6n7+LzQKSE2wYEdgVuIg1OY3o+rDezkf//aCsELcrWnvl2t7fezOuVG+Ou3gO ynlTr40BtCjlthtcHJy5J01fbFE1vDJshkkPlADC16ST1RquL0hcujBRfg43Eh9Im6KU egDDaxDRPL6sGdIeY5WhS+kdk5yqJvKZrC1kVhjFUWo9MxyRYEOxDKkulk6fqn8tlfoz 5O5g== X-Gm-Message-State: AOAM5305MIQ0po8tOr4pkmF+U8KTG6mkr5VFjnRmBPerZLZt7H3FIRgy ioHH3/KGQsjE78fT74Qj7GEVGA== X-Google-Smtp-Source: ABdhPJxYBenbTI5DJ7oZajl9d4KYYFff7a69/j4AFC+Rq7Vn12vxMy0qYgcyv5UfojptE8ebjeq4/Q== X-Received: by 2002:a17:902:8491:: with SMTP id c17mr4942997plo.262.1593411525398; Sun, 28 Jun 2020 23:18:45 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u26sm2979285pfn.54.2020.06.28.23.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jun 2020 23:18:43 -0700 (PDT) From: Kees Cook To: Will Deacon Subject: [PATCH v4 01/17] vmlinux.lds.h: Add .gnu.version* to DISCARDS Date: Sun, 28 Jun 2020 23:18:24 -0700 Message-Id: <20200629061840.4065483-2-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629061840.4065483-1-keescook@chromium.org> References: <20200629061840.4065483-1-keescook@chromium.org> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-efi@vger.kernel.org, Catalin Marinas , Arvind Sankar , Thomas Gleixner , linux-arch@vger.kernel.org, Fangrui Song , Masahiro Yamada , x86@kernel.org, Russell King , Ard Biesheuvel , clang-built-linux@googlegroups.com, Ingo Molnar , Borislav Petkov , Kees Cook , Arnd Bergmann , Nathan Chancellor , Peter Collingbourne , linux-arm-kernel@lists.infradead.org, Nick Desaulniers , linux-kernel@vger.kernel.org, James Morse Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For vmlinux linking, no architecture uses the .gnu.version* sections, so remove it via the common DISCARDS macro in preparation for adding --orphan-handling=warn more widely. This is a work-around for what appears to be a bug[1] in ld.bfd which warns for this synthetic section even when none is found in input objects, and even when no section is emitted for an output object[2]. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=26153 [2] https://lore.kernel.org/lkml/202006221524.CEB86E036B@keescook/ Reviewed-by: Fangrui Song Signed-off-by: Kees Cook --- include/asm-generic/vmlinux.lds.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index db600ef218d7..1248a206be8d 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -934,6 +934,8 @@ *(.discard) \ *(.discard.*) \ *(.modinfo) \ + /* ld.bfd warns about .gnu.version* even when not emitted */ \ + *(.gnu.version*) \ } /** -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel