summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kallsyms.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index c07ccfad0319..090ffda4adbc 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -184,6 +184,15 @@ symbol_valid(struct sym_entry *s)
if ((s->addr < _stext || s->addr > _etext)
&& (s->addr < _sinittext || s->addr > _einittext))
return 0;
+ /* Corner case. Discard any symbols with the same value as
+ * _etext or _einittext, they can move between pass 1 and 2
+ * when the kallsyms data is added. If these symbols move then
+ * they may get dropped in pass 2, which breaks the kallsyms
+ * rules.
+ */
+ if ((s->addr == _etext && strcmp(s->sym + 1, "_etext")) ||
+ (s->addr == _einittext && strcmp(s->sym + 1, "_einittext")))
+ return 0;
}
/* Exclude symbols which vary between passes. */