Accuracy of "Calling Global Constructors"
Posted: Mon Sep 21, 2020 7:42 pm
I realised that the article "Calling Global Constructors" on the wiki directs us to use the .init and .fini section methods to call constructors -- particularly the "gcc will nicely put the contents of ..." implementation. Unfortunately, with my GCC 9.2 OS-spec compiler, it's not populating those sections as advertised. (they're there, but empty).
What I did find to work was the .init_array and .fini_array method that is supposedly only for ARM, but from what I could find online it's the "new" method of doing things. So my question is: are there existing kernels on a recent(-ish) version of GCC that have had success with the .init .fini method? Maybe i'm just doing things wrong...
What I did find to work was the .init_array and .fini_array method that is supposedly only for ARM, but from what I could find online it's the "new" method of doing things. So my question is: are there existing kernels on a recent(-ish) version of GCC that have had success with the .init .fini method? Maybe i'm just doing things wrong...