]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
module: Sync code of is_arm_mapping_symbol()
authorTiezhu Yang <yangtiezhu@loongson.cn>
Fri, 31 Mar 2023 09:15:51 +0000 (17:15 +0800)
committerLuis Chamberlain <mcgrof@kernel.org>
Fri, 14 Apr 2023 00:15:49 +0000 (17:15 -0700)
After commit 2e3a10a1551d ("ARM: avoid ARM binutils leaking ELF local
symbols") and commit d6b732666a1b ("modpost: fix undefined behavior of
is_arm_mapping_symbol()"), many differences of is_arm_mapping_symbol()
exist in kernel/module/kallsyms.c and scripts/mod/modpost.c, just sync
the code to keep consistent.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/module/kallsyms.c
scripts/mod/modpost.c

index 3320586584f10fbe4c7649f8521bc74c48e8f243..a9045fe55bcd9f657da94e6b8db20e3fd3df456a 100644 (file)
@@ -251,8 +251,9 @@ static inline int is_arm_mapping_symbol(const char *str)
 {
        if (str[0] == '.' && str[1] == 'L')
                return true;
-       return str[0] == '$' && strchr("axtd", str[1]) &&
-              (str[2] == '\0' || str[2] == '.');
+       return str[0] == '$' &&
+              (str[1] == 'a' || str[1] == 'd' || str[1] == 't' || str[1] == 'x')
+              && (str[2] == '\0' || str[2] == '.');
 }
 
 static const char *kallsyms_symbol_name(struct mod_kallsyms *kallsyms, unsigned int symnum)
index efff8078e39581349f72fd8fbe6e2c062e36d372..79a27cc5f0b1d99c277e20d3f7cb2635d7a34bf3 100644 (file)
@@ -1114,6 +1114,8 @@ static int secref_whitelist(const struct sectioncheck *mismatch,
 
 static inline int is_arm_mapping_symbol(const char *str)
 {
+       if (str[0] == '.' && str[1] == 'L')
+               return true;
        return str[0] == '$' &&
               (str[1] == 'a' || str[1] == 'd' || str[1] == 't' || str[1] == 'x')
               && (str[2] == '\0' || str[2] == '.');