[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Variable __data_end variable not passed through to linker

From: Matt.VanDeWerken
Subject: [avr-gcc-list] Variable __data_end variable not passed through to linker for use in __heap_start?
Date: Mon, 10 Apr 2006 13:41:20 +1000

Hi all:

I am running winavr 2006*, on an atmega128 with 32k of XRAM mapped to
0x8000->0xFFFF. I would like the .bss memory section to be allocated by
the linker in the internal RAM, while I'd like the .data section and the
__malloc_heap_start to both be in XRAM. .bss being in IRAM is not really
negotiable, and I'd much prefer .data to live in XRAM, due to the larger
size of that section.

Unfortunately, the makefile I'm using doesn't seem to want to allocate
the __malloc_heap_start variable to the __data_end.

I've tried adding the following options, with no success:

    LDFLAGS += -Wl,--section-start,.bss=0x800100 \
              -Wl,--section-start,.data=0x808000) \
              -Wl,--defsym,__heap_start=__data_end \
              -Wl,--defsym,__heap_end=0x80FFFF \

The problem I have is that any memory I allocate with malloc ends up in
the internal RAM, straight after .bss.

However, if I hard-code the __heap_start variable (to, say, 0x809000), I
have no problems - the malloc'ed memory is allocated in XRAM. This is a
less than ideal situation, obviously, however I don't seem to be able to
pass through the __data_end variable into the __heap_start (and onwards
to __malloc_heap_start).

Anyone run into this before, and/or any suggestions??

Matthew van de Werken - Electronics Engineer
CSIRO E&M - Rock Mass Characterisation - 1 Technology Court - Pullenvale
- 4069
p: (07) 3327 4142 * f: (07) 3327 4455 * e: address@hidden
"We do not inherit the earth from our ancestors, we borrow it from our
-- Native American Proverb

reply via email to

[Prev in Thread] Current Thread [Next in Thread]