summaryrefslogtreecommitdiff
path: root/include/linux/module_symbol.h
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2023-03-31 12:15:52 +0300
committerLuis Chamberlain <mcgrof@kernel.org>2023-04-14 03:15:49 +0300
commit987d2e0aaa55de40938435be760aa96428470fd6 (patch)
treeb052bab286905e58d71f35bd0c059b966ff7d0df /include/linux/module_symbol.h
parent87e5b1e8f257023ac5c4d2b8f07716a7f3dcc8ea (diff)
downloadlinux-987d2e0aaa55de40938435be760aa96428470fd6.tar.xz
module: Move is_arm_mapping_symbol() to module_symbol.h
In order to avoid duplicated code, move is_arm_mapping_symbol() to include/linux/module_symbol.h, then remove is_arm_mapping_symbol() in the other places. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'include/linux/module_symbol.h')
-rw-r--r--include/linux/module_symbol.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/module_symbol.h b/include/linux/module_symbol.h
new file mode 100644
index 000000000000..9fa4173d0197
--- /dev/null
+++ b/include/linux/module_symbol.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _LINUX_MODULE_SYMBOL_H
+#define _LINUX_MODULE_SYMBOL_H
+
+/* This ignores the intensely annoying "mapping symbols" found in ELF files. */
+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] == '.');
+}
+
+#endif /* _LINUX_MODULE_SYMBOL_H */