From: Palmer Dabbelt <palmerdabbelt@google.com>
To: alexandre@ghiti.fr
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
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
Subject: Re: Re: linux-next: build warning after merge of the bpf-next tree
Date: Fri, 10 Jan 2020 16:20:10 -0800 (PST) [thread overview]
Message-ID: <mhng-0daa1a90-2bed-4b2e-833e-02cd9c0aa73f@palmerdabbelt-glaptop> (raw)
In-Reply-To: <a367af4d-7267-2e94-74dc-2a2aac204080@ghiti.fr>
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 <sfr@canb.auug.org.au> 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...
next prev parent reply other threads:[~2020-01-11 0:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 23:56 linux-next: build warning after merge of the bpf-next tree Stephen Rothwell
2019-10-18 5:01 ` Alexei Starovoitov
2019-10-28 0:02 ` Stephen Rothwell
2020-01-10 22:28 ` Alexandre Ghiti
2020-01-10 23:18 ` Alexei Starovoitov
2020-01-11 14:06 ` Alexandre Ghiti
2020-01-11 0:20 ` Palmer Dabbelt [this message]
2020-01-11 14:31 ` Alexandre Ghiti
2020-01-13 4:33 ` Zong Li
2020-01-14 5:23 ` Alexei Starovoitov
2020-01-15 20:48 ` Alexandre Ghiti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mhng-0daa1a90-2bed-4b2e-833e-02cd9c0aa73f@palmerdabbelt-glaptop \
--to=palmerdabbelt@google.com \
--cc=alexandre@ghiti.fr \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=zong.li@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).