rtems-libbsd: Thoughts on Refactoring linkcmds.base

Kevin Polulak kpolulak at gmail.com
Wed Jul 25 07:22:09 UTC 2012


On Mon, Jul 23, 2012 at 3:08 AM, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> A short term solution is to just create the linkcmds.rwrtems and
> linkcmds.rortems and use them in selected BSPs.
>

I'm confused. What are these files for? What's rwrtems and rortems?

On Mon, Jul 23, 2012 at 9:14 AM, Joel Sherrill <joel.sherrill at oarcorp.com>wrote:

> + 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.
>

I wasn't aware that the prepending of underscores was
architecture-dependent. I thought that was just a GNU ld thing and that it *
always* prepended one?

Having two versions of linkcmds.xxx would be the most clean. That way the
symbol tables aren't being polluted with useless symbols. However, if just
defining both symbol and _symbol in a single file is what's been used in
the past, then that's probably the way to go. For me, consistency always
trumps all.

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

I'm not sure why this would be an issue. Are you referring to the
_endtextand friends symbols? If so, can't they just be moved? I don't
see the
problem with .rodata, or .ctors since I never had to touch them but for
.text I just moved it to where it belonged: at the end of .text.

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

Again, not sure what you mean. Do you mean something like what shared SPARC
does with .robsdsets where it gets placed into ram? If so, that's kinda
what I wrote.

-- 
- Kevin Polulak (soh_cah_toa)
- http://cybercrud.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20120725/312e034f/attachment-0001.html>


More information about the devel mailing list