Revert "ANDROID: init: ensure initcall ordering with LTO"
This reverts commit 9730a6289c.
This is change not sufficient for ThinLTO, it's replaced by
Iddda881a52b7942781713b188d810b6100159a2b
Bug: 145210207
Change-Id: Ie67f90a19bc78dbf8b61f13dcc441f0f58c60444
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
committed by
Alistair Delva
parent
a15c6ebb17
commit
8bcac896fa
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user