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

Jan Beulich <[email protected]>
Newsgroups org.xenproject.lists.xen-devel
Message-ID <[email protected]>
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 <[email protected]>

--- 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. */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.