[PATCH] symbols: also special-case symbols aliasing _sinittext

Jan Beulich posted 1 patch 1 week, 2 days ago
[PATCH] symbols: also special-case symbols aliasing _sinittext
Posted by Jan Beulich 1 week, 2 days ago
A recent 4.22 randconfig build job hit a situation where (LIVEPATCH=n,
i.e. --all-symbols not specified) both __note_gnu_build_id_end and
_erodata aliased _sinittext on the 1st linking pass, but they didn't on
the 2nd one. As a result two fewer symbols were emitted on the 2nd pass,
causing $(call compare-symbol-tables, ...) to fail.

Extend the existing "corner case" by also considering aliases with these
two symbols (_stext really shouldn't have anything ahead of it), but
discard only non-text symbols.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -223,6 +223,13 @@ static int symbol_valid(struct sym_entry
 		    (s->addr == _einittext && strcmp((char*)s->sym + offset, "_einittext")) ||
 		    (s->addr == _eextratext && strcmp((char*)s->sym + offset, "_eextratext")))
 			return 0;
+		/* Same for non-text aliases of _sinittext or _sextratext. */
+		if (toupper(*s->sym) != 'T'
+		    && ((s->addr == _sinittext
+		         && strcmp((char *)s->sym + offset, "_sinittext"))
+		        || (s->addr == _sextratext
+		            && strcmp((char *)s->sym + offset, "_sextratext"))))
+			return 0;
 	}
 
 	/* Exclude symbols which vary between passes. */