U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <ravi@prevas.dk>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de,  Tom Rini <trini@konsulko.com>
Subject: Re: [RFC PATCH 5/9] linker_lists.h: drop _2 from section and symbol name prefix
Date: Tue, 26 May 2026 23:44:44 +0200	[thread overview]
Message-ID: <874ijtg81f.fsf@prevas.dk> (raw)
In-Reply-To: <CAFLszTi-se65R5w99LSUT3BwgJbe9UrXzB7VoTVo3CSSVg9Pkw@mail.gmail.com> (Simon Glass's message of "Mon, 25 May 2026 09:02:50 -0600")

On Mon, May 25 2026, Simon Glass <sjg@chromium.org> wrote:

> Hi Rasmus,
>
> On 2026-05-22T21:27:48, Rasmus Villemoes <ravi@prevas.dk> wrote:
>> linker_lists.h: drop _2 from section and symbol name prefix
>>
>> Since commit e2138cf1e60 ("linker_lists.h: drop never used ll_start,
>> ll_end macros"), which removed macros that would create
>> __u_boot_list_1 and __u_boot_list_3 sections, the first _2 in the
>> linker list section names doesn't serve any purpose and is in fact
>> just confusing. So remove it.
>>
>> There never seemed to be a reason for the symbol names to have that
>> _2, other than perhaps for consistency with the section those symbols
>> belonged to. Regardless, remove that as well.
>>
>> All linker scripts use a '__u_boot_list*' glob, so they will work just
>> the same without that common _2.
>>
>> Keep the _2_ part in the separator between list and entry names for
>> symbols, since that is called out in the documentation to allow one to
>> define sublists and iterate over those. I cannot find any current use
>> of that feature, but a later patch will make use of just that.
>>
>> [...]
>>
>> include/linker_lists.h | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>
>> diff --git a/include/linker_lists.h b/include/linker_lists.h
>> @@ -19,11 +19,11 @@
>> -#define ll_start_section_name(_list)        '__u_boot_list_2_'#_list'_1'
>> -#define ll_entry_section_name(_list, _name) '__u_boot_list_2_'#_list'_2_'#_name
>> -#define ll_end_section_name(_list)          '__u_boot_list_2_'#_list'_3'
>> +#define ll_start_section_name(_list)        '__u_boot_list_'#_list'_1'
>> +#define ll_entry_section_name(_list, _name) '__u_boot_list_'#_list'_2_'#_name
>> +#define ll_end_section_name(_list)          '__u_boot_list_'#_list'_3'
>
>>
>> -#define ll_entry_symbol_name(_list, _name) _u_boot_list_2_##_list##_2_##_name
>> +#define ll_entry_symbol_name(_list, _name) _u_boot_list_##_list##_2_##_name
>
> The linker scripts all use a '__u_boot_list*' glob, but several other
> places hard-code the old prefix and this patch does not update them:
>
> scripts/gen_ll_addressable_symbols.sh:14 greps for
>      '_u_boot_list_2_[a-zA-Z0-9_]*_2_[a-zA-Z0-9_]*'
>   which is fed into the LTO keep-symbols build step (cmd_keep_syms_lto
> in the top-level Makefile). With the new names this matches nothing,
> so LTO builds silently lose the __ADDRESSABLE() guards.
>

> scripts/event_dump.py hard-codes
>      PREFIX_FULL = '_u_boot_list_2_evspy_info_2_'
>      PREFIX_SIMPLE = '_u_boot_list_2_evspy_info_simple_2_'
>   so the script (and test_event_dump.py) stop finding anything.
>
> test/py/conftest.py has
>      RE_UT_TEST_LIST =
> re.compile(r'[^a-zA-Z0-9_]_u_boot_list_2_ut_(.*)_2_(.*)\s*$')
>   which is how test.py enumerates ut subtests - this breaks test
> discovery for individual UT suites.

Ah yes, thanks. I wonder how I could miss those.

They are of course all trivial to update. But for the
gen_ll_addressable_symbols.sh script, I do wonder why the __ADDRESSABLE
wasn't just made part of the ll macros. It has since grown another
__stack_chk_guard, but that too should be able to just have its
ADDRESSABLE marking in the (ordinary C) TU that defines it.

Rasmus

  reply	other threads:[~2026-05-26 21:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 21:27 [RFC PATCH 0/9] linker list sanity checking Rasmus Villemoes
2026-05-22 21:27 ` [RFC PATCH 1/9] sandbox: Drop special link order treatment of start.o and sdl.o Rasmus Villemoes
2026-05-25 14:30   ` Simon Glass
2026-05-22 21:27 ` [RFC PATCH 2/9] linker_lists: Do not set "unused" attribute Rasmus Villemoes
2026-05-25 15:02   ` Simon Glass
2026-05-25 15:22     ` Tom Rini
2026-05-25 15:33       ` Simon Glass
2026-05-25 15:46         ` Tom Rini
2026-06-12 18:25           ` Simon Glass
2026-05-22 21:27 ` [RFC PATCH 3/9] event: Remove obsolete comment and __used attributes Rasmus Villemoes
2026-05-25 14:31   ` Simon Glass
2026-05-22 21:27 ` [RFC PATCH 4/9] linker_lists.h: add ll_*_name() helper macros Rasmus Villemoes
2026-05-22 22:44   ` Tom Rini
2026-05-25 14:32   ` Simon Glass
2026-05-22 21:27 ` [RFC PATCH 5/9] linker_lists.h: drop _2 from section and symbol name prefix Rasmus Villemoes
2026-05-22 22:44   ` Tom Rini
2026-05-25 15:02   ` Simon Glass
2026-05-26 21:44     ` Rasmus Villemoes [this message]
2026-05-27  4:41       ` Simon Glass
2026-05-22 21:27 ` [RFC PATCH 6/9] linker_lists.rst: update documentation Rasmus Villemoes
2026-05-22 22:45   ` Tom Rini
2026-05-25 15:03   ` Simon Glass
2026-05-26 21:49     ` Rasmus Villemoes
2026-05-22 21:27 ` [RFC PATCH 7/9] test: avoid use of special characters in ELF section names Rasmus Villemoes
2026-05-22 22:45   ` Tom Rini
2026-05-25 15:03   ` Simon Glass
2026-05-22 21:27 ` [RFC PATCH 8/9] linker_lists.h: emit lots of meta-data for debugging and sanity checking Rasmus Villemoes
2026-05-25 14:28   ` Simon Glass
2026-05-26 22:26     ` Rasmus Villemoes
2026-05-26 22:41       ` Rasmus Villemoes
2026-05-27  4:09         ` Simon Glass
2026-05-22 21:27 ` [RFC PATCH 9/9] tools: add linker-lists.py parser/checker script Rasmus Villemoes
2026-05-25 15:04   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ijtg81f.fsf@prevas.dk \
    --to=ravi@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox