Remove sizeof section from Global Section Table in linker

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

Remove sizeof section from Global Section Table in linker

2,174 次查看
JPLopez
Contributor I

Hi,

In our application we are using a specific section to copy/paste an independent piece of code, we build it with different '#include "*.c"' and then can hot swap pieces of the resulting binary. We reserved a section for that independent code's RAM and BSS and we followed the existing code for the Global Section Table in the linker file:

__bss_section_table = .;
LONG( ADDR(.bss));
LONG( SIZEOF(.bss));
LONG( ADDR(.bss_RAM2));
LONG( SIZEOF(.bss_RAM2));
LONG( ADDR(.bss_RAM_BLAH)); /* our BSS */
LONG( SIZEOF(.bss_RAM_BLAH)); /* our BSS */
LONG( ADDR(.bss_RAM3));
LONG( SIZEOF(.bss_RAM3));
__bss_section_table_end = .;

The issue we are facing is that when we want to compare the rest of the binary to check integrity the 'LONG( SIZEOF(.bss_RAM_BLAH));' variable has changed between different compilations so that it messes with our integrity check.

 

My question is: is it required to have that declaration in the Global Section Table? What's the purpose of it?

Thanks,

JP

0 项奖励
回复
5 回复数

2,135 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi JPLopez 

Thank you for posting your questions.

Please let us know your chip part number thus we can assign to right enginner for answering your questions.

Thanks

Jun Zhang

0 项奖励
回复

2,089 次查看
JPLopez
Contributor I

Of course, it's the i.MX RT1021. Thank you!

0 项奖励
回复

2,071 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @JPLopez ,

You can refer to section 18.13.1 of MCUXpresso_IDE_User_guide.pdf. I think the best way is not modify link file by yourself, but use IDE to generate link file.

If it's not enough to you, you can use Freemarker linker script. The flexspi_nor_polling_transfer is a good demo.

 

Regards,

Jing

0 项奖励
回复

2,043 次查看
JPLopez
Contributor I
Hi @jingpan, first of all thank you for your reply. Sadly this does not answer my question about the purpose of the Global Section Table and the values in it. In our application we have a block of code that is interchangeable while not changing any byte from the rest of the binary. In previous microcontrollers this worked but now the values in the Global Section Table change the bytes in the "should-not-change" block of code.
0 项奖励
回复

2,030 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @JPLopez ,

Do you mean the binary code block can be copied to any address and call by function pointer?

 

Regards,

Jing

0 项奖励
回复