looking for some solutions? You are welcome.

SOLVED: Increasing text section manually

Thomas:

I have linker script as follows,

MEMORY { ROM: ORIGIN = 0x00000000 LENGTH = 128K }
MEMORY { RAM: ORIGIN = 0xA0000000 LENGTH = 128K }
      .text :
      {
        *(.text.init)
        *(.text.entry)
        *(.text.exception)
        *(.text .text.*)
        *(.rdata)
        *(.rodata .rodata.*)
        _etext = .;
      } > ROM

      .data : AT (ADDR(.text) + SIZEOF(.text))
      {
        _data = .;
        *(vector_table)
        *(.data .data.*)
        *(.sdata* .sdata.*)
        _edata = .;
      } > RAM

Now when I compile and check the object dump my sections are as expected. My data is present in ROM at offset 0x5910 - 0x5a80 but Global symbols are linked to 0xa0000000. Till here it is fine. Now, we have a final script which reads all elfs and creates one large binary. For some reason the binary reads only executable section of all elfs(different architecture). Because of this only text section is copied to the final bin. But in this elf I want both text and data to be copied to the final bin. 1) One option is to modify the final script to copy both these section for this particular elf. 2) Or i was thinking is there a way to increase the size of text section in linker script to include .data section also. That way I dont have to modify the final script. Any thoughts?



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent