编译链接: object code 与 machine code 有啥区别

编译链接: object code 与 machine code 有啥区别

object code与machine code完全一样,本身就可以当machine code用啦。但是包含object code的文件(.o文件)不能直接运行,因为.o文件里面缺少运行的各种库。linker(链接过程)的工作就是在.o文件里面加上以机器码表示的各种静态库,从而使该文件能够独立运行。仅此而已!plus:一些库在link的时候没有加,但是会在最后的运行文件的时候自己临时加上去,也不会影响文件的运行。大概就是这样,具体可以去参考Randal E.Bryant 的《Computer System》这本书的第三章,那里会有很详细的说明
■网友
object code是编译器产生的,编译原理里面有说,在高级语言到低级语言的中间形式就是object code。外文解释:编译链接: object code 与 machine code 有啥区别

The code produced by a compiler. Programmers write programs in a form called source code. The source code consists of instructions in a particular language, like C or FORTRAN. Computers, however, can only executeinstructions written in a low-level language called machine language.To get from source code to machine language, the programs must be transformed by a compiler. The compiler produces an intermediary form called object code. Object code is often the same as or similar to a computer\u0026#39;s machine language. The final step in producing an executable program is to transform the object code into machine language, if it is not already in this form. This can be done by a number of different types of programs, called assemblers, binders,linkers, and loaders.
【编译链接: object code 与 machine code 有啥区别】 参考网站What is object code? Webopedia Definition


    推荐阅读