Linker Command File

This is a discussion on Linker Command File within the Tech Board forums, part of the Community Boards category; Hi. I am trying to allocate a certain array used by my program in external memory. My LCF file looke ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    30

    Linker Command File

    Hi.

    I am trying to allocate a certain array used by my program in external memory. My LCF file looke like this:

    Code:
    MEMORY 
    {
    /* vecs + L2SRAM + CIO + STACK = size of internal memory */
        vecs:   o = 0x00000000,   l = 0x00000200, fill = 0
    	L2SRAM: o = 0x00000200,	  l = 0x000F98E0 /*1 MB of L2SRAM (minus vecs, cio sections)*/
    	CIO:	o = 0x000F9EE0,	  l = 0x00000120 /*esbn: I try this to avoid message "Invalid CIO command (5)"*/
    	STACK:  o = 0x000FF000,	  l = 0x00000400
    		 /*L2SRAM + STACK + CIO + vecs = 0xFA000 = 1024 kB*/
    	EXT_MEM: o = 0x80000000,   l = 0x000F0000 /*I allocate 983 kB externally to read in DWTinput.*/
    }
    
    SECTIONS 
    {
         "vectors"   >       vecs
    	 .my_bufs	 >		 L2SRAM	     .cinit      >       L2SRAM
         .text       >       L2SRAM
    	 .stack		 >       STACK
         .bss        >       L2SRAM
         .const      >       L2SRAM
         .data 		 >       L2SRAM
    	 "DataMatrix"
    	 {
    	 getdata.obj(.far)
    	 }           >       EXT_MEM
         .far        >       L2SRAM
         .switch     >       L2SRAM
         .sysmem     >       L2SRAM
         .tables     >       L2SRAM
         .cio        >       CIO
    }
    As far as I can understand I should now have the far-section of the getdata-file in EXT_MEM, but I get the following error message:

    >> esbnLCF.cmd: error: system error, can't open file 'getdata.obj' for input: No such file or directory

    I have checked my .map file to make sure that part of getdata.obj really is placed in the .far section.

    What can I do to allocate my array in EXT_MEM?

    Thank you.

    Esben.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,338
    > As far as I can understand I should now have the far-section of the getdata-file in EXT_MEM
    Did you use any pragma's / attributes in the source code to indicate that you want this array in a new section?
    Also, which tools are you using, this is very specific stuff.

    > >> esbnLCF.cmd: error: system error, can't open file 'getdata.obj' for input: No such file or directory
    Is it in a library?
    Is it on the search path?
    As an experiment, does the absolute path to the file work?
    What about *getdata.obj(.far)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    30
    Salem>
    I havnt made any specifications in the source code about my memory design. It's all in the LCF file above. I am using TI.s Code Composer Studio 3.1 to develop my project.

    I declared DataMatrix[] as a static global variable to make it "visible" in the map file. Therefore I know it was placed in the far section. But I wish to move it into the EXT_MEM, a section I have defined as external memory.


    >Is it in a library?
    No, its an ordinary source file in my program.

    >Is it on the search path?
    >As an experiment, does the absolute path to the file work?
    What is the search path and the absolute path?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,338
    Absolute path would be
    /path/to/getdata.obj(.far)

    You could just use in the source code
    #pragma DATA_SECTION(DataMatrix, ".extMatrix");

    And the LCF would just be
    .extMatrix > EXT_MEM
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker problem... no idea
    By cyreon in forum C Programming
    Replies: 2
    Last Post: 04-03-2009, 02:53 PM
  2. linker
    By George2 in forum C++ Programming
    Replies: 6
    Last Post: 02-23-2008, 12:25 AM
  3. Linker errors in VC++ 2005
    By C+/- in forum C++ Programming
    Replies: 0
    Last Post: 05-18-2007, 07:42 AM
  4. Linker errors when compiling
    By The Wazaa in forum C++ Programming
    Replies: 4
    Last Post: 10-07-2006, 12:55 PM
  5. MSVis-Studio C++ libraries and linker errors
    By kellydj in forum Windows Programming
    Replies: 10
    Last Post: 03-12-2002, 01:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21