<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/linker_lists.h, branch v2026.07</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/include/linker_lists.h?h=v2026.07</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/include/linker_lists.h?h=v2026.07'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-04-14T17:04:04Z</updated>
<entry>
<title>Merge patch series "A few linker-list fixes"</title>
<updated>2026-04-14T17:04:04Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2026-04-14T17:04:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5a998ab00758a0cc757d39335d515694c60e7062'/>
<id>urn:sha1:5a998ab00758a0cc757d39335d515694c60e7062</id>
<content type='text'>
Simon Glass &lt;sjg@chromium.org&gt; says:

This series includes two patches to fix alignment problems with linker
lists. In certain circumstances these can cause the drivers list to be
non-contiguous, causing crashes, hangs, etc.

Link: https://lore.kernel.org/r/20260321134626.516665-1-sjg@chromium.org
</content>
</entry>
<entry>
<title>dm: Fix linker list alignment for ll_entry_get()</title>
<updated>2026-04-14T17:03:52Z</updated>
<author>
<name>Simon Glass</name>
<email>simon.glass@canonical.com</email>
</author>
<published>2026-03-21T13:46:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a6672a4804debd9de4f7bcc1d2f2a07ff30e1eed'/>
<id>urn:sha1:a6672a4804debd9de4f7bcc1d2f2a07ff30e1eed</id>
<content type='text'>
The extern declaration in ll_entry_get() lacks the __aligned(4)
attribute present in ll_entry_declare(). When the compiler sees an
unaligned extern reference to a linker list entry in the same
compilation unit as its definition, it may increase the section
alignment beyond the expected struct size. This causes gaps in the
linker list array, which the alignment checker reports as failures.

For example, sandbox_dir is both defined and referenced via
DM_DRIVER_GET() in sandboxfs.c. The compiler applies 32-byte
alignment to its section instead of the 4-byte alignment from the
definition, creating an 8-byte gap before it in the driver list.

Add __aligned(4) to the extern declaration in ll_entry_get() to
match ll_entry_declare()

Signed-off-by: Simon Glass &lt;simon.glass@canonical.com&gt;
</content>
</entry>
<entry>
<title>linker_lists: Fix end-marker alignment to prevent padding</title>
<updated>2026-04-14T17:03:52Z</updated>
<author>
<name>Simon Glass</name>
<email>simon.glass@canonical.com</email>
</author>
<published>2026-03-21T13:46:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f9b507748080c2ef52d516345c2431182a83f19f'/>
<id>urn:sha1:f9b507748080c2ef52d516345c2431182a83f19f</id>
<content type='text'>
Change the alignment of end markers in ll_entry_end() and ll_end_decl()
from __aligned(4) and __aligned(CONFIG_LINKER_LIST_ALIGN) respectively
to __aligned(1).

The linker places zero-size end markers at aligned boundaries based on
what follows them. When the next list's start marker has a high alignment
requirement (e.g., 32 bytes), padding gets inserted before the end
marker. This causes the byte span (end - start) to not be an exact
multiple of the struct size.

The compiler optimises pointer subtraction (end - start) using
magic-number multiplication for division. This optimisation only produces
correct results when the byte span is an exact multiple of the struct
size. With padding, the result is garbage (e.g., -858993444 instead of
15).

By using __aligned(1), the end marker is placed immediately after the
last entry with no padding, ensuring (end - start) equals exactly
(n * sizeof) where n is the number of entries. This makes
ll_entry_count() and direct pointer arithmetic work correctly.

Fixes: 0b2fa98aa5e5 ("linker_lists: Fix alignment issue")
Signed-off-by: Simon Glass &lt;simon.glass@canonical.com&gt;
</content>
</entry>
<entry>
<title>linker_lists.h: drop never used ll_start, ll_end macros</title>
<updated>2026-04-03T19:56:32Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>ravi@prevas.dk</email>
</author>
<published>2026-03-23T08:39:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e2138cf1e6088f12ffa874e87cc8f4b198378635'/>
<id>urn:sha1:e2138cf1e6088f12ffa874e87cc8f4b198378635</id>
<content type='text'>
These macros have AFAICT never been used at all. It's also far from
clear what purpose it could serve - for one thing, what _type would
one pass, other than void perhaps? The example using "struct
my_sub_cmd" seems misplaced, as how could one know that the first
linker list consists of those, and moreover, how would one know how
many there are?

The linker list concept is fragile enough on its own, there is no need
to have unused functionality lying around that may or may not bitrot
and certainly will confuse readers of linker_lists.h.

Signed-off-by: Rasmus Villemoes &lt;ravi@prevas.dk&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>Improve support for linker lists in data structures</title>
<updated>2025-01-24T20:34:40Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2025-01-20T21:25:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f0781acc37fe91eebc8ff5b882503ecd6174af5a'/>
<id>urn:sha1:f0781acc37fe91eebc8ff5b882503ecd6174af5a</id>
<content type='text'>
A limitation of most linker_list macros is that they cannot easily be
used in data structures. This is because they include code inside their
expressions.

Provide a way to support this, with new ll_start_decl() and
ll_end_decl() macros.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>linker_lists: Rework start/end macros to not rely on undefined behavior</title>
<updated>2023-04-04T16:24:29Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2023-03-28T18:54:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d0e3378ad73ed80d4baab95e2c3aaa0a18ae7747'/>
<id>urn:sha1:d0e3378ad73ed80d4baab95e2c3aaa0a18ae7747</id>
<content type='text'>
Per the GCC bug listed below, the way we do linker lists is relying on
undefined behavior that seems to work in gcc, but doesn't always work in
clang. Andrew suggests rewriting our start/end macros in a different way
(as implemented here, from what he said in comment 1) to avoid these
problems.

Reported-by: AdityaK &lt;appujee@google.com&gt;
Suggested-by: Andrew Pinski &lt;apinski@marvell.com&gt;
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108915
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Andrew Pinski &lt;apinski@marvell.com&gt;
</content>
</entry>
<entry>
<title>linker_lists: Rename sections to remove . prefix</title>
<updated>2022-06-23T16:58:18Z</updated>
<author>
<name>Andrew Scull</name>
<email>ascull@google.com</email>
</author>
<published>2022-05-30T10:00:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=99e2fbcb69f0759432c4cfa0b6e1afa006f22930'/>
<id>urn:sha1:99e2fbcb69f0759432c4cfa0b6e1afa006f22930</id>
<content type='text'>
Rename the sections used to implement linker lists so they begin with
'__u_boot_list' rather than '.u_boot_list'. The double underscore at the
start is still distinct from the single underscore used by the symbol
names.

Having a '.' in the section names conflicts with clang's ASAN
instrumentation which tries to add redzones between the linker list
elements, causing expected accesses to fail. However, clang doesn't try
to add redzones to user sections, which are names with all alphanumeric
and underscore characters.

Signed-off-by: Andrew Scull &lt;ascull@google.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>treewide: Convert macro and uses of __section(foo) to __section("foo")</title>
<updated>2021-05-24T18:21:30Z</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-05-20T11:23:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=236f2ec43266cb4dabd320381498df6c9d80c82d'/>
<id>urn:sha1:236f2ec43266cb4dabd320381498df6c9d80c82d</id>
<content type='text'>
This commit does the same thing as Linux commit 33def8498fdd.

Use a more generic form for __section that requires quotes to avoid
complications with clang and gcc differences.

Remove the quote operator # from compiler_attributes.h __section macro.

Convert all unquoted __section(foo) uses to quoted __section("foo").
Also convert __attribute__((section("foo"))) uses to __section("foo")
even if the __attribute__ has multiple list entry forms.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>linker_lists: document ll_entry_ref parameters</title>
<updated>2021-04-10T10:00:24Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>xypron.glpk@gmx.de</email>
</author>
<published>2021-03-28T08:53:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f44c214541b8e194e284a4d08e95f3ed09a0b262'/>
<id>urn:sha1:f44c214541b8e194e284a4d08e95f3ed09a0b262</id>
<content type='text'>
Avoid 'make htmldocs' build warnings:

    ./include/linker_lists.h:224: warning:
    Function parameter or member '_type' not described in 'll_entry_ref'
    ./include/linker_lists.h:224: warning:
    Function parameter or member '_name' not described in 'll_entry_ref'
    ./include/linker_lists.h:224: warning:
    Function parameter or member '_list' not described in 'll_entry_ref'

Fixes: 851144350b6f ("linker_lists: Allow use in data structures")
Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>dm: core: Add macros to access the new linker lists</title>
<updated>2021-03-22T06:23:28Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-03-15T04:25:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=607f9bcb0d0af57c52bacf4d3aeb3a7d389ea206'/>
<id>urn:sha1:607f9bcb0d0af57c52bacf4d3aeb3a7d389ea206</id>
<content type='text'>
Add macros which work with instantiated devices and uclasses, as created
at build time by dtoc. Include variants that can be used in data
structures.

These are mostly used by dtoc but it is worth documenting them fully for
the occasional case where they might come up in user code.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
</feed>
