From 8bcac896fa0901825ca5684657af9af01c84fb8c Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Fri, 2 Aug 2019 12:37:02 -0700 Subject: [PATCH] Revert "ANDROID: init: ensure initcall ordering with LTO" This reverts commit 9730a6289c31ff03f15671ca7dea848fc14b9bfe. This is change not sufficient for ThinLTO, it's replaced by Iddda881a52b7942781713b188d810b6100159a2b Bug: 145210207 Change-Id: Ie67f90a19bc78dbf8b61f13dcc441f0f58c60444 Signed-off-by: Sami Tolvanen --- include/linux/init.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/include/linux/init.h b/include/linux/init.h index 847e8536228f..9ef90a312a6f 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -167,20 +167,6 @@ extern bool initcall_debug; #ifndef __ASSEMBLY__ -#ifdef CONFIG_LTO_CLANG - /* - * Use __COUNTER__ prefix in the variable to help ensure ordering - * inside a compilation unit that defines multiple initcalls, and - * __LINE__ to help prevent naming collisions. - */ - #define ___initcall_name2(c, l, fn, id) __initcall_##c##_##l##_##fn##id - #define ___initcall_name1(c, l, fn, id) ___initcall_name2(c, l, fn, id) - #define __initcall_name(fn, id) \ - ___initcall_name1(__COUNTER__, __LINE__, fn, id) -#else - #define __initcall_name(fn, id) __initcall_##fn##id -#endif - /* * initcalls are now grouped by functionality into separate * subsections. Ordering inside the subsections is determined @@ -201,12 +187,12 @@ extern bool initcall_debug; #define ___define_initcall(fn, id, __sec) \ __ADDRESSABLE(fn) \ asm(".section \"" #__sec ".init\", \"a\" \n" \ - __stringify(__initcall_name(fn, id)) ": \n" \ + "__initcall_" #fn #id ": \n" \ ".long " #fn " - . \n" \ ".previous \n"); #else #define ___define_initcall(fn, id, __sec) \ - static initcall_t __initcall_name(fn, id) __used \ + static initcall_t __initcall_##fn##id __used \ __attribute__((__section__(#__sec ".init"))) = fn; #endif