URL:
<http://savannah.nongnu.org/bugs/?19445>
Summary: _malloc_heap_end does not follow _heap_end on m2561
Project: AVR C Runtime Library
Submitted by: None
Submitted on: Thursday 03/29/2007 at 18:02 UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unknown
Status: None
Privacy: Public
Percent Complete: 0%
Assigned to: None
Originator Email: [EMAIL PROTECTED]
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
In a makefile I have (as per the avr libc docs):
override LDFLAGS =
-Wl,--section-start,.data=0x802100,--defsym=__heap_end=0x80A0ff,-Map=$(PRG).map,--cref
-lm -u vfprintf -u vfscanf -lprintf_flt -lscanf_flt -lm -lc
On an mega2561 w/ 8k internal, and 32k external. Been chasing apparent
memory corruption for a couple weeks.
Ran avr-nm -n today, to find:
...
00803c0c D CommandSystemParamsSize
00803c0e D __thenan_sf
00803c16 D __malloc_margin
00803c18 D __malloc_heap_start
00803c1a D __malloc_heap_end
00803c1c b ResetSrc
00803c1c B __bss_start
00803c1c D __data_end
00803c1c D _edata
00803c1d b Disp3Ct
00803c1f b LimitStateArray
...
00805ddc B _FF_ScanAddr
00805de0 B __iob
00805de6 B __brkval
00805de8 B __flp
00805dea B __bss_end
00805dea A __heap_start
00805dea A _end
0080a0ff A __heap_end
00810000 A __eeprom_end
I'm looking at the avrlibc docs right now, and they seem to indicate that my
makefile should be instructing both heap_end and malloc_heap_end to be at
0x80A0FF.
Then last night I added:
override LDFLAGS =
-Wl,--section-start,.data=0x802100,--defsym=__heap_end=0x80A0ff,,--defsym=__malloc_heap_end=0x80A0ff,--defsym=__malloc_heap_start
=0x8080ff,-Map=$(PRG).map,--cref -lm -u vfprintf -u vfscanf -lprintf_flt
-lscanf_flt -lm -lc
And the memory corruption appears to have gone away.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?19445>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev