All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] symbols: aliasing at text section boundaries
@ 2026-08-25 14:26 Jan Beulich
  2026-08-25 14:27 ` [PATCH v2 1/2] symbols: drop _{s,e}extratext Jan Beulich
  2026-08-25 14:29 ` [PATCH v2 2/2] symbols: also special-case symbols aliasing _sinittext Jan Beulich
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2026-08-25 14:26 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné

1: drop _{s,e}extratext
2: also special-case symbols aliasing _sinittext

v2: New 1st patch, simplifying what's now patch2.

Jan


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

* [PATCH v2 1/2] symbols: drop _{s,e}extratext
  2026-08-25 14:26 [PATCH v2 0/2] symbols: aliasing at text section boundaries Jan Beulich
@ 2026-08-25 14:27 ` Jan Beulich
  2026-08-25 14:29 ` [PATCH v2 2/2] symbols: also special-case symbols aliasing _sinittext Jan Beulich
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2026-08-25 14:27 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné

We're only about 18.5 years late with this: See Linux commit a3b81113fb66
("remove support for un-needed _extratext section"), i.e. from the 2.6.25
dev cycle.

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

--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -52,7 +52,7 @@ struct sym_entry {
 
 static struct sym_entry *table;
 static unsigned int table_size, table_cnt;
-static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext;
+static unsigned long long _stext, _etext, _sinittext, _einittext;
 static int all_symbols = 0;
 static int sort_by_name = 0;
 static int map_only = 0;
@@ -148,10 +148,6 @@ static int read_symbol(FILE *in, struct
 		_sinittext = s->addr;
 	else if (strcmp(sym, "_einittext") == 0)
 		_einittext = s->addr;
-	else if (strcmp(sym, "_sextratext") == 0)
-		_sextratext = s->addr;
-	else if (strcmp(sym, "_eextratext") == 0)
-		_eextratext = s->addr;
 	else if (toupper((uint8_t)stype) == 'A')
 	{
 		/* Keep these useful absolute symbols */
@@ -210,18 +206,16 @@ static int symbol_valid(struct sym_entry
 	 * and inittext sections are discarded */
 	if (!all_symbols) {
 		if ((s->addr < _stext || s->addr > _etext)
-		    && (s->addr < _sinittext || s->addr > _einittext)
-		    && (s->addr < _sextratext || s->addr > _eextratext))
+		    && (s->addr < _sinittext || s->addr > _einittext))
 			return 0;
 		/* Corner case.  Discard any symbols with the same value as
-		 * _etext _einittext or _eextratext; they can move between pass
-		 * 1 and 2 when the symbols data are added.  If these symbols
-		 * move then they may get dropped in pass 2, which breaks the
+		 * _etext or _einittext; they can move between pass 1 and 2
+		 * when the symbols data are added.  If these symbols move
+		 * then they may get dropped in pass 2, which breaks the
 		 * symbols rules.
 		 */
 		if ((s->addr == _etext && strcmp((char*)s->sym + offset, "_etext")) ||
-		    (s->addr == _einittext && strcmp((char*)s->sym + offset, "_einittext")) ||
-		    (s->addr == _eextratext && strcmp((char*)s->sym + offset, "_eextratext")))
+		    (s->addr == _einittext && strcmp((char*)s->sym + offset, "_einittext")))
 			return 0;
 	}
 



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

* [PATCH v2 2/2] symbols: also special-case symbols aliasing _sinittext
  2026-08-25 14:26 [PATCH v2 0/2] symbols: aliasing at text section boundaries Jan Beulich
  2026-08-25 14:27 ` [PATCH v2 1/2] symbols: drop _{s,e}extratext Jan Beulich
@ 2026-08-25 14:29 ` Jan Beulich
  2026-08-26  8:28   ` Jan Beulich
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2026-08-25 14:29 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné

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
_sinittext (_stext really shouldn't have anything ahead of it), but
discard only non-text symbols.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Re-base over _{s,e}extratext removal. Add const to cast.

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



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

* Re: [PATCH v2 2/2] symbols: also special-case symbols aliasing _sinittext
  2026-08-25 14:29 ` [PATCH v2 2/2] symbols: also special-case symbols aliasing _sinittext Jan Beulich
@ 2026-08-26  8:28   ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2026-08-26  8:28 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Julien Grall, Stefano Stabellini, Anthony PERARD,
	Michal Orzel, Roger Pau Monné

On 25.08.2026 16:29, Jan Beulich wrote:
> 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
> _sinittext (_stext really shouldn't have anything ahead of it), but
> discard only non-text symbols.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v2: Re-base over _{s,e}extratext removal. Add const to cast.
> 
> --- a/xen/tools/symbols.c
> +++ b/xen/tools/symbols.c
> @@ -217,6 +217,11 @@ static int symbol_valid(struct sym_entry
>  		if ((s->addr == _etext && strcmp((char*)s->sym + offset, "_etext")) ||
>  		    (s->addr == _einittext && strcmp((char*)s->sym + offset, "_einittext")))
>  			return 0;
> +		/* Same for non-text aliases of _sinittext or _sextratext. */

I've locally dropped this leftover mention of _sextratext.

Jan

> +		if (toupper(*s->sym) != 'T'
> +		    && s->addr == _sinittext
> +		    && strcmp((const char *)s->sym + offset, "_sinittext"))
> +			return 0;
>  	}
>  
>  	/* Exclude symbols which vary between passes. */
> 



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

end of thread, other threads:[~2026-08-26  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 14:26 [PATCH v2 0/2] symbols: aliasing at text section boundaries Jan Beulich
2026-08-25 14:27 ` [PATCH v2 1/2] symbols: drop _{s,e}extratext Jan Beulich
2026-08-25 14:29 ` [PATCH v2 2/2] symbols: also special-case symbols aliasing _sinittext Jan Beulich
2026-08-26  8:28   ` Jan Beulich

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.