lds 文件关联某些section ------汇编xx.s代码和xx.c代码

ATF bl31.ld.s 文件,其中一部分
/* Ensure 8-byte alignment for descriptors and ensure inclusion */
. = ALIGN(8);
__RT_SVC_DESCS_START__ = .;
KEEP(*(rt_svc_descs))  //保持不被gc 回收掉
__RT_SVC_DESCS_END__ = .;

c 语言定义section ,使用__attribute(section(xx))

#define DECLARE_RT_SVC(_name, _start, _end, _type, _setup, _smch) \
static const rt_svc_desc_t __svc_desc_ ## _name \
__section("rt_svc_descs") __used = { \
.start_oen = _start, \
.end_oen = _end, \
.call_type = _type, \
.name = #_name, \
.init = _setup, \
.handle = _smch }

出处来源:gcc complete ref
The __attribute__ keyword can be used to assign an attribute to a function or data
declaration. The primary purpose of assigning an attribute to a function is to make it
possible for the compiler to perform optimization. The attribute is assigned to a function
in the declaration of the function prototype,

section ---A function with this attribute will have its assembly language code placed into the named section instead of the default text section. The following is an example of a function being put
into a section named specials: void mspec(void) __attribute__((section(“specials”)));
This attribute will be ignored on systems that do not support sectioning. Also see -ffunction-sections in Appendix D

lds 文件定义
/*
* Ensure 8-byte alignment for cpu_ops so that its fields are also
* aligned. Also ensure cpu_ops inclusion.
*/
. = ALIGN(8);
__CPU_OPS_START__ = .; //new symbol,vma location counter assigns
KEEP(*(cpu_ops))
__CPU_OPS_END__ = .;


汇编中定义section

** Convenience macro to declare cpu_ops structure.* Make sure the structure fields are as per the offsets* defined above.*/.macro declare_cpu_ops _name:req, _midr:req, _noresetfunc = 0.section cpu_ops, "a"; .align 3 //allowable section.type cpu_ops_\_name, %object.quad \_midr
#if IMAGE_BL1 || IMAGE_BL31.if \_noresetfunc.quad 0.else.quad \_name\()_reset_func.endif
#endif
#if IMAGE_BL31.quad \_name\()_core_pwr_dwn //8Byte.quad \_name\()_cluster_pwr_dwn
#endif
#if (IMAGE_BL31 && CRASH_REPORTING).quad \_name\()_cpu_reg_dump
#endif.endm

来源出处:
.section <section_name>
{,”<flags>”}
Starts a new code or data section. Sections in GNU are called
.text, a code section, .data, an initialized data section, and
.bss, an uninitialized data section. These sections have default
flags, and the linker understands the default names (similar
directive to the armasm directive AREA). The following are
allowable .section flags for ELF format files:
<Flag> Meaning
a allowable section
w writable section
x executable section

ATF lds和代码section如何关联相关推荐

  1. maven下载其源代码包并关联

    有时我们的源码可能会失去关联,然后需要我们在当前项目中(含有pom.xml文件的那个目录)按住shift然后在当前项目文件夹空白处右键,选择在此处打开命令输入一下命令: 1. 下载所有在POM中的的s ...

  2. python灰色关联度分析代码_灰色关联分析法步骤 - osc_uwnmtz9n的个人空间 - OSCHINA - 中文开源技术交流社区...

    https://wenku.baidu.com/view/dc356290af1ffc4fff47ac0d.html?rec_flag=default&sxts=1538121950212 利 ...

  3. 补充番外4:创建Koroutine协程仓库并提交代码,vscode关联远方仓库

    文章目录 一.配置github上的SSH 二.创建仓库 最近开始仿照ntyco写协程项目,需要新建仓库 一.配置github上的SSH 1.命令 ssh-keygen -t rsa -C 邮箱地址 例 ...

  4. 【数学建模】灰色关联(Matlab代码实现)

    目录 1 灰色关联理论 2 算例及Matlab代码实现 2.1 算例1 2.2 算例2   2.3 算例3 2.4 算例4  3 写在最后 1 灰色关联理论 灰色关联分析l是由邓聚龙教授于1982年提 ...

  5. UML中依赖,关联,聚合,组合的含义(结合UML图和实战代码详解)

    UML中各种关系的含义 1. 什么是UML图? 2. UML图中的各种关系含义 2.1 依赖 2.1.1 简单理解及画法 2.1.2 那么在UML中的依赖是怎样的呢? 2.1.3 实战中UML图的画法 ...

  6. Linux下的lds链接脚本二

    对于.lds文件,它定义了整个程序编译之后的连接过程,决定了一个可执行程序的各个段的存储位置.虽然现在我还没怎么用它,但感觉还是挺重要的,有必要了解一下. 先看一下GNU官方网站上对.lds文件形式的 ...

  7. 51、前端代码单元测试怎么做?

    我们专栏课程的知识部分已经告一段落了.今天,我来集中解决一下大家在学习中遇到的问题,我争取用快问快答的形式,咱们多回答一些问题. 1. 前端代码单元测试还是非常有必要的,不知道老师这一块是怎么做的,能 ...

  8. __attribute__之section详解

    前言 第一次接触 "section" 是在公司的一个STM32的项目代码中,前工程师将所有的初始化函数都使用的"section"进行设定了属性.当时知道其目的, ...

  9. 写好 Python 代码的几条原则

    程序设计的好与坏,早在我们青葱岁月时就接触过了,只是那是并不知道这竟如此重要.能够立即改善程序设计.写出"好"代码的知识有以下几点: •面向对象五个基本原则: •常见的三种架构: ...

最新文章

  1. 感恩心成就了车建新和红星美凯龙
  2. Computed property XXX was assigned to but it has no setter
  3. 关于python面向对象编程中、下列说法中_关于Python面向对象编程的知识点总结
  4. 如何清除aspx网页中的flash缓存
  5. apache目录的访问控制
  6. mysql100链接同时处理_php 连接MYSQL 两个同时连接为什么只有一个连接成功,必须删掉一个,另外一个才查询生效出结果,下附代码...
  7. C# 控制台或者winform程序开启http的监听状态
  8. java中operationBox_Java使用PDFBox开发包实现对PDF文档内容编辑与保存
  9. UVa 10635 (LIS+二分) Prince and Princess
  10. 湖北工业大学计算机学院王泽建,“指尖年轮,感恩成长”计算机学院2019届毕业生晚会圆满举行...
  11. 10.java之父被B站学习者下载达7000万次的Java视频教程你还没有看过知乎
  12. 六万字 HTTP 必备知识学习,程序员不懂网络怎么行,一篇HTTP入门 不收藏都可惜
  13. Linux之分析bin文件的10种方法
  14. Windows右键菜单项管理讲解(RightMenuMgr)
  15. 第一章 网络操作系统概论
  16. vue页面报错: Uncaught ReferenceError: Login is not defined at HTMLButtonElement.onclick
  17. 为什么Vidyo 的编解码是颠覆性的创新。它的特点是什么?
  18. Anaconda闪退的问题
  19. keil5的device里面没有芯片型号
  20. 阿里云安骑士购买优惠攻略以及使用实践教程

热门文章

  1. Allegro如何使用Snake命令走蛇形线操作指导
  2. 12年时记录的一堆杂事
  3. D. Lucky Chains(gcd + 线性筛)
  4. LyX使用小记之三 公式编辑
  5. 南卡Lite Pro蓝牙耳机体验
  6. 可编程定时/计数器 8253/8254
  7. folly库安装(2)openssl升级、python3.8安装
  8. 【adcdn优化案例】某工具类app广告优化收益增长275%经验分享
  9. 转载 美国SAP高手跳槽记-转自George
  10. 经典Web容器解析漏洞