News for hackers. Stuff that matters.
Re:What happens before main() is executed in C and why is it... by jcranmer on Friday May 04, 2018 @03:54PM (#16997699)
The article is conflating two things:

* What happens before main()

* What can you do to make code run before main()

It suggests only the avenue of C++ global constructors to make code run before main() (as others have noted, __attribute__((constructor)) is basically the same thing for C). But there are other ways to make code run before main, such as by use of linker scripts and assembly files to put code in _start that eventually calls main() (note that it's this latter way by which all of the things they mention are done).

There are no comments on this comment yet.