ARMLINK 的几个概念

本文介绍了ELF格式中的段划分,包括.text、.constdata属于只读(RO)段,.data对应读写(RW)段,.bss对应未初始化(ZI)段。并详细解释了如何使用特定符号来标记各段的起始与结束地址。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ELF格式中,

.text 对应RO段

.constdata 对应RO段

.data  对应RW 段

.bss 对应ZI段

 

;一个arm由RO,RW,ZI三个段组成 (对于GNU工具 对应的概念是TEXT ,DATA,BSS)

;bootloader要将RW段复制到ro中并将ZI段清零 编译器使用下列段来记录各段的起始和结束地址

; |Image$$RO$$Base| ; RO段起始地址

; |Image$$RO$$Limit| ; RO段结束地址加1

; |Image$$RW$$Base| ; RW段起始地址

; |Image$$RW$$Limit| ; RW段结束地址加1

; |Image$$ZI$$Base| ; ZI段起始地址

; |Image$$ZI$$Limit| ; ZI段结束地址加1

 

The selectors are not case-sensitive. The following selectors are
recognized:
• RO-CODE
• RO-DATA
• RO, selects both RO-CODE and RO-DATA
• RW-DATA
• RW-CODE
• RW, selects both RW-CODE and RW-DATA
• ZI
• ENTRY, that is a section containing an ENTRY point.
The following synonyms are recognized:
• CODE for RO-CODE
• CONST for RO-DATA
• TEXT for RO
• DATA for RW
• BSS for ZI.
The following pseudo-attributes are recognized:
• FIRST
• LAST.

 

 

FIRST and LAST can be used to mark the first and last sections in an
execution region if the placement order is important (for example, if a
specific input section must be first in the region and an input section
containing a checksum must be last). The first occurrence of FIRST or LAST
as an input_section_attr terminates the list.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值