All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] symbols: don't omit "end" symbols upon mixed code / data aliases
@ 2026-01-21 15:26 Jan Beulich
  2026-01-21 17:16 ` Roger Pau Monné
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2026-01-21 15:26 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné

At the example of _sinitext - that symbol has four aliases on x86:
__init_begin, __2M_init_start, __2M_rodata_end, and whatever the first
function in .init.text. With the GNU toolchain all of them are marked
'T' or 't'. With Clang/LLVM, however, some are marked 'r'. Since, to
save space, we want fake "end" symbols only for text, right now
want_symbol_end() has a respective check. That is getting in the way,
however, when the final of those symbols is 'r'. Remove the check and
instead zap the size for anything that is non-code.

Fixes: 6eede548df21 ('symbols: avoid emitting "end" symbols for data items')
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Roger, just fyi that I think that this change would mask the other issue
that you reported, without actually adressing the underlying problem.
Hence both changes will be wanted.

--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -164,6 +164,10 @@ static int read_symbol(FILE *in, struct
 	else if (str[0] == '$')
 		goto skip_tail;
 
+	/* We want fake "end" symbols only for text / code. */
+	if (toupper((uint8_t)stype) != 'T')
+		s->size = 0;
+
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
 	s->len = strlen(str) + 1;
@@ -312,7 +316,6 @@ static int compare_name_orig(const void
 static bool want_symbol_end(unsigned int idx)
 {
 	return table[idx].size &&
-	       toupper(table[idx].type) == 'T' &&
 	       (idx + 1 == table_cnt ||
 	        table[idx].addr + table[idx].size < table[idx + 1].addr);
 }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] symbols: don't omit "end" symbols upon mixed code / data aliases
  2026-01-21 15:26 [PATCH] symbols: don't omit "end" symbols upon mixed code / data aliases Jan Beulich
@ 2026-01-21 17:16 ` Roger Pau Monné
  0 siblings, 0 replies; 2+ messages in thread
From: Roger Pau Monné @ 2026-01-21 17:16 UTC (permalink / raw)
  To: Jan Beulich
  Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Julien Grall,
	Stefano Stabellini, Anthony PERARD, Michal Orzel

On Wed, Jan 21, 2026 at 04:26:03PM +0100, Jan Beulich wrote:
> At the example of _sinitext - that symbol has four aliases on x86:
> __init_begin, __2M_init_start, __2M_rodata_end, and whatever the first
> function in .init.text. With the GNU toolchain all of them are marked
> 'T' or 't'. With Clang/LLVM, however, some are marked 'r'. Since, to
> save space, we want fake "end" symbols only for text, right now
> want_symbol_end() has a respective check. That is getting in the way,
> however, when the final of those symbols is 'r'. Remove the check and
> instead zap the size for anything that is non-code.
> 
> Fixes: 6eede548df21 ('symbols: avoid emitting "end" symbols for data items')
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

> ---
> Roger, just fyi that I think that this change would mask the other issue
> that you reported, without actually adressing the underlying problem.
> Hence both changes will be wanted.

Yes, it does indeed mask the other issue.

Thanks, Roger.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-21 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-21 15:26 [PATCH] symbols: don't omit "end" symbols upon mixed code / data aliases Jan Beulich
2026-01-21 17:16 ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.