Linker Section Definitions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker Section Definitions

Jump to solution
7,180 Views
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.

Labels (1)
1 Solution
2,131 Views
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.

View solution in original post

0 Kudos
4 Replies
2,131 Views
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,131 Views
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 Kudos
2,132 Views
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 Kudos
2,131 Views
jimfell
Contributor III

Thanks, that seems to have done the trick!

0 Kudos