rt-thread中MSH_CMD_EXPORT()函数的实现原理-const char __fsym_##cmd##_name[] RT_SECTION(“.rodata.name“) = #cmd

const char _fsym##cmd##_name[] RT_SECTION(".rodata.name") = #cmd 学习一下这行代码 对这行代码里面的 __fsym 双#,RT_SECTION这些都不理解
#define RT_SECTION(x) attribute((section(x))) 这行代码的__attribute__((section(x)))又是什么意思???
学习结论: 把__fsym_##cmd##_name[]这个变量放置到名为".rodata.name"的段中
attribute((section(x))) 使用详解----精品
那么问题来了,使用section将变量放到我们自定义的输入段中有什么意义呢?
言归正传,现在继续来讲如何使用section将不同的函数放到我们想要的输入段中,并且获得他们的起始地址和结束地址。
我们可以在每个XXX_Init函数后面都调

rt-thread中MSH_CMD_EXPORT()函数的实现原理-const char __fsym_##cmd##_name[] RT_SECTION(“.rodata.name“) = #cmd最先出现在Python成神之路

版权声明:
作者:感冒的梵高
链接:https://www.techfm.club/p/19920.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>