Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93185a91 authored by Sami Tolvanen's avatar Sami Tolvanen Committed by Alistair Delva
Browse files

ANDROID: init: ensure initcall ordering with LTO



With LTO, the compiler doesn't necessarily obey link order for
initcalls, and the initcall variable needs to be globally unique
to avoid naming collisions.

In order to preserve the correct order, we add each variable
into its own section and generate a linker script (in
scripts/link-vmlinux.sh) to ensure the order remains correct.  We
also add a __COUNTER__ prefix to the name, so we can retain the
order of initcalls within each compilation unit, and __LINE__ to
make the names more unique.

Bug: 145210207
Change-Id: Iddda881a52b7942781713b188d810b6100159a2b
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent 8bcac896
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment