summaryrefslogtreecommitdiff
path: root/kernel/module
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2023-03-31 17:15:51 +0800
committerLuis Chamberlain <mcgrof@kernel.org>2023-04-13 17:15:49 -0700
commit87e5b1e8f257023ac5c4d2b8f07716a7f3dcc8ea (patch)
tree940336814e51ab52dcf86cee8e32b01460d81f4a /kernel/module
parentb4aff7513df323553de714dcf7b54e896577be1f (diff)
downloadlwn-87e5b1e8f257023ac5c4d2b8f07716a7f3dcc8ea.tar.gz
lwn-87e5b1e8f257023ac5c4d2b8f07716a7f3dcc8ea.zip
module: Sync code of is_arm_mapping_symbol()
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>
Diffstat (limited to 'kernel/module')
-rw-r--r--kernel/module/kallsyms.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c
index 3320586584f1..a9045fe55bcd 100644
--- a/kernel/module/kallsyms.c
+++ b/kernel/module/kallsyms.c
@@ -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)