AnsweredAssumed Answered

using different names of output sections which depend from macro __MEMINIT__

Question asked by bookevg on Jan 2, 2017
Latest reply on Apr 13, 2017 by bookevg

I learn the standart ldr files for ADSP214xx.

I can't understand using different names of output sections which depend from macro __MEMINIT__.

For example:

#ifdef __MEMINIT__
    // The meminit utility ignores output section seg_rth.
    seg_rth PM
#else
    dxe_iv_code PM
#endif
    {
      // Interrupt vector code (4 NW instructions per interrupt)
      INPUT_SECTIONS( CRT_HDR(iv_code) )
    } > mem_iv_code

#ifdef __MEMINIT__
    // The meminit utility ignores output section seg_swco.
    seg_swco SW
#else
    dxe_block0_sw_code_prio3 SW
#endif
    {
      FILL(0x1)  // fill gaps in memory with NOPs
      INPUT_SECTIONS( $OBJS_LIBS(seg_swco seg_pmco) )
    } > mem_block0_sw16

#ifdef __MEMINIT__
    // The meminit utility ignores output section seg_pmco.
    seg_pmco PM
#else
    dxe_block0_nw_code_prio3 PM
#endif
    {
      INPUT_SECTIONS( $OBJS_LIBS(seg_pmco) )
    } > mem_block0_sw16

Can I use only the same name of output section with or without __MEMINIT__?

For example:

dxe_iv_code PM
{
      // Interrupt vector code (4 NW instructions per interrupt)
      INPUT_SECTIONS( CRT_HDR(iv_code) )
} > mem_iv_code

dxe_block0_sw_code_prio3 SW
{
      FILL(0x1)  // fill gaps in memory with NOPs
      INPUT_SECTIONS( $OBJS_LIBS(seg_swco seg_pmco) )
} > mem_block0_sw16

dxe_block0_nw_code_prio3 PM
{
      INPUT_SECTIONS( $OBJS_LIBS(seg_pmco) )
} > mem_block0_sw16

Outcomes