当前位置:网站首页>Compilation and linking
Compilation and linking
2022-07-29 04:09:00 【echo_ zcc】
One 、 Compilation process

Two 、 Preprocessing
C The one-step operation of the language compiler before compiling the source code .
| function | effect |
|---|---|
| Header file expansion | Replace the header file name with the contents of the header file used in the program |
| Macro replace | Symbols in the scanner , Replace it with the content defined by the macro |
| To comment on | Remove the comments from the program |
| Conditional compilation | Filter out pseudo commands in conditional compilation |
3、 ... and 、 compile
The process of compiling is essentially the process of translating high-level language into machine language .
- morphology 、 grammar 、 Semantic analysis . After confirming that all instructions comply with the rules , Translate it into equivalent assembly code .
- Code optimization . Delete public expression , Cycle optimization 、 Copying spread 、 Deletion of useless assignment .
- Target code optimization . Use the values of relevant variables stored in each hardware register of the machine , To reduce the number of accesses to memory .
Four 、 assembly
The assembly process is the process of translating the compiled assembly language code into the target machine instructions .
What is stored in the assembly object file is the machine language code of the object equivalent to the source program . The object file consists of segments . Usually there are at least two segments in a target file .
| Paragraph name | effect |
|---|---|
| Code segment | Program instructions |
| Data segment | All kinds of global variables or static data to be used in the program |
5、 ... and 、 link
The function of link is to complete the connection of various called functions and libraries in the file , And package them together to form an executable .
- Symbol resolution
Make sure that the variables used have their unique definitions . - relocation
Through the linker, the data and code in different target files are reallocated to memory addresses , bring CPU Can find instructions from memory .
边栏推荐
- OA项目之会议通知(查询&是否参会&反馈详情)
- UCOS任务切换过程
- 淘宝商品详情接口(商品详情页面数据接口)
- [kvm] create virtual machine from kickstart file
- [paper translation] vectornet: encoding HD maps and agent dynamics from vectorized representation
- LVS+KeepAlived高可用部署实战应用
- Lua语言(stm32+2G/4G模块)和C语言(stm32+esp8266)从字符串中提取相关数据的方法-整理
- Design of environment detection system based on STM32 and Alibaba cloud
- 关于双指针的思想总结
- GBase 8a特殊场景下屏蔽 ODBC 负载均衡方式?
猜你喜欢

UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)

Ma Zhixing entered the mass production of front loading, starting with the self-developed domain controller?

C语言实现三子棋游戏(详解)

VScode连接ssh遇到的问题

Typescript from getting started to mastering (XXII) namespace namespace (I)

2021 sist summer camp experience + record post of School of information, Shanghai University of science and technology
![[原理] 横向渗透的几种方式](/img/fc/2ef7dd6ebc5c0bd8f7d302d8b596d6.png)
[原理] 横向渗透的几种方式

SQL window function

Blood cases caused by < meta charset=UTF-8> -- Analysis of common character codes

Nacos registry
随机推荐
After I get the winfrom specific control ID from the database, I need to find the corresponding control through this ID and assign a value to the text text of the control. What should I do
Safari's compatibility with Z-index
Communication between parent-child components and parent-child components provide and inject
有一种密码学专用语言叫做ASN.1
Deconstruction assignment of new features of ES6
数据集成这个地方的过滤条件该咋写,用的啥语法?sql语法处理bizdate可以不
Blood cases caused by < meta charset=UTF-8> -- Analysis of common character codes
[BGP] small scale experiment
店铺排名问题,如何解决?
Is the browser multi process or single process?
Basic configuration of BGP - establish peers and route announcements
Arrow function of new features of ES6
LDP -- label distribution protocol
如何查询版本的提交号
Note: restframe work records many to one tables, how to serialize in that table (reverse query)
当我从数据库获取到了winfrom特定的控件ID之后我需要通过这个ID找到对应的控件,并对控件的TEXT文本进行赋值这该怎么做
力扣面试题17.04 消失的数字||260.只出现一次的数字(内含位运算知识点)
C language - character array - string array - '\0' -sizeof-strlen() -printf()
The function parameters of the new features of ES6 are assigned initial values and rest parameters
对一个元素使用多种变形的方法