rtems-libbsd: Thoughts on Refactoring linkcmds.base

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jul 25 08:04:50 UTC 2012

On 07/25/2012 09:22 AM, Kevin Polulak wrote:
> On Mon, Jul 23, 2012 at 3:08 AM, Sebastian Huber
> <sebastian.huber at embedded-brains.de
> <mailto: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?

These files should be used to define all input sections which are RTEMS 
specific.  One should contain all read-write sections.  One should contain all 
read-only sections.

> On Mon, Jul 23, 2012 at 9:14 AM, Joel Sherrill <joel.sherrill at oarcorp.com
> <mailto: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.

I don't think we need two linkcmds.xxx.  The underscore issue should be sorted 
out in the header files.

>     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 _endtext and
> 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.

I don't see an issue with these symbols too.

Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the devel mailing list