Commits
Sami Tolvanen committed ae14b5c9622
ANDROID: init: ensure initcall ordering with LTO With LTO, the compiler doesn't necessarily obey link order for initcalls, and the initcall variables need to be globally unique to avoid naming collisions. In order to preserve the intended order, this change moves each initcall variable into its own section and generates a linker script (in scripts/link-vmlinux.sh) to define the correct order for these sections. We also add a __COUNTER__ prefix to the name, so we can retain the order of initcalls within each compilation unit, and __LINE__ to help ensure uniqueness. Bug: 145210207 Change-Id: I602038783853497790c5a2941343c546e380c525 Signed-off-by: Sami Tolvanen <samitolvanen@google.com>