Why an executable program for a specific CPU does not work on Linux and Windows?

后端 未结 6 1563
滥情空心
滥情空心 2020-12-01 09:29

An executable problem like exe does not work on Linux (without wine). When compiling source code compiler produce object code which is specific to a particular cpu architect

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-01 10:26

    Here are some of the reasons I can think of off the top of my head:

    1. Different container formats (which so far seems to be the leading differentiator in this answer -- however its not the only reason).
    2. different dynamic linker semantics.
    3. different ABI.
    4. different exception handling mechanisms -- windows has SEH -- upon which C++ exception handling is built
    5. different system call semantics and different system calls -- hence different low-level libraries.

提交回复
热议问题