News for hackers. Stuff that matters.
Re:What happens before main() is executed in C and why is it... by fra on Friday May 04, 2018 @12:55PM (#16996078)
In the embedded software context, you typically do your own static initialization in a startup.S file or equivalent. There should be 0 ambiguity as to when your DATA section is copied to RAM.
Re:What happens before main() is executed in C and why is it... by monocasa on Friday May 04, 2018 @01:07PM (#16996182)
There's generally a difference between "static initialization" copying .data from ROM to RAM, and running static initialization functions out of the table. That table doesn't really have ordering constraints generally.