Custom linker placement file leads to large binary output file



  • Avatar
    Ben Rector

    When I move my constant data into SRAM1 then the image goes back down to 56 k


    <!DOCTYPE Linker_Placement_File>
    <Root name="SRAM Section Placement">
    <MemorySegment name="SRAM1">
    <ProgramSection load="Yes" name=".vectors"/>
    <ProgramSection alignment="4" load="Yes" name=".fast"/>
    <ProgramSection alignment="4" load="Yes" name=".init"/>
    <ProgramSection alignment="4" load="Yes" name=".text"/>
    <ProgramSection alignment="4" load="Yes" name=".dtors"/>
    <ProgramSection alignment="4" load="Yes" name=".ctors"/>
    <ProgramSection alignment="4" load="Yes" name=".data"/>
    <ProgramSection alignment="4" load="Yes" name=".rodata"/>
    <ProgramSection alignment="4" load="Yes" name=".constdata"/>
    <ProgramSection alignment="4" load="Yes" name=".ARM.exidx" address_symbol="__exidx_start" end_symbol="__exidx_end"/>
    <MemorySegment name="SRAM2">
    <ProgramSection alignment="4" load="No" name=".bss"/>
    <ProgramSection alignment="4" load="No" name=".non_init"/>
    <ProgramSection name=".heap" load="No" alignment="4" size="__HEAPSIZE__"/>
    <ProgramSection name=".stack" load="No" alignment="4" size="__STACKSIZE__"/>
    <ProgramSection name=".stack_irq" load="No" alignment="4" size="__STACKSIZE_IRQ__"/>
    <ProgramSection name=".stack_fiq" load="No" alignment="4" size="__STACKSIZE_FIQ__"/>
    <ProgramSection name=".stack_svc" load="No" alignment="4" size="__STACKSIZE_SVC__"/>
    <ProgramSection name=".stack_abt" load="No" alignment="4" size="__STACKSIZE_ABT__"/>
    <ProgramSection name=".stack_und" load="No" alignment="4" size="__STACKSIZE_UND__"/>
    <ProgramSection name=".tbss" load="No" alignment="4"/>
    <ProgramSection name=".tdata" load="Yes" alignment="4"/>

    Comment actions Permalink
  • Avatar
    Jon Elliott

    Raw binary (.bin) files have no address information, therefore if there is a gap between memory segments the gap will need to be included in the binary file in order to get from one segment to the other. If you use an file format that has address information (i.e. elf, srec, hex, etc), you shouldn't have this problem.



    Comment actions Permalink
  • Avatar
    Ben Rector

    Thank you for your response. That makes sense. I am generating a binary so that I can program it into flash memory.

    Comment actions Permalink

Please sign in to leave a comment.