BSS section problems KDS3.0 with kv4x

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

BSS section problems KDS3.0 with kv4x

跳至解决方案
1,046 次查看
robertozanichel
Contributor I

Good morning,

I've a problem related to linker allocation of memory sections, the linker keep putting variables in .bss memory section even if they are initialized and different from 0. 

The #pragma section instruction on the arm site (that i've seen in a similar discussion)  seems to have no effect. 

 

 

COMPILER OUTPUT:


Invoking: Cross ARM C++ Linker

.....
..../kds_v3/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: myelf.elf section `.bss' will not fit in region `m_data'
..../kds_v3/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: region `m_data' overflowed by 92 bytes
collect2.exe: error: ld returned 1 exit status

 

 

i want to know if there is an effective and proved solution to avoid bss occupation because every global variable that i use has it's own initialization function that is called inside the code so i don't see the need of the compiler to do it before my initialization.

Thaks for help,

i hope you help me to clarify this.

标签 (1)
标记 (2)
1 解答
825 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Roberto,

- The .bss contains all the uninitalized data.

text, data and bss: Code and Data Size Explained | MCU on Eclipse 

- If the RAM overflowed, you can relocate the variable into flash , the detail steps

please refer to this DOC:

Relocating Code and Data Using the KDS GCC Linker File for Kinetis 

Hope it helps


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

2 回复数
826 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Roberto,

- The .bss contains all the uninitalized data.

text, data and bss: Code and Data Size Explained | MCU on Eclipse 

- If the RAM overflowed, you can relocate the variable into flash , the detail steps

please refer to this DOC:

Relocating Code and Data Using the KDS GCC Linker File for Kinetis 

Hope it helps


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

825 次查看
robertozanichel
Contributor I

Thank you very much,

i was already confident with the first link you gave me, i knew that bss was where to put uninitalized data, and i think also the data intialized as zero goes there. 
I took care of all the initialization but i think sometimes code optimization play me. I solved the problem simply reorganizing the code so there is still some "black magic" for me. 

I was hoping to find a much easier (and portable) solution than using the section attribute, but i think there is "no free lunch", thanks for the link,  i  really missed that topic...

Anyway thanks for help!!! the topic helped me to have a deeper understanding.



 

0 项奖励
回复