Question about Linker file

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

Question about Linker file

2,069 次查看
kiminkim
NXP Employee
NXP Employee

Hello

In the *.ld file, I would like to know what is meaning of PAD() like below.

 

    .heap   ALIGN(16) PAD(1K)         : {} > int_sram   /* Heap Area  */

    .stack  ALIGN(4)  PAD(STACK_SIZE) : {} > stack_ram  /* Stack Area */

 

Thank you.

标签 (1)
1 回复

1,910 次查看
alexvinchev
Contributor V

kiminkim You didn't wrote what your compiler is...

In case of GreenHills, it is explicitly written in the documentation:

PAD(value)

Places value bytes of padding (in zeros) at the beginning of the section. This is equivalent to specifying padding at the beginning of the section contents.

For example, the following two definitions are equivalent:

   .stack pad(0x10000) : {}

   .stack              : { . += 0x10000; }

I'll not call your question "stupid", but I think will be very helpful if you spend some time to read your compiler documentation and learn how to use search tool in the provided Help...