Why are “Executable files” operating system dependent?

后端 未结 6 2117
无人共我
无人共我 2020-12-24 11:22

I understand that each CPU/architecture has it\'s own instruction set, therefore a program(binary) written for a specific CPU cannot run on another. But what i don\'t really

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-24 11:53

    .exe and other binary formats are [definitely] not Raw machine instructions but they contain some data that is operating system dependent.

    what this OS dependent data is like? and as an example what is the format of an .exe file and the difference between it and Linux executables?

    Well, I guess Google failed you utterly. .EXE formats are very well-defined by Windows documentation.

    http://support.microsoft.com/kb/65122

    The Linux ld application loads an executable into memory prior to "exec" to that file. You could read up on ld format or even the famous a.out file.

    http://linux.die.net/man/1/ld

    http://en.wikipedia.org/wiki/A.out

    http://en.wikipedia.org/wiki/Executable

提交回复
热议问题