Remove sizeof section from Global Section Table in linker

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Remove sizeof section from Global Section Table in linker

2,175件の閲覧回数
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,136件の閲覧回数
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,090件の閲覧回数
JPLopez
Contributor I

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

0 件の賞賛
返信

2,072件の閲覧回数
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,044件の閲覧回数
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,031件の閲覧回数
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 件の賞賛
返信