<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19258">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">Hi Kevin,</font></div>
<div dir="ltr"><font size="2" face="Tahoma"></font> </div>
<div dir="ltr"><font size="2" face="Tahoma">This morning I talked with Joel breifly about this.  We feel it would be best to loop through all of the</font></div>
<div dir="ltr"><font size="2" face="Tahoma">bsps first.  You may not see some of the differences until you have done this.   Let me know when
</font></div>
<div dir="ltr"><font size="2" face="Tahoma">you have patches ready and I'll get them into the rtems head for
</font><font size="2" face="Tahoma">you.</font></div>
<div dir="ltr"><font size="2" face="Tahoma"></font> </div>
<div>
<div><font size="2" face="Tahoma">Jennifer Averett</font></div>
<div><font size="2" face="tahoma">On-Line Applications Research</font></div>
<div><font size="2" face="Tahoma"></font> </div>
<div><font size="2" face="Tahoma"></font> </div>
</div>
<div style="DIRECTION: ltr" id="divRpF355961">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b> rtems-devel-bounces@rtems.org [rtems-devel-bounces@rtems.org] On Behalf Of Kevin Polulak [kpolulak@gmail.com]<br>
<b>Sent:</b> Monday, July 23, 2012 1:24 AM<br>
<b>To:</b> RTEMS Developer Mailing List<br>
<b>Subject:</b> rtems-libbsd: Thoughts on Refactoring linkcmds.base<br>
</font><br>
</div>
<div></div>
<div>Since I've been moving into the MIPS BSP's, there have been a few linkage issues. They've all been related to some missing
<span style="FONT-FAMILY: courier new,monospace">sysinit</span> symbols and the solution has been very similar: add a new
<span style="FONT-FAMILY: courier new,monospace">.robsdsets</span> output section with the same symbol declarations and includes the same input sections. The only difference between BSP's is what memory region
<span style="FONT-FAMILY: courier new,monospace">.robsdsets</span> gets stored in.<br>
<br>
Adding a common <span style="FONT-FAMILY: courier new,monospace">linkcmds.base</span> that other
<span style="FONT-FAMILY: courier new,monospace">linkcmds</span> could include is one of my GSoC tasks, so here's what I think it should look like:<br clear="all">
<br>
<span style="FONT-FAMILY: courier new,monospace">    /* for pre rtems-libbsd FreeBSD code */</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    __start_set_sysctl_set = .;</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    *(set_sysctl_*);</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    __stop_set_sysctl_set = .;</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    *(set_domain_*);</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    *(set_pseudo_*);</span><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    /* for rtems-libbsd FreeBSD code */</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    _bsd__start_set_modmetadata_set = .;</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    *(_bsd_set_modmetadata_set);</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    _bsd__stop_set_modmetadata_set = .;</span><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    _bsd__start_set_sysctl_set = .;</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    *(_bsd_set_sysctl_set);</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    _bsd__stop_set_sysctl_set = .;</span><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    _bsd__start_set_sysinit_set = .;</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    *(_bsd_set_sysinit_*);</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    _bsd__stop_set_sysinit_set = .;</span><br>
<br>
Then each BSP could define <span style="FONT-FAMILY: courier new,monospace">.robsdsets</span> as:<br>
<br>
<span style="FONT-FAMILY: courier new,monospace">    .robsdsets : {</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">        INCLUDE(linkcmds.base);</span><br style="FONT-FAMILY: courier new,monospace">
<span style="FONT-FAMILY: courier new,monospace">    } > region</span><br>
<br>
This would guarantee that <span style="FONT-FAMILY: courier new,monospace">.robsdsets</span> has the minimum required input sections and symbols while still allowing each BSP to add anything before or after the textual substitution and to place it in whatever
 memory region is necessary for that board (whether that may be a region defined with
<span style="FONT-FAMILY: courier new,monospace">MEMORY</span> or a hard-coded address.)<br>
<br>
Also, at what point should I begin doing this? I could make <span style="FONT-FAMILY: courier new,monospace">
linkcmds.base</span> right now and then modify each broken BSP to use it or I could fix each BSP individually, duplicating what will soon become the contents of
<span style="FONT-FAMILY: courier new,monospace">linkcmds.base</span> and then - only after verifying that that was indeed the solution - remove that duplication and replace it with the
<span style="FONT-FAMILY: courier new,monospace">INCLUDE()</span> directive.<br>
<br>
Thoughts?<br>
<br>
-- <br>
- Kevin Polulak (soh_cah_toa)<br>
- <a href="http://cybercrud.net" target="_blank">http://cybercrud.net</a><br>
<br>
</div>
</body>
</html>