mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
34e00accf6
commit
56067812d5
5 changed files with 42 additions and 5 deletions
|
|
@ -219,6 +219,10 @@ static int symbol_valid(struct sym_entry *s)
|
|||
"_SDA2_BASE_", /* ppc */
|
||||
NULL };
|
||||
|
||||
static char *special_prefixes[] = {
|
||||
"__crc_", /* modversions */
|
||||
NULL };
|
||||
|
||||
static char *special_suffixes[] = {
|
||||
"_veneer", /* arm */
|
||||
"_from_arm", /* arm */
|
||||
|
|
@ -259,6 +263,14 @@ static int symbol_valid(struct sym_entry *s)
|
|||
if (strcmp(sym_name, special_symbols[i]) == 0)
|
||||
return 0;
|
||||
|
||||
for (i = 0; special_prefixes[i]; i++) {
|
||||
int l = strlen(special_prefixes[i]);
|
||||
|
||||
if (l <= strlen(sym_name) &&
|
||||
strncmp(sym_name, special_prefixes[i], l) == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; special_suffixes[i]; i++) {
|
||||
int l = strlen(sym_name) - strlen(special_suffixes[i]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue