[En-Nut-Discussion] how to get GCC linker to relocate RAM sections?

Henrik Maier hmlists at focus-sw.com
Mon Aug 14 05:26:37 CEST 2006


1) I assume you are not using Nut/OS. If yes, the heap and other memory 
settings are best configured using nutconf rather using the command line.

2) The "-Tdata=" option is broken in some versions of avr-gcc. Refer to 
avr-gcc mailing list.

It was recommended in the avr-gcc mailing list to use 
"-Wl,--section-start=.data=" instead.

This might explain why your relocation attempts did not work.

Henrik
http://www.proconx.com


Nic Cave-Lynch wrote:
> Hi all
> 
> Slightly off-topic (it's not an NutOS problem), but I really hope 
> someone can help before I tear the rest of my hair out....
> 
> I have an AVR application which I want to test on an Ethernut 1.3f board 
> (it'll eventually go on something with an ATMega1280). .bss is about 700 
> bytes, .data about 3.5k, and malloc'd space is about 25k. If I use 
> unmodified WinAVR to link, the .bss and .data end up stomping on the 
> stack, which doesn't work very well...
> 
> The obvious answer is to relocate something to external RAM, and there 
> is the problem. I'd like to just move .bss to external, and have 
> malloc'd RAM after that, leaving .data in internal RAM (faster access 
> for some procesor intensive routines). Problem is, I can't make any sort 
> of relocation work. I've tried many combinations of linker commands and 
> got nowhere. What seemed most like it should work is:
> 
> -Tdata=0x800100,-Tbss=0x801100,--defsym=__heap_end=0x807fff,--defsym=__heap_start=0x802100 
> 
> 
> but it experiments indicate that anything that moves the .bss section 
> breaks malloc.
> 
> Any ideas how to solve this? Should I give up on WinAVR/avr-gcc and try 
> a commercial compiler?
> 
> Thanks for any insights
> 
> Nic C-L
> 
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> 
> 
> 




More information about the En-Nut-Discussion mailing list