Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp81434ybv; Tue, 4 Feb 2020 16:52:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwnivYVd9TzP6TeMBQ8gXfBhzlyKQyRABr/tvcEF9C5cbFByhgDTgKXPRBWYhQsMPRyOeys X-Received: by 2002:aca:d610:: with SMTP id n16mr1236783oig.108.1580863955243; Tue, 04 Feb 2020 16:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580863955; cv=none; d=google.com; s=arc-20160816; b=tmzE3sErPtLVEyZD5rKInZl8r5CMwRw+8ss7qstG876SH3x3khKMYzagEyh3i7gPLn kqffpZeZvlgs6JjHKuAxpkpfewr9Mw76wWVdPOSmtgcqepsXtX3AFJOB2f21kS6CoyeM QMo655N6Rvg9QkWH9UACKvvbXWhiggQs6VLshJeeUEeWZD1wQhtib3PYlM3g7AXy9fUA vYozbNJKmmh4N9sV9kynF2EpE2FfwU+uSMIxxBWREAYqFP70QNCKjH/yZ0VvpHWXJIxv IQ+R1xUz4nWOUd/T2661o9gOI8xMFSJCfFgZzg3NhyhK6EfO5fnJzIhx3CY7ldjB1r1v NQkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=xx/Hr3yEcha35uFKz8KW9UBIGlBl9yxxGD/Ht51bCag=; b=LG5oPnh3Fx6Ion/ouBiPd1NlvEJI62m5nt2LKjBL6YCW+0nojiI8C7G2grEi7+BY+f WOZVNXo94Z3ywz3uAS+xaN/d8192+zDZIg4VEFMrpZrg3+JbZAstc5ZW44Nn7jnQqbE4 B88cUkyix/nJCEo1lq00VMOV6tLosr8JbafNC5M/fzm9N+iOXPyp29s+k7/BHnbvlDK+ RfWjbCpKYK8yfLlCqufkxXRA+CAooSrCkn59kpQ1Ua3HP++t5Wv6GicUpXr56xJ3wyBt 6OAC1TATYQlImQAYSSo/DpfbaG90CuYDLOLczm/v8r/yQMAJvZYcZ2aWcSMJQIqnGjjm vZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JUhe3AKH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si11595880oic.245.2020.02.04.16.52.22; Tue, 04 Feb 2020 16:52:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JUhe3AKH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727892AbgBEAu7 (ORCPT + 99 others); Tue, 4 Feb 2020 19:50:59 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46274 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727619AbgBEAu6 (ORCPT ); Tue, 4 Feb 2020 19:50:58 -0500 Received: by mail-pl1-f194.google.com with SMTP id y8so111918pll.13 for ; Tue, 04 Feb 2020 16:50:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=xx/Hr3yEcha35uFKz8KW9UBIGlBl9yxxGD/Ht51bCag=; b=JUhe3AKHAQbOZIQ0eNn+wAM8JAgL0Ssx9uCzEIYHRsMQ5X+Oxe84h0ULRtw9jnbhS1 T+NQdyQOkUOxlnuVOeguzvRKgEJbW6YZaI9iIez/rkX5ii3l5rskS2BnkS9K9JE4o0a3 J4etdJCQERSWNak0CGgoPvV4l8mwHAk43v7RwzNKCD32NP0SMx6/vUM+7a1roJlRB7Cq jdiqC1oa/paLnFZ2aC+N96AtJqgW9819DHfnYO6oOTdG6AGnz4MSQmBaGCw8ajB6Lta1 K98FJGKB2SiFy9IAuidogj8YOG4TnlbFZ+V6jGr/RVuf9kgNKKW2yR1542rv/e/CqpRv o07g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=xx/Hr3yEcha35uFKz8KW9UBIGlBl9yxxGD/Ht51bCag=; b=aofkEtMYDUzEVVC/QM46oV67kgwVEyuH/iKTTgRhbAZ795cUu1UnfwoKstbs+58aHL ulfM1LyRLxPRGTx2LE1bnFU9Z01HaYFVq4U0qHNBF8lnRZnV7YrK9in4O0Xzw01rNFxL XYfLewzEPEdzE2I+xYKhpWnxfX+k8NBuQUQ+HyPlPuCBi7qfTOhXxLH8tkRs4TnRUpY4 pLA+U8Seqget3Z81L4DcoZDYIW6gZHOxDiFj7Nq2VSb0AmB22tw7r4qbgTKyVVE0WxWD Cpl7GQBbYA4CaAphmCNsKvXN25H6QqCQmCtPv82kx2JL3JOuRVTETsS+aGGI7tWEtvDL mH0g== X-Gm-Message-State: APjAAAUWMsu4b/pqXUZ6g3ef8ARV3HeXh2fOn3XcxR21W6XvTZ1uadIJ vDXLPffIQfMfcBz7YlDRcqORew== X-Received: by 2002:a17:90a:cb11:: with SMTP id z17mr2406433pjt.122.1580863857220; Tue, 04 Feb 2020 16:50:57 -0800 (PST) Received: from google.com ([2620:15c:2ce:0:9efe:9f1:9267:2b27]) by smtp.gmail.com with ESMTPSA id f81sm24626828pfa.118.2020.02.04.16.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 16:50:56 -0800 (PST) Date: Tue, 4 Feb 2020 16:50:54 -0800 From: Fangrui Song To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Fangrui Song Subject: [PATCH] powerpc/vdso32: mark __kernel_datapage_offset as STV_PROTECTED Message-ID: <20200205005054.k72fuikf6rwrgfe4@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A PC-relative relocation (R_PPC_REL16_LO in this case) referencing a preemptible symbol in a -shared link is not allowed. GNU ld's powerpc port is permissive and allows it [1], but lld will report an error after https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=ec0895f08f99515194e9fcfe1338becf6f759d38 Make the symbol protected so that it is non-preemptible but still exported. [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=25500 Link: https://github.com/ClangBuiltLinux/linux/issues/851 Signed-off-by: Fangrui Song --- arch/powerpc/kernel/vdso32/datapage.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S index 217bb630f8f9..2831a8676365 100644 --- a/arch/powerpc/kernel/vdso32/datapage.S +++ b/arch/powerpc/kernel/vdso32/datapage.S @@ -13,7 +13,8 @@ #include .text - .global __kernel_datapage_offset; + .global __kernel_datapage_offset + .protected __kernel_datapage_offset __kernel_datapage_offset: .long 0 -- 2.25.0.341.g760bfbb309-goog