====== 2015-02-19 - 'main' is usually a function ====== [[http://szborows.blogspot.com|SÅ‚awek]] recently sent me an awesome article. it appears that even though [[https://jroweboy.github.io/c/asm/2015/01/26/when-is-main-not-a-function.html|'main' is usually a function]], it does not have to be so... :) long story short -- linker is expecting to have a non-C++-mangled symbol called //main//. and that's it. if not a function than what? in fact it can be an array of bytes, which represents an assembly code! i guess //main// could also be a single variable, followed by a series of other variables, that represent consecutive instructions (encoded as numbers). just thinking out loud -- a beer on me for whoever first finds variables representing series of integers that represent a program, that changes these variables as it executes and executes changed values again((watch out for icache! :P)), resulting in another (valid) program changing itself and so on ad infinitum... a sort of fractal code. extra beer if these numbers are floating point! :D