]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: modversions: add infrastructure for emitting relative CRCs
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 3 Feb 2017 09:54:05 +0000 (09:54 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Feb 2017 16:28:25 +0000 (08:28 -0800)
commit215828067f921b6765d194e740695f4b0f68f628
tree1627e6abc9001f0b519ed65daa86be46d52c4117
parentf735c4972e6155be743b3ba96f61cf83cc63868c
kbuild: modversions: add infrastructure for emitting relative CRCs

This add the kbuild infrastructure that will allow architectures to emit
vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
where the actual value is stored. This works around problems with CRCs
being mistaken for relocatable symbols on kernels that self relocate at
runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)

For the kbuild side of things, this comes down to the following:

 - introducing a Kconfig symbol MODULE_REL_CRCS

 - adding a -R switch to genksyms to instruct it to emit the CRC symbols
   as references into the .rodata section

 - making modpost distinguish such references from absolute CRC symbols
   by the section index (SHN_ABS)

 - making kallsyms disregard non-absolute symbols with a __crc_ prefix

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/Kconfig
scripts/Makefile.build
scripts/genksyms/genksyms.c
scripts/kallsyms.c
scripts/mod/modpost.c