OSDN Git Service

mips: vdso: add build time check that no 'jalr t9' calls left
authorVictor Kamensky <kamensky@cisco.com>
Tue, 11 Feb 2020 19:24:34 +0000 (11:24 -0800)
committerPaul Burton <paulburton@kernel.org>
Sat, 15 Feb 2020 20:44:03 +0000 (12:44 -0800)
commit976c23af3ee5bd3447a7bfb6c356ceb4acf264a6
tree8bbc4b3e442c7d736fb77d51844b8814c030f445
parent07015d7a103c4420b69a287b8ef4d2535c0f4106
mips: vdso: add build time check that no 'jalr t9' calls left

vdso shared object cannot have GOT based PIC 'jalr t9' calls
because nobody set GOT table in vdso. Contributing into vdso
.o files are compiled in PIC mode and as result for internal
static functions calls compiler will generate 'jalr t9'
instructions. Those are supposed to be converted into PC
relative 'bal' calls by linker when relocation are processed.

Mips global GOT entries do have dynamic relocations and they
will be caught by cmd_vdso_check Makefile rule. Static PIC
calls go through mips local GOT entries that do not have
dynamic relocations. For those 'jalr t9' calls could be present
but without dynamic relocations and they need to be converted
to 'bal' calls by linker.

Add additional build time check to make sure that no 'jalr t9'
slip through because of some toolchain misconfiguration that
prevents 'jalr t9' to 'bal' conversion.

Signed-off-by: Victor Kamensky <kamensky@cisco.com>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: bruce.ashfield@gmail.com
Cc: richard.purdie@linuxfoundation.org
arch/mips/vdso/Makefile