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

Forum Post: RE: No Matching Section *(c_mark)

$
0
0

Here's the section of code from the legacy BOOT.ASM:


****************************************************************************
* FUNCTION DEF : __const_init                                              *
*                                                                          *
*  COPY .CONST SECTION FROM PROGRAM TO DATA MEMORY                         *
*                                                                          *
*   The function depends on the following variables                        *
*   defined in the linker command file                                     *
*                                                                          *
*   __c_load         ; global var containing start                         *
*                      of .const in program memory                         *
*   __const_run      ; global var containing run                           *
*                      address in data memory                              *
*   __const_length   ; global var length of .const                         *
*                      section                                             *
*                                                                          *
****************************************************************************
        .global __const_length,__c_load
        .global __const_run
_const_init:
 
        .sect ".c_mark"              ; establish LOAD adress of
        .label __c_load             ; .const section
 
        .text
******************************************************
* C54x VERSION                                        *
******************************************************
 
        LD      #__const_length, A
        BC      __end_const,AEQ
        STM     #__const_run,AR2 ; Load RUN address of .const
 
        RPT     #__const_length-1
        MVPD    #__c_load,*AR2+  ; Copy .const from program to data
 
******************************************************
*  AT END OF .CONST SECTION RETURN TO CALLER         *
******************************************************
__end_const:
        RET
        .endif
    .end

I am new to the C54xx assembly language, but after looking the assembly language user's guide, I see in section 6.10.3 (6-49 - 6-50),  pg 288 - 289 that in declaring a section in assembly with .sect it is followed by a .label which is followed by an actual label that has the same name as the .sect such as:

    .sect ".c_mark"

    .label c_mark_src

c_mark:

     NOP

    .label c_mark_end

    .text

    <code to copy the c_mark section into RAM>

And in the linker command file there should be entries for the c_mark section in the MEMORY block given by page, label, origin and length. In the SECTIONS block it should reference c_mark.

Here's the TisU.cmd:

MEMORY
{
  PAGE 0:  EXTPRG0:   origin = 00000h  length = 00080h
           EXTPRG1:   origin = 00080h  length = 0FE80h
           EXTPRG2:   origin = 0FF00h  length = 00080h
           INTRVECS:  origin = 0FF80h  length = 00080h

  PAGE 1:  MMREGS:    origin = 00000h  length = 00060h
           SPRAM:     origin = 00060h  length = 00020h
           OCDARAM1:  origin = 00080h  length = 01F80h
           OCSARAM1:  origin = 02000h  length = 06000h
           EXTRNDAT:  origin = 08000h  length = 08000h

  PAGE 2:  IOPORTS:   origin = 00000h  length = 10000h
}

SECTIONS
{
  .text   :
              {
              *(.text)
              } >EXTPRG1  PAGE 0
  .const  : load = EXTPRG1  PAGE 0, run = OCSARAM1 PAGE 1
              {
                  __const_run = .;
                  *(.c_mark)
                  *(.const)
                  __const_length = . - __const_run;
              }
  .cinit  : {} >EXTPRG1  PAGE 0
  .switch : {} >EXTPRG1  PAGE 0
  .data   : {} >OCDARAM1 PAGE 1
  .bss    : {} >OCSARAM1 PAGE 1
  .sysmem : {} >OCSARAM1 PAGE 1
  .stack  : {} >OCSARAM1 PAGE 1
}


Viewing all articles
Browse latest Browse all 91752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>