Commit b0d10330 authored by Keith Owens's avatar Keith Owens Committed by Sam Ravnborg

kallsyms: Avoid kallsyms corner case on _etext and _einittext

Avoid kallsyms corner case on _etext and _einittext with
CONFIG_KALLSYMS_ALL=n.
Signed-off-by: default avatarKeith Owens <kaos@ocs.com.au>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent c97a20fb
......@@ -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. */
......
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