scripts/kallsyms: move more patterns to the ignored_prefixes array
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 23 Nov 2019 16:04:40 +0000 (01:04 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 25 Nov 2019 12:06:01 +0000 (21:06 +0900)
Refactoring for shortening the code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kallsyms.c

index 843615c1d384e1067973af38073d5986c24ab568..04a1dd16edcfea5a35b0c0620aeb63ffdcede1e6 100644 (file)
@@ -105,6 +105,8 @@ static bool is_ignored_symbol(const char *name, char type)
        };
 
        static const char * const ignored_prefixes[] = {
+               "$",                    /* local symbols for ARM, MIPS, etc. */
+               ".LASANPC",             /* s390 kasan local symbols */
                "__crc_",               /* modversions */
                "__efistub_",           /* arm64 EFI stub namespace */
                NULL
@@ -198,19 +200,9 @@ static int read_symbol(FILE *in, struct sym_entry *s)
        }
        else if (toupper(stype) == 'U')
                return -1;
-       /*
-        * Ignore generated symbols such as:
-        *  - mapping symbols in ARM ELF files ($a, $t, and $d)
-        *  - MIPS ELF local symbols ($L123 instead of .L123)
-        */
-       else if (sym[0] == '$')
-               return -1;
        /* exclude debugging symbols */
        else if (stype == 'N' || stype == 'n')
                return -1;
-       /* exclude s390 kasan local symbols */
-       else if (!strncmp(sym, ".LASANPC", 8))
-               return -1;
 
        /* include the type field in the symbol name, so that it gets
         * compressed together */