rtems-libbsd: Thoughts on Refactoring linkcmds.base

Kevin Polulak kpolulak at gmail.com
Mon Jul 23 06:24:01 UTC 2012


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.baseright 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/c224eca4/attachment.html>


More information about the devel mailing list