Re: [PATCH v2 02/10] arm64: asm: Override SYM_FUNC_START when building the kernel with BTI

Mark Brown
2020-05-05T17:21:06Z

[-- Attachment #1.1: Type: text/plain, Size: 1183 bytes --]

On Tue, May 05, 2020 at 05:08:53PM +0100, Will Deacon wrote:
> On Tue, May 05, 2020 at 04:18:06PM +0100, Mark Brown wrote:

> > > I also see a scary linker warning about the native VDSO:

> > > aarch64-none-linux-gnu-ld: arch/arm64/kernel/vdso/vgettimeofday.o: warning: BTI turned on by -z force-bti when all inputs do not have BTI in NOTE section.

> > I can't reproduce this, I am using clang-10 as well... can you share
> > your exact command line and config? I'm using

> Just been debugging this, and it seems that not all clangs are created
> equal. Updating mine from 10.0.2 to 11.0.1 means I now get the
> '.note.gnu.property' sections emitted for C files compiled using
> '-mbranch-protection=pac-ret+leaf+bti', whereas I didn't before.

Oh, that's irritating. I'm using clang from the llvm.org packages,
currently that's:

10.0.0-++20200115115127+cbe681bd833-1~exp1~20200115105727.528

so if this is a clang issue it looks like they fixed it in the clang-10
branch. I'm not sure it's worth trying to detect and handle this or
not, I don't know how widely deployed toolchains that don't emit the
property are and there's a fairly clear solution. What do you think?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]