Question about Linker file

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

Question about Linker file

2,055件の閲覧回数
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,896件の閲覧回数
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...