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

Mark Brown
2020-05-06T10:41:59Z

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

On Wed, May 06, 2020 at 08:10:26AM +0100, Will Deacon wrote:
> On Tue, May 05, 2020 at 06:21:00PM +0100, Mark Brown wrote:

> > > > > 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.

> > 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?

> The linker fixes this up when it warns, right? If so, I think the current

The linker is fixing this up, yes.

> behaviour is fine *but* we might want to improve the diagnostic a bit not
> to worry/confuse people. e.g. something like:

> "Your compiler is not emitting '.note.gnu.property' sections: forcing
> support for BTI in the linker, but consider upgrading your toolchain."

Well, the theory behind the warning is that if the compiler is emitting
code suitable for the features described in the note then it should
always emit the appropriate annotations so the warning is more intended
to be telling the user that the code is trying to link in code that's
not built properly and will most likely fail at runtime. In the current
situation that's an issue with the toolchain not emitting the
annotations but the common case expectation is that the issue will be
that there are object files that weren't built appropriately.

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

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