Commit 87e5b1e8 authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Luis Chamberlain

module: Sync code of is_arm_mapping_symbol()

After commit 2e3a10a1 ("ARM: avoid ARM binutils leaking ELF local
symbols") and commit d6b73266 ("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: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent b4aff751
...@@ -251,8 +251,9 @@ static inline int is_arm_mapping_symbol(const char *str) ...@@ -251,8 +251,9 @@ static inline int is_arm_mapping_symbol(const char *str)
{ {
if (str[0] == '.' && str[1] == 'L') if (str[0] == '.' && str[1] == 'L')
return true; return true;
return str[0] == '$' && strchr("axtd", str[1]) && return str[0] == '$' &&
(str[2] == '\0' || str[2] == '.'); (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) static const char *kallsyms_symbol_name(struct mod_kallsyms *kallsyms, unsigned int symnum)
......
...@@ -1114,6 +1114,8 @@ static int secref_whitelist(const struct sectioncheck *mismatch, ...@@ -1114,6 +1114,8 @@ static int secref_whitelist(const struct sectioncheck *mismatch,
static inline int is_arm_mapping_symbol(const char *str) static inline int is_arm_mapping_symbol(const char *str)
{ {
if (str[0] == '.' && str[1] == 'L')
return true;
return str[0] == '$' && return str[0] == '$' &&
(str[1] == 'a' || str[1] == 'd' || str[1] == 't' || str[1] == 'x') (str[1] == 'a' || str[1] == 'd' || str[1] == 't' || str[1] == 'x')
&& (str[2] == '\0' || str[2] == '.'); && (str[2] == '\0' || str[2] == '.');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment