lnkscript .ctors/.dtors; Must be in RAM or can be in ROM?

Jeff Frohwein jeff@devrs.com
Mon Jul 30 16:22:00 GMT 2001

 A friend of mine has a link script which includes the following sections
for embedded c++ support. I have spent the last 8 hours searching these
archives & doing web searches to figure out if it is reasonable to put
these sections in ROM.

 I have found several posts that mention they should be in RAM. However,
they did not state their reasoning for this.

 My friend suggests that he has had no problems with his code by putting
then in ROM.

 Can anyone guide me towards a definitive answer or direct me to where I
can locate such?


.ctors   :
    KEEP (*crtbegin.o(.ctors))
    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
    . = ALIGN(4);
  } >ROM =0

  .dtors   :
    KEEP (*crtbegin.o(.dtors))

    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
    . = ALIGN(4);
  } >ROM =0

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

More information about the crossgcc mailing list