简体   繁体   English

IDE(如 CodeBlocks)中的 linker、编译器、汇编器和精化器是什么?

[英]What is linker, compiler, assembler and elaborator in an IDE like CodeBlocks?

IDE consists of a linker, compiler, assembler, and elaborator. IDE 由 linker、编译器、汇编器和精化器组成。 I want to know about them as follow:我想了解它们如下:

  • What is their relation?他们的关系是什么?
  • How they are connected?它们是如何连接的?
  • What are their roles?他们的角色是什么?
  • Their preference.他们的偏好。

If possible, what is linker scripts?如果可能,什么是linker脚本?

Someone, please help me with graphics.有人,请帮我做图形。 Thanks in advance.提前致谢。

A compiler and an assembler take as input source code and produce object code files in machine language (the binary form of the CPU instructions).编译器汇编器将源代码作为输入,生成机器语言(CPU 指令的二进制形式)的 object 代码文件。 The main difference is that a compiler takes source code written in a high level language such as C/C++, meanwhile, an assembler takes source code written in the particular assembly language of your target architecture (the CPU where your code will run).主要区别在于编译器获取以 C/C++ 等高级语言编写的源代码,同时,汇编器获取以目标体系结构的特定汇编语言(代码将运行的 CPU)编写的源代码。 But some compilers, can output assembly text that is then fed as the input to an assembler.但是某些编译器可以将 output 汇编文本作为输入提供给汇编器。

A linker takes these object code files together and produces the final executable (or library). linker将这些 object 代码文件放在一起并生成最终的可执行文件(或库)。 Although some compilers/assemblers don't have an external linker since linking is internally performed by them.尽管某些编译器/汇编器没有外部 linker 因为链接是由它们在内部执行的。

A linker script is, in a broad sense, a sort of configuration file that tells the linker the details for how to combine the object files. linker 脚本在广义上是一种配置文件,它告诉 linker如何组合 object 文件的详细信息。

An elaborator or editor is where you type the source code, it is commonly integrated into IDEs such as CodeBlocks and Visual Studio.详细说明器或编辑器是您键入源代码的地方,它通常集成到 CodeBlocks 和 Visual Studio 等 IDE 中。

Their relationship is as follows: Editor -> Compiler or Assembler -> Linker (Configured by linker script) -> Final executable or library .它们的关系如下: Editor -> Compiler or Assembler -> Linker (Configured by linker script) -> Final executable or library

They don't have any preference .他们没有任何偏好 They do what they do, they don't get to choose, we tell them what to do.他们做他们该做的事,他们没有选择权,我们告诉他们该做什么。

See this post , and google "Linker scripts" for more info on them and examples.有关它们和示例的更多信息,请参阅这篇文章和谷歌“链接器脚本”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM