[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] [bug #35587] Uninitialized pointer (David Brown)
From: |
Eliot Blennerhassett |
Subject: |
Re: [lwip-devel] [bug #35587] Uninitialized pointer (David Brown) |
Date: |
Fri, 24 Feb 2012 12:18:40 +1300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16 |
> Note that despite this being part of the C standards, there are a few
> compiler toolchains that stubbornly refuse to implement it. TI's Code
> Composer is one of these - it does not zero the statically allocated
> uninitialised data at startup (unless you add your own code to do so).
> It even has a comment in the manual, telling you that this behaviour is
> non-standard!
Yes, this is a PITA!
We have ported lwip to TI tools and DSP/BIOSv5
(NO_SYS=0, not currently using TCP.
Used in these
http://www.audioscience.com/internet/products/cobranet/cobranet_if.htm )
Our solution is to get the linker to zero .bss and .far
SECTIONS {
.bss {} > IRAM, fill = 0
.far {} > SDRAM, fill = 0
.far_notzeroed {} > SDRAM
...
}
We also patch lwip to place heap and mem pool in separate uninitialised
section, to limit the generated static image size:
+#pragma DATA_SECTION(memp_memory,".far_notzeroed");
static u8_t memp_memory[MEM_ALIGNMENT - 1
+#pragma DATA_SECTION(ram_heap,".far_notzeroed");
u8_t ram_heap[MEM_SIZE_ALIGNED + (2*SIZEOF_STRUCT_MEM) + MEM_ALIGNMENT];
BTW We are happy to share the DSP/BIOS port if there is any interest.
regards
Eliot Blennerhassett
AudioScience Inc.
- Re: [lwip-devel] [bug #35587] Uninitialized pointer (David Brown),
Eliot Blennerhassett <=