Skip to content

Commit 516d980

Browse files
committed
scripts/kallsyms: skip ppc compiler stub *.long_branch.* / *.plt_branch.*
PowerPC allmodconfig often fails to build as follows: LD .tmp_vmlinux.kallsyms1 KSYM .tmp_vmlinux.kallsyms1.o LD .tmp_vmlinux.kallsyms2 KSYM .tmp_vmlinux.kallsyms2.o LD .tmp_vmlinux.kallsyms3 KSYM .tmp_vmlinux.kallsyms3.o LD vmlinux SORTTAB vmlinux SYSMAP System.map Inconsistent kallsyms data Try make KALLSYMS_EXTRA_PASS=1 as a workaround make[2]: *** [../Makefile:1162: vmlinux] Error 1 Setting KALLSYMS_EXTRA_PASS=1 does not help. This is caused by the compiler inserting stubs such as *.long_branch.* and *.plt_branch.* $ powerpc-linux-nm -n .tmp_vmlinux.kallsyms2 [ snip ] c00000000210c010 t 00000075.plt_branch.da9:19 c00000000210c020 t 00000075.plt_branch.1677:5 c00000000210c030 t 00000075.long_branch.memmove c00000000210c034 t 00000075.plt_branch.9e0:5 c00000000210c044 t 00000075.plt_branch.free_initrd_mem ... Actually, the problem mentioned in scripts/link-vmlinux.sh comments; "In theory it's possible this results in even more stubs, but unlikely" is happening here, and ends up with another kallsyms step required. scripts/kallsyms.c already ignores various compiler stubs. Let's do similar to make kallsysms for PowerPC always succeed in 2 steps. Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Guenter Roeck <[email protected]>
1 parent ba4f184 commit 516d980

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

scripts/kallsyms.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ static char *sym_name(const struct sym_entry *s)
8282

8383
static bool is_ignored_symbol(const char *name, char type)
8484
{
85+
/* Symbol names that exactly match to the following are ignored.*/
8586
static const char * const ignored_symbols[] = {
8687
/*
8788
* Symbols which vary between passes. Passes 1 and 2 must have
@@ -104,6 +105,7 @@ static bool is_ignored_symbol(const char *name, char type)
104105
NULL
105106
};
106107

108+
/* Symbol names that begin with the following are ignored.*/
107109
static const char * const ignored_prefixes[] = {
108110
"$", /* local symbols for ARM, MIPS, etc. */
109111
".LASANPC", /* s390 kasan local symbols */
@@ -113,16 +115,23 @@ static bool is_ignored_symbol(const char *name, char type)
113115
NULL
114116
};
115117

118+
/* Symbol names that end with the following are ignored.*/
116119
static const char * const ignored_suffixes[] = {
117120
"_from_arm", /* arm */
118121
"_from_thumb", /* arm */
119122
"_veneer", /* arm */
120123
NULL
121124
};
122125

126+
/* Symbol names that contain the following are ignored.*/
127+
static const char * const ignored_matches[] = {
128+
".long_branch.", /* ppc stub */
129+
".plt_branch.", /* ppc stub */
130+
NULL
131+
};
132+
123133
const char * const *p;
124134

125-
/* Exclude symbols which vary between passes. */
126135
for (p = ignored_symbols; *p; p++)
127136
if (!strcmp(name, *p))
128137
return true;
@@ -138,6 +147,11 @@ static bool is_ignored_symbol(const char *name, char type)
138147
return true;
139148
}
140149

150+
for (p = ignored_matches; *p; p++) {
151+
if (strstr(name, *p))
152+
return true;
153+
}
154+
141155
if (type == 'U' || type == 'u')
142156
return true;
143157
/* exclude debugging symbols */

0 commit comments

Comments
 (0)