Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: RE: Confused by rom_model, NOLOAD, NOINIT, C auto init and C zero init and how they all work together.

$
0
0

  The wiki article does provide some clarity but I could follow the NOLOAD example presented well enough to decide if all RAM sections when using rom_model should be NOLOAD.  It sure looks to me that NOLOAD does affect auto-initialization see the following example of from out linker.cmd and resulting Map file.  Other than that I also cannot see the affect of leaving NOLOAD off in all RAM sections.   It looks like --rom_model by itself keeps RAM sections out of the output and from being loaded. 
  
        .epbi_ram_data:
        {
            XXXX_BASE_MM_PBC_ToXxx.out(.data)
            . = align(4);
            TestCode.47R(.data)
            . = align(4);
            *(.epbi_app_ram_data)
            . = align(4);
        }
     
  As you can see in the map file a copy table is created for this section.
  
.cinit     0    000d7a00    00000500    
                  000d7a00    00000008     (__TI_handler_table)
                  000d7a08    00000018     (__TI_cinit_table)
                  000d7a20    00000221     (.cinit..xxx_epb_ram_data.load) [load image, compression = rle]
                  000d7c41    00000007     --HOLE-- [fill = a4a4a4a4]
                  000d7c48    0000000e     (.cinit..epbi_ram_data.load) [load image, compression = rle]
                  000d7c56    00000002     --HOLE-- [fill = a4a4a4a4]
                  000d7c58    000002a8     (.cinit..app_ram_data.load) [load image]

  
  .epbi_ram_data: type = NOLOAD
        {
            XXXX_BASE_MM_PBC_ToXxx.out(.data)
            . = align(4);
            TestCode.47R(.data)
            . = align(4);
            *(.epbi_app_ram_data)
            . = align(4);
        }
 
  Looking at the map file you can see no copy table is created for this section.  If you look in the debugger the variables are not initialized.
  
.cinit     0    000d7a00    000004e8    
                  000d7a00    00000008     (__TI_handler_table)
                  000d7a08    00000010     (__TI_cinit_table)
                  000d7a18    00000221     (.cinit..xxx_epb_ram_data.load) [load image, compression = rle]
                  000d7c39    00000007     --HOLE-- [fill = a4a4a4a4]
                  000d7c40    000002a8     (.cinit..app_ram_data.load) [load image]

     


Viewing all articles
Browse latest Browse all 91752

Trending Articles