<html>
<body>
Hi Jeff,<br><br>
I've been doing a little more investigation and there is some strange
behaviour with the linker.<br><br>
I have a small test program for a mega2561, with the following lines of
code:<br><br>
<font face="Courier New, Courier" color="#0000FF"><b>long</b>
MoreWasteSpace[200];<br><br>
<b>const</b> <b>unsigned</b> <b>char</b> *Months[12] =<br>
{<br>
<i>"Jan"</i>,<br>
<i>"Feb"</i>,<br>
<i>"Mar"</i>,<br>
<i>"Apr"</i>,<br>
<i>"May"</i>,<br>
<i>"Jun"</i>,<br>
<i>"Jul"</i>,<br>
<i>"Aug"</i>,<br>
<i>"Sep"</i>,<br>
<i>"Oct"</i>,<br>
<i>"Nov"</i>,<br>
<i>"Dec"<br>
</i>} ; <br><br>
<b>int</b> WasteSpace[100];<br>
<b>char</b> Date[20];<br><br>
#pragma data:mydata<br>
<b>unsigned</b> <b>char</b> BootFlags;<br>
<b>unsigned</b> <b>char</b> BootBuffer[24];<br>
#pragma data:data<br><br>
<br>
</font>I have added the following linker directive:<br><br>
<font face="Courier New, Courier" color="#0000FF">-bmydata:0x0300.0x031f
-bdata:0x200.0x21f:0x0400.0x21ff<br><br>
<br>
</font>This is an excerpt from the map file which shows the utilisation
of RAM.<br><br>
<font face="Courier New, Courier" color="#0000FF">
Area
Addr Size Decimal Bytes (Attributes)<br>
-------------------------------- ----
---- ------- ----- ------------<br>
data 0200 0018 = 24.
bytes (rel,con,ram)<br><br>
Addr Global Symbol<br>
-----
--------------------------------<br>
0200 _Months<br>
0200 __data_start<br>
0218 __data_end<br><br>
Area
Addr Size Decimal Bytes (Attributes)<br>
-------------------------------- ----
---- ------- ----- ------------<br>
bss 0218 0417 = 1047. bytes
(rel,con,ram)<br><br>
Addr Global Symbol<br>
-----
--------------------------------<br>
0218 __bss_start<br>
0400 _Date<br>
0414 _WasteSpace<br>
04DC _MoreWasteSpace<br>
0815 __bss_end<br><br>
Area
Start End Decimal Bytes (Attributes)<br>
-------------------------------- ----
---- ------- ----- ------------<br>
vector 0000 0004 =
4. bytes (abs,ovr,rom)<br><br>
Area
Addr Size Decimal Bytes (Attributes)<br>
-------------------------------- ----
---- ------- ----- ------------<br>
mydata 0300 0019 = 25.
bytes (rel,con,ram)<br><br>
Addr Global Symbol<br>
-----
--------------------------------<br>
0300 _BootFlags<br>
0301 _BootBuffer<br>
0319 __mydata_end<br><br>
<br>
</font>I would have expected the linker to use as much of the space below
0x0300 as possible before utilising the space above 0x0400. However it
only appears to put the array of constant string pointers in there and
then immediately jump to 0x400 to continue. I'm afraid the linker does
not appear to be quite as efficient as it could be at utilising split
areas of RAM.<br><br>
All the best for now,<br>
John<br><br>
<br>
At 22:40 29/06/2007, you wrote:<br>
<blockquote type=cite class=cite cite="">Content-class:
urn:content-classes:message<br>
Content-Type: multipart/alternative;<br>
<x-tab> </x-tab>
boundary="----_=_NextPart_001_01C7BA96.1C96999D"<br><br>
<font size=2 color="#000080">John,<br>
<br>
Thanks again, this list is a real knowledge base and blessing.<br>
<br>
Thanks<br>
Jeff<br>
<br>
</font><font face="Times New Roman, Times" color="#000080"><b>Jeff
Milender<br>
Sr. Electronic Design Engineer<br>
</b>Cargo Systems<br>
Goodrich Interiors<br>
2604 Highway 20 North<br>
Jamestown, ND 58401<br>
Tel: 701-253-7569<br>
<a href="mailto:jeff.milender@goodrich.com">jeff.milender@goodrich.com</a>
<br>
</font><font face="Times New Roman, Times" size=2 color="#000080">
<a href="http://www.goodrich.com/" eudora="autourl">www.goodrich.com</a>
</font></blockquote></body>
</html>