rtems-libbsd: Thoughts on Refactoring linkcmds.base
Jennifer Averett
Jennifer.Averett at OARcorp.com
Mon Jul 23 17:49:54 UTC 2012
Hi Kevin,
This morning I talked with Joel breifly about this. We feel it would be best to loop through all of the
bsps first. You may not see some of the differences until you have done this. Let me know when
you have patches ready and I'll get them into the rtems head for you.
Jennifer Averett
On-Line Applications Research
________________________________
From: rtems-devel-bounces at rtems.org [rtems-devel-bounces at rtems.org] On Behalf Of Kevin Polulak [kpolulak at gmail.com]
Sent: Monday, July 23, 2012 1:24 AM
To: RTEMS Developer Mailing List
Subject: rtems-libbsd: Thoughts on Refactoring linkcmds.base
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 sysinit symbols and the solution has been very similar: add a new .robsdsets output section with the same symbol declarations and includes the same input sections. The only difference between BSP's is what memory region .robsdsets gets stored in.
Adding a common linkcmds.base that other linkcmds could include is one of my GSoC tasks, so here's what I think it should look like:
/* for pre rtems-libbsd FreeBSD code */
__start_set_sysctl_set = .;
*(set_sysctl_*);
__stop_set_sysctl_set = .;
*(set_domain_*);
*(set_pseudo_*);
/* for rtems-libbsd FreeBSD code */
_bsd__start_set_modmetadata_set = .;
*(_bsd_set_modmetadata_set);
_bsd__stop_set_modmetadata_set = .;
_bsd__start_set_sysctl_set = .;
*(_bsd_set_sysctl_set);
_bsd__stop_set_sysctl_set = .;
_bsd__start_set_sysinit_set = .;
*(_bsd_set_sysinit_*);
_bsd__stop_set_sysinit_set = .;
Then each BSP could define .robsdsets as:
.robsdsets : {
INCLUDE(linkcmds.base);
} > region
This would guarantee that .robsdsets 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 MEMORY or a hard-coded address.)
Also, at what point should I begin doing this? I could make linkcmds.base 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 linkcmds.base and then - only after verifying that that was indeed the solution - remove that duplication and replace it with the INCLUDE() directive.
Thoughts?
--
- Kevin Polulak (soh_cah_toa)
- http://cybercrud.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20120723/ceac1ccd/attachment-0001.html>
More information about the devel
mailing list