From patchwork Tue Nov 10 01:56:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11892907 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=-17.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,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 9DBDCC2D0A3 for ; Tue, 10 Nov 2020 01:57:58 +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 176F5206B2 for ; Tue, 10 Nov 2020 01:57:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YPx3pyba"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U9R6tKTe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 176F5206B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=6KfBih4pFk3W+omecjfoQnND5rjSXWiW4SszX3RfwrU=; b=YPx3pybaQFuHbQxAJtWrnLwfx CvD8ruyj9ga3+COhjBMgN7I+wMx7E3ljp9j1q6HYiFs/KpkgEmpDq3zZ5YXa1Ygu+3ysIsC+aNNDA cZfiTP8CV2/S/vWU1qnVDRD/Ck7nBezvr5/m+C4W0zaH07kdEIPqBRGEry4a8F2bQeG35fQbGqTlR 4pqMnW7x7+m2b8lBW/pBfGNnBQ53kJt6Yg4fr1xtDdxeCcQzAESDCaYCnTHbZk9uYIBryBaWdjznQ g8hPDrz3Wnld1q00JbliCtAhwMTVwyAhXI7rgIVc+2W92K4QAYbqifZltAPCCtNC+m9oKYsZN7t19 oJ04Ry53Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcItw-0002eL-BY; Tue, 10 Nov 2020 01:56:52 +0000 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcItu-0002d7-AP for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 01:56:51 +0000 Received: by mail-qv1-xf44.google.com with SMTP id r12so5141224qvq.13 for ; Mon, 09 Nov 2020 17:56:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KmPpcrRv/rJbh6BPWnrgFrN9eKGSiLpMRuP56+Xg5V0=; b=U9R6tKTeHMlevwS8ufFeSgelvrDoDM8CizTsO8uv8s2EGJUGcNKliItIE6jfsXM8UW LF2eUlMksTwuhJg8lJ8EQUwQ9n+Tz2A0K7O+xP/JsdjxT/AA5dy2hr5kSkJh3YkQW33P YtfOeGBYWJkR7Kg89bSstHH4XZhGRhzLqr+i0PLApwgkOxdM3af+fD0qd7VdUzwVqZ20 0Whc+P6CZVq77di0+0ZFV+qszcucJ/1oh+HWLUBuudxNfNsWTNzlcx7Fy+ob6NAcdcuf nDiXfgVW1qWLexSbxggYFac5nT31XxTGjEYdk+Y+5eEpRN4GCiG0ENDm05gcFnR01iWy qN7A== 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=KmPpcrRv/rJbh6BPWnrgFrN9eKGSiLpMRuP56+Xg5V0=; b=oqgeV7Y5AFgfdBTIEfZCrz+uSKw2l6rWKD9Ajo5QYyHRQIIDzaTPbe9VqCfLYxqdN7 2ICRIQli+SWkoqU2l/mznV1FBRk/pXtzqFQ4LDB2xBC3+eRidDrCOT1lmekjT/hPiF5J /JcetbjvCbpZyA8bYlFGsN/uTCKcCd6uOAiv9AtYWVZqPnxb9e32CSRT3/2AVMdH0smT Z2W4pUyMlqB9rRmVuBS1SDpv562Gt5koSOnK/Ax2IfLJRkVuFcRA1IUWRoTwRgakU/MI iY+W4OMtsowkZ5EBaKLySeP2Zmav8jQXWQE1VmkvQDG9pasyTzYW9jvVaW7mVmUzGCcu Sg4g== X-Gm-Message-State: AOAM5332CpoP+3yTMbiB/LMM4fGrbwHVHG+HiKG363uTJYnI8IP5/d35 jYG9TcIL0VHuMUCKWzfafjg= X-Google-Smtp-Source: ABdhPJzPCJW4e2UZHPInIU6mLm/B+sLHSCKeZJjmJh3Eecf5HOsCHnNdRReNYd4Apz8PfuHXNDwqlQ== X-Received: by 2002:ad4:4e84:: with SMTP id dy4mr17625319qvb.47.1604973408723; Mon, 09 Nov 2020 17:56:48 -0800 (PST) Received: from localhost.localdomain ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id z134sm7714086qka.21.2020.11.09.17.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 17:56:47 -0800 (PST) From: Nathan Chancellor To: Russell King Subject: [PATCH] ARM: Link with '-z norelro' Date: Mon, 9 Nov 2020 18:56:32 -0700 Message-Id: <20201110015632.2509254-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_205650_803323_3393BF9E X-CRM114-Status: GOOD ( 15.35 ) 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: Florian Fainelli , Arnd Bergmann , Abbott Liu , Linus Walleij , Jian Cai , clang-built-linux@googlegroups.com, Andrey Ryabinin , Nathan Chancellor , Mike Rapoport , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When linking a multi_v7_defconfig + CONFIG_KASAN=y kernel with LD=ld.lld, the following error occurs: $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LLVM=1 zImage ld.lld: error: section: .exit.data is not contiguous with other relro sections LLD defaults to '-z relro', which is unneeded for the kernel because program headers are not used nor is there any position independent code generation or linking for ARM. Add '-z norelro' to LDFLAGS_vmlinux to avoid this error. Link: https://github.com/ClangBuiltLinux/linux/issues/1189 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers --- arch/arm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: a0796429c6abecf8afaeb65b1db286af1fb579d1 diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 4d76eab2b22d..3c0a64cefe52 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -10,7 +10,7 @@ # # Copyright (C) 1995-2001 by Russell King -LDFLAGS_vmlinux := --no-undefined -X --pic-veneer +LDFLAGS_vmlinux := --no-undefined -X --pic-veneer -z norelro ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) LDFLAGS_vmlinux += --be8 KBUILD_LDFLAGS_MODULE += --be8