Linker Script - Placing a section at the end of a memory region

前端 未结 5 1518
后悔当初
后悔当初 2020-12-24 09:15

I have searched far and wide for how to do this and have failed to come up with an answer.

My memory layout is as follows:

Fake Address | Section
            


        
5条回答
  •  伪装坚强ぢ
    2020-12-24 09:55

    You can force sections at specific locations.

    For example in this Red Hat GNU Linker documentation page, you can define the .data section to start at address 0x8000000:

    SECTIONS
    {
      . = 0x10000;
      .text : { *(.text) }
      . = 0x8000000;
      .data : { *(.data) }
      .bss : { *(.bss) }
    }
    

提交回复
热议问题