This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld help


   Date:  9 Feb 00 09:11:45 MST
   From: Thomas F.simma jr. <tsimma@usa.net>

   I am trying to load a module (e.g. main.o) into it's own memory section.

   The problem is that when I link with the below command file I receive this
   error:

   multiply definition of 'main'

   I think main.o is being loaded twice.  Once in the ram section,  and once in
   the cache section.  Any suggestions are appreciated.

   Thank you.

   MEMORY
   {
     ram : o = 0x00401000, l = 128k
     cache : o = 0xfffff800, l = 4k
   }
   SECTIONS
   {
     .vect 0x00401000:  { *(.vect); }
     .text :
     {
       *(.text)
       *(.strings)
	_etext = . ; 
     }  > ram
     .maintext :
     {
       main.o(.text)
     } > cache

Since *(.text) appears first in the linker script, I would expect the
linker to put all .text sections there.  Try putting the .maintext
output section before the .text output section.

You can check where sections are loaded by looking at the linker map
file.  Use the -Map linker option.

Ian

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]