Linker Section Definitions

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Linker Section Definitions

跳至解决方案
7,253 次查看
jimfell
Contributor III

I'm using CodeWarrior 10.2 with MCF51JM128.  Where can I find documentation describing the purposes or uses of these sections:

 

.text

.rodata

.sdata

.sbss

.bss

.data

 

Thanks.

标签 (1)
1 解答
2,204 次查看
kef
Specialist I

jimfell wrote:

Do you know how/if it is possible to disable the Address Register Indirect with Displacement Mode in CodeWarrior 10? 

In Coldfire Processor options set "Use .sdata/.sbss" to "All data smaller than" 0 "bytes".

jimfell wrote:

We are trying to map the code in question to a specific area in memory between the boot code and main code, so that it can be used by both the bootloader and main application.

I believe you are on the wrong track. It is much better to make independent bootloader and application parts of code, 2 projects for both, 2 independent compiler/linker settings for both, etc. MCU boots always to bootloader. Bootloader checks validity of loaded application code and either jumps to app or keeps waiting for bootload commands. Application on receipt of boot command restarts MCU and somehow signals bootloader that it shouldn't jump back to app. But please don't ask me how and why, it was discussed already so many times.

在原帖中查看解决方案

0 项奖励
4 回复数
2,204 次查看
kef
Specialist I

.text - Pogram code

.rodata - constant data

.bss - static storage variables without initializer, like

    int var;

.data - static storage variables with initializer, like

   int var = 10;


.sbss and .sdata are similar to .bss and .data, but data in these sections are accessed using shorter "Address Register Indirect with Displacement Mode" addressing mode. A5 register is initialized at startup and points to sbss/sdata sections. Variables are addressed relative to sbss/sdata sections. This allows to save some code space.

2,204 次查看
jimfell
Contributor III

Thank you, Edward, this is very helpful.  Do you know how/if it is possible to disable the Address Register Indirect with Displacement Mode in CodeWarrior 10?  Would changing the Code and Data models in the C/C++ Build Tools Settings have this effect?

We are trying to map the code in question to a specific area in memory between the boot code and main code, so that it can be used by both the bootloader and main application.  It sounds like this indirect addressing may be problematic, since the boot loader and main application are compiled seperately.

0 项奖励
2,205 次查看
kef
Specialist I

jimfell wrote:

Do you know how/if it is possible to disable the Address Register Indirect with Displacement Mode in CodeWarrior 10? 

In Coldfire Processor options set "Use .sdata/.sbss" to "All data smaller than" 0 "bytes".

jimfell wrote:

We are trying to map the code in question to a specific area in memory between the boot code and main code, so that it can be used by both the bootloader and main application.

I believe you are on the wrong track. It is much better to make independent bootloader and application parts of code, 2 projects for both, 2 independent compiler/linker settings for both, etc. MCU boots always to bootloader. Bootloader checks validity of loaded application code and either jumps to app or keeps waiting for bootload commands. Application on receipt of boot command restarts MCU and somehow signals bootloader that it shouldn't jump back to app. But please don't ask me how and why, it was discussed already so many times.

0 项奖励
2,204 次查看
jimfell
Contributor III

Thanks, that seems to have done the trick!

0 项奖励