Suppose I build an executable in little endian machine. In the application I take an input from the user and compare it with a constant. I believe the constant will be saved as little endian during the compile process.
This exe is now run on big endian machine. The application takes input from the user. This input should be saved in big endian.
How does the comparison work then?
Suppose I build an executable in little endian machine. In the application I take
Share
A cross compiler is responsible to doing what’s necessary to produce an executable for the target machine(s). If the host happens to be little endian and the target big endian (or vice versa), then yes chances are pretty good it’ll have to take that into account.
Endianess is just one of many factors involved here though — virtually anything about the target (e.g., file formats, instruction set, OS interface(if any), number and/or size of registers) is likely to be different.