Need Help to Further Reduce bsp_specs

Joel Sherrill joel at rtems.org
Fri Dec 1 15:46:03 UTC 2017


On Fri, Dec 1, 2017 at 1:04 AM, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 30/11/17 19:11, Joel Sherrill wrote:
>
>> Hi
>>
>> I have been experimenting with the LEON3 bsp_specs and linker script. I
>> have reduced it to this:
>>
>> ================================
>> %rename endfile old_endfile
>> %rename startfile old_startfile
>>
>> *startfile:
>> %{!qrtems: %(old_startfile)} \
>> %{!nostdlib: %{qrtems: crti.o%s crtbegin.o%s}}
>>
>> *endfile:
>> %{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}
>> ================================
>>
>> I can't figure out how to deal with the need for crt[in[ and crtbegin/end
>> without modifying gcc.  I was hoping to address them in the linkcmds.
>>
>> Any ideas?
>>
>
> If we look at the current linker invocation (collect2) with and without
> -specs bsp_specs on erc32 for ticker we get:
>
> sparc-rtems5-gcc -B../../../../../erc32/lib/ -specs bsp_specs -qrtems -o
> ticker.exe init.o tasks.o -wrapper echo
> /opt/rtems/5/lib/gcc/sparc-rtems5/7.2.1/collect2
> -dc
> -dp
> -N
> -o
> ticker.exe
> ../../../../../erc32/lib/start.o
> /opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1/crti.o
> /opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1/crtbegin.o
> -L../../../../../erc32/lib -L/opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1
> -L/opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1/../../../../sparc-rtems5/lib
> init.o
> tasks.o
> -lgcc
> --start-group
> -lrtemsbsp
> -lrtemscpu
> -latomic
> -lc
> -lgcc
> --end-group
> -T
> ../../../../../erc32/lib/linkcmds
> -lgcc
> /opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1/crtend.o
> /opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1/crtn.o
>
> sparc-rtems5-gcc -B../../../../../erc32/lib/ -qrtems -o ticker.exe init.o
> tasks.o -wrapper echo
> /opt/rtems/5/lib/gcc/sparc-rtems5/7.2.1/collect2
> -o
> ticker.exe
> /opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1/../../../../sparc-
> rtems5/lib/crt0.o
> -L../../../../../erc32/lib
> -L/opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1
> -L/opt/rtems/5/lib64/gcc/sparc-rtems5/7.2.1/../../../../sparc-rtems5/lib
> init.o
> tasks.o
> -lgcc
> --start-group
> -lrtemsbsp
> -lrtemscpu
> -latomic
> -lc
> -lgcc
> --end-group
> -T
> ../../../../../erc32/lib/linkcmds
> -lgcc
>
> Maybe we can use
>
> /DISCARD/ : { crt0.o(*) }
>
> to get rid of the "/opt/rtems/5/lib64/gcc/sparc-
> rtems5/7.2.1/../../../../sparc-rtems5/lib/crt0.o" in the linker command
> file.


I will play with that some. If that works, that would simplify things.

The option I was playing with was ensuring that STARTFILE_SPECS and
ENDFILE_SPECS
were defined to know -qrtems in gcc. Unfortunately, I think that may
involve touching most,
if not all, of the gcc/config/*/*rtems.h files.

>
>
> --
> Sebastian Huber, embedded brains G
> <https://maps.google.com/?q=dded+brains+G&entry=gmail&source=g>mbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> 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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20171201/0dacb0d3/attachment-0002.html>


More information about the devel mailing list