I've started learning about embedded systems and wondering since the compilers used for embedded applications aren't the same as the ones used for desktop applications; whether they behave differently in terms of how they compile the C code, files created, etc.
If we look at gcc that is targetted to the ARM platform ( as there are builds for ‘bare metal’ and Linux) the main differences is the runtime environment. In the bare metal build (arm-none-eabi) the C runtime has to provide the startup code to setup the interrupt vectors, stack, heap etc. as well,the C library has to take care of the low level details itself like memory allocation. Contrast this with a Linux build where the startup code doesn’t need to worry about the interrupt vectors (the o/s takes care of this), the stack and memory space is managed by the o/s. The C library can call the o/s for things like i/o and memory allocation.
Another thing that comes to mind is embedded systems frequently have the code in rom, so the startup code has to manage copying initialised data etc. into ram. Whereas under Linux, the assumption is the code is running in ram.
In summary, the compiler in itself is the same, the runtime environment is where it differs.