r/programming • u/iximiuz • Jul 25 '26
Writing a (valid) C program without main()
https://labs.iximiuz.com/tutorials/c-program-without-main-a1eea557
193
Upvotes
r/programming • u/iximiuz • Jul 25 '26
View all comments
Show parent comment
18
u/yowhyyyy Jul 26 '26
Funnily enough this is something I’ve also played around with for my own reasons. You can align the stack as well manually if need be without passing crazy GCC flags.
I.e have you ever noticed GLIBC’s .so is actually executable? Ever wondered how they do that? Where’s main if it’s a .so? I’ll leave you with those amazing questions because it also lead me down a pretty cool rabbit hole.