rtems-libbsd: Thoughts on Refactoring linkcmds.base

Joel Sherrill joel.sherrill at OARcorp.com
Mon Jul 23 13:14:32 UTC 2012


On 07/23/2012 02:08 AM, Sebastian Huber wrote:
> Hi,
>
> I think in the long run the best solution would be to convert all BSPs to use
> some sort of linkcmds.base (like it is done e.g. on ARM).  This is a very time
> consuming task.  This linkcmds.base should include a linkcmds.rwrtems and
> linkcmds.rortems which contains all global RTEMS specific sections.
>
> A short term solution is to just create the linkcmds.rwrtems and
> linkcmds.rortems and use them in selected BSPs.
>
FYI I have added these sections to a BSP in each of a few
architectures for testing purpose. This highlights that there
are subtle differences.

+ Some architectures get an underscore prepended. So
     symbols in the linkcmds get one more _ in front than
     you see in C.
+ The case of the sparc where there was an end text
     type symbol which really marked the end of where
     constant stuff like .text, rodata, .ctors tables, etc. was.
+ Where are the BSD sections located (e.g. >ram)

I think the first can be dealt with by either having two
versions of the linkcmds.xxx or having both styles of
symbols. We have had both in the past especially for
BSPs which transitioned from a.out to coff to elf.

The second is a bit harder for me to see a general solution.

For the last, follow what Sebastian has done in other linkcmds.base
where the BSP defines a symbol used there.

Also won't the linkcmds.xxx have to be added to the Makefile.am?

I say go for it. It just may be more than deleting old FreeBSD
sections and inserting an include line in some BSPs. :)

-- 
Joel Sherrill, Ph.D.             Director of Research&   Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985





More information about the devel mailing list