On 04.12.2012 15:03, Gregory Nutt wrote: > Hello, list, > > I have a project where I use SDCC for several architectures (this one: > http://www.nuttx.org). It has been a little while since I have used > SDCC and I a gearing up for a port to the P112 board (z180). But I have > a build problem and I would like to know if anyone in the group has a > suggestion for fixing it. > > The NuttX build needs to know now much memory is used for initialized > and uninitialized data storage. The remainder of the memory is then > available to NuttX for its heap. With GNU ld, I set-up a linker script > to define a symbol that designates the end of RAM address. In the past > with SDCC, I got the size of available SRAM in a three step procedure: > > 1. I built NuttX with an arbitrary heap size, > 2. Then I ran a Bash script on the result to add the up the size of all > of the memory sections that were used (see > http://sourceforge.net/p/nuttx/code/5411/tree/trunk/nuttx/arch/z80/src/mkhpbase.sh), > then > 3. I built again with this knowledge to set the correct heap size. > > But that logic has not been used since the 2.6.0 time-frame so I no > longer trust it. And I am also building natively under Windows so I > cannot use the Bash script and it will not convert easily to a .bat > script. Besides, the entire above procedure for getting the heap size > is an awesome kludge to begin with and there just must be a better way. > > That is why I am appealing to this list... Any better ideas anyone? >
The linker generates symbols for section start, length and maybe end. E.g. for a section named INITIALIZER, we get l__INITIALIZER for the length and s__INITIALIZER for the start. The crt0.s provides an example use of these symbols in asm code. Philipp ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user