We do need to call the constructors for *modules*, and at least for KASAN in the future, we must call even the kernel constructors only later when the kernel has been initialized. Instead of relying on libc to call them, emit an empty section for libc and let the kernel's CONSTRUCTORS code do the rest of the job. Tested that it indeed doesn't work in modules, and does work after the fixes in both, with a few functions with __attribute__((constructor)) in both dynamic and static builds.
Showing the changes to init (1 of 4 files). Show all
Unified · Split
| @@ -48,7 +48,6 @@ config CC_DISABLE_WARN_MAYBE_UNINITIALIZED · 47 unmodified lines | |||
| 48 | 48 | ||
| 49 | config CONSTRUCTORS | 49 | config CONSTRUCTORS |
| 50 | bool | 50 | bool |
| 51 | depends on !UML | ||
| 52 | 51 | ||
| 53 | config IRQ_WORK | 52 | config IRQ_WORK |
| 54 | bool | 53 | bool |