hey guys,
I was thinking about executable formats and from what i understand, the executable file stores the raw machine code to be loaded into the "code segment" when the program is run. So if I compile a program to add two numbers using windows and then compile the same program using Linux(without the use of header and libraries), does that mean that the exact same machine code will be place in the part of the file that stores the machine code? I know that executable files contains other parts such as headers that will be unique to each format but will the machine code part of these two programs be the same and also will any other part be the same?
I was thinking about executable formats and from what i understand, the executable file stores the raw machine code to be loaded into the "code segment" when the program is run. So if I compile a program to add two numbers using windows and then compile the same program using Linux(without the use of header and libraries), does that mean that the exact same machine code will be place in the part of the file that stores the machine code? I know that executable files contains other parts such as headers that will be unique to each format but will the machine code part of these two programs be the same and also will any other part be the same?