Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1324480ybl; Fri, 10 Jan 2020 16:21:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyKLYhzON1zvV00iLcLEqX+LbHEGulzxKSiWZUkhgZJ2/os4R+RE+yGJD4QOl8tThk1iQeN X-Received: by 2002:aca:5fc1:: with SMTP id t184mr4813798oib.20.1578702078297; Fri, 10 Jan 2020 16:21:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578702078; cv=none; d=google.com; s=arc-20160816; b=WCfxmfF/ZoXQmDlwJzZAX/YtZbxT7bBnbTTHcvVlwNfej7Mou0pVS3TxshZg84tx9+ BUF4RAJpq1UoLitGxIyI01eC1YA/48y8kP7lW0AOvdb8jfSq42hSXE+nxmdmOQ/x8PU+ +uC6w529IsxDKo0/hw+ISuJnsQ+nIA8H6tHEJUoRBLDj6iRG0sVJBQyOAxx7dzlOTYUV db8ogaTwRAx93umUvAFbQt204hH8i13kkCKDEEohCC+AIeRkEICofiUaupi5Cp7sPQzC oHThq2p1YtkCSzPMKWJGRmqbLJXs7D4A64LcjodiFw0tiiNO4/MIK1s+gHN00WWA5VUQ DkJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:references:in-reply-to:to:cc:subject:from:date :dkim-signature; bh=c3X7AVrd0eaweLYAuO8RL12YZV2EtbyuB8unmVAV0Nc=; b=OA5nEU3Rbh1FL+qwhOlUD/5cj6qPj5Pxqv0lQqb8PKRB60ySimq+JqodFHc0+HK8Rw SAGbPAel7QXTc7qsM6NHaHZPWkt835rCy40ZN97YJoj7/BhOPrc8wuZc0HKga5P9tO3y bo5YAs5aQHFk6S6wVd80WzCcFx9uprjbQ+2f3wUiLquFLbAjaR1zxzpOlGfCGCtqGcoZ j5fZgOP9nLweN9BcLDGkNn6gJ/4P020R/agdG1vyJWufZo3iGitQKiRIGHQoCTT3YI6P DWuXJDv5idhuo29hUGlkMWM5nseFQplU0edZ1OBb8IXv0eQ7l30vdzBlf9nrkhA3vUs0 RQyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="o/riBuR2"; 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 c7si2765595oto.305.2020.01.10.16.21.06; Fri, 10 Jan 2020 16:21:18 -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="o/riBuR2"; 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 S1727828AbgAKAUN (ORCPT + 99 others); Fri, 10 Jan 2020 19:20:13 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33929 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727499AbgAKAUM (ORCPT ); Fri, 10 Jan 2020 19:20:12 -0500 Received: by mail-pg1-f196.google.com with SMTP id r11so1759048pgf.1 for ; Fri, 10 Jan 2020 16:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:subject:cc:to:in-reply-to:references:message-id :mime-version:content-transfer-encoding; bh=c3X7AVrd0eaweLYAuO8RL12YZV2EtbyuB8unmVAV0Nc=; b=o/riBuR2mH3VghdAJD08lJGw+G6Nmt2YFqawukfV3FgIyraZCC33g4w6UUkTg4B9YA bPaQ7HIdl9EVvkaFzug0pY/FlWJECuXnToQMWAXeRVE0al9hqWVAVcLgt0QhvWPJSBsQ bB5dxtI06QKGwTmE7+MmdzSWdr5sWOBaOx8ylflwJxzwunQWhFk0yZMqgjvLjx3Ta6Qw IY0NzO2fCoYN5CkwLwDpJMeX7S6jXG0r+Ka/MngphRFWsDvtkDRIbForX/TrNPi0+IDh 9ZHCf9TkSZkGR/2ZIQQ0xtQVlRTLSLv2/gi03mwbtBLmcgcOWB86bKQt7FFpTbEBt+yn J0AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:cc:to:in-reply-to:references :message-id:mime-version:content-transfer-encoding; bh=c3X7AVrd0eaweLYAuO8RL12YZV2EtbyuB8unmVAV0Nc=; b=d1+5jV6+ve9xVKRuWvnC4/REfbnBOzKri5KYXFOZtsbv90PiqF+duXFWUrUhCrd+VB +6uS3dvi2O4/3fxm6a+Lv+XpoFnu902MEvi9FmnfsYxHmvdVrwnQpoczDhX4+AFs7U0B HLEjVSiaLGBEx56BKpr7uW8jdnMHets6MrTJ/yHxfPbZwKz94dsK0idUoNd+oKvvfArc cYi9bOADHQGPsvxlVRMXSmo9wRUyRjE7XUJqfaDXo1Q9GwlcCT6NzvVoj6+lqDU7Pfei w6lZ/t2Q/98I7hKxxmYBNj6ldg90qxZPLmnFSbgjmXywlqdOMlLxcKLyTA7PCZ4KyTSW SHcg== X-Gm-Message-State: APjAAAVAFWATJyZ5S/ShjPH2OcNs4RG7Vc9OplN+qgLTbocEStLTSPpi WN55mZ0IwcAQgG8TRbMWBdbzWw== X-Received: by 2002:a63:e30a:: with SMTP id f10mr7422254pgh.331.1578702011266; Fri, 10 Jan 2020 16:20:11 -0800 (PST) Received: from localhost ([2620:0:1000:2514:7f69:cd98:a2a2:a03d]) by smtp.gmail.com with ESMTPSA id c14sm4013510pjr.24.2020.01.10.16.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 16:20:10 -0800 (PST) Date: Fri, 10 Jan 2020 16:20:10 -0800 (PST) X-Google-Original-Date: Fri, 10 Jan 2020 16:19:54 PST (-0800) From: Palmer Dabbelt X-Google-Original-From: Palmer Dabbelt Subject: Re: Re: linux-next: build warning after merge of the bpf-next tree CC: Stephen Rothwell , daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, zong.li@sifive.com To: alexandre@ghiti.fr In-Reply-To: References: <20191018105657.4584ec67@canb.auug.org.au> <20191028110257.6d6dba6e@canb.auug.org.au> Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Jan 2020 14:28:17 PST (-0800), alexandre@ghiti.fr wrote: > Hi guys, > > On 10/27/19 8:02 PM, Stephen Rothwell wrote: >> Hi all, >> >> On Fri, 18 Oct 2019 10:56:57 +1100 Stephen Rothwell wrote: >>> Hi all, >>> >>> After merging the bpf-next tree, today's linux-next build (powerpc >>> ppc64_defconfig) produced this warning: >>> >>> WARNING: 2 bad relocations >>> c000000001998a48 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_start >>> c000000001998a50 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_end >>> >>> Introduced by commit >>> >>> 8580ac9404f6 ("bpf: Process in-kernel BTF") >> This warning now appears in the net-next tree build. >> >> > I bump that thread up because Zong also noticed that 2 new relocations for > those symbols appeared in my riscv relocatable kernel branch following > that commit. > > I also noticed 2 new relocations R_AARCH64_ABS64 appearing in arm64 kernel. > > Those 2 weak undefined symbols have existed since commit > 341dfcf8d78e ("btf: expose BTF info through sysfs") but this is the fact > to declare those symbols into btf.c that produced those relocations. > > I'm not sure what this all means, but this is not something I expected > for riscv for > a kernel linked with -shared/-fpie. Maybe should we just leave them to > zero ? > > I think that deserves a deeper look if someone understands all this > better than I do. Can you give me a pointer to your tree and how to build a relocatable kernel? Weak undefined symbols have the absolute value 0, but the kernel is linked at an address such that 0 can't be reached by normal means. When I added support to binutils for this I did it in a way that required almost no code -- essetially I just stopped dissallowing x0 as a possible base register for PCREL relocations, which results in 0 always being accessible. I just wanted to get the kernel to build again, so I didn't worry about chasing around all the addressing modes. The PIC/PIE support generates different relocations and I wouldn't be surprised if I just missed one (or more likely all) of them. It's probably a simple fix, though I feel like every time I say that about the linker I end up spending a month in there...