<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 1, 2017 at 1:04 AM, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 30/11/17 19:11, Joel Sherrill wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
I have been experimenting with the LEON3 bsp_specs and linker script. I have reduced it to this:<br>
<br>
==============================<wbr>==<br>
%rename endfile old_endfile<br>
%rename startfile old_startfile<br>
<br>
*startfile:<br>
%{!qrtems: %(old_startfile)} \<br>
%{!nostdlib: %{qrtems: crti.o%s crtbegin.o%s}}<br>
<br>
*endfile:<br>
%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}<br>
==============================<wbr>==<br>
<br>
I can't figure out how to deal with the need for crt[in[ and crtbegin/end<br>
without modifying gcc. I was hoping to address them in the linkcmds.<br>
<br>
Any ideas?<br>
</blockquote>
<br></span>
If we look at the current linker invocation (collect2) with and without -specs bsp_specs on erc32 for ticker we get:<br>
<br>
sparc-rtems5-gcc -B../../../../../erc32/lib/ -specs bsp_specs -qrtems -o ticker.exe init.o tasks.o -wrapper echo<br>
/opt/rtems/5/lib/gcc/sparc-rte<wbr>ms5/7.2.1/collect2<br>
-dc<br>
-dp<br>
-N<br>
-o<br>
ticker.exe<br>
../../../../../erc32/lib/start<wbr>.o<br>
/opt/rtems/5/lib64/gcc/sparc-r<wbr>tems5/7.2.1/crti.o<br>
/opt/rtems/5/lib64/gcc/sparc-r<wbr>tems5/7.2.1/crtbegin.o<br>
-L../../../../../erc32/lib -L/opt/rtems/5/lib64/gcc/sparc<wbr>-rtems5/7.2.1<br>
-L/opt/rtems/5/lib64/gcc/sparc<wbr>-rtems5/7.2.1/../../../../<wbr>sparc-rtems5/lib<br>
init.o<br>
tasks.o<br>
-lgcc<br>
--start-group<br>
-lrtemsbsp<br>
-lrtemscpu<br>
-latomic<br>
-lc<br>
-lgcc<br>
--end-group<br>
-T<br>
../../../../../erc32/lib/linkc<wbr>mds<br>
-lgcc<br>
/opt/rtems/5/lib64/gcc/sparc-r<wbr>tems5/7.2.1/crtend.o<br>
/opt/rtems/5/lib64/gcc/sparc-r<wbr>tems5/7.2.1/crtn.o<br>
<br>
sparc-rtems5-gcc -B../../../../../erc32/lib/ -qrtems -o ticker.exe init.o tasks.o -wrapper echo<br>
/opt/rtems/5/lib/gcc/sparc-rte<wbr>ms5/7.2.1/collect2<br>
-o<br>
ticker.exe<br>
/opt/rtems/5/lib64/gcc/sparc-r<wbr>tems5/7.2.1/../../../../sparc-<wbr>rtems5/lib/crt0.o<br>
-L../../../../../erc32/lib<br>
-L/opt/rtems/5/lib64/gcc/sparc<wbr>-rtems5/7.2.1<br>
-L/opt/rtems/5/lib64/gcc/sparc<wbr>-rtems5/7.2.1/../../../../<wbr>sparc-rtems5/lib<br>
init.o<br>
tasks.o<br>
-lgcc<br>
--start-group<br>
-lrtemsbsp<br>
-lrtemscpu<br>
-latomic<br>
-lc<br>
-lgcc<br>
--end-group<br>
-T<br>
../../../../../erc32/lib/linkc<wbr>mds<br>
-lgcc<br>
<br>
Maybe we can use<br>
<br>
/DISCARD/ : { crt0.o(*) }<br>
<br>
to get rid of the "/opt/rtems/5/lib64/gcc/sparc-<wbr>rtems5/7.2.1/../../../../sparc<wbr>-rtems5/lib/crt0.o" in the linker command file.</blockquote><div><br></div><div>I will play with that some. If that works, that would simplify things. </div><div><br></div><div>The option I was playing with was ensuring that STARTFILE_SPECS and ENDFILE_SPECS </div><div>were defined to know -qrtems in gcc. Unfortunately, I think that may involve touching most,</div><div>if not all, of the gcc/config/*/*rtems.h files.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Sebastian Huber, embe<a href="https://maps.google.com/?q=dded+brains+G&entry=gmail&source=g">dded brains G</a>mbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : <a href="tel:%2B49%2089%20189%2047%2041-16" value="+4989189474116" target="_blank">+49 89 189 47 41-16</a><br>
Fax : <a href="tel:%2B49%2089%20189%2047%2041-09" value="+4989189474109" target="_blank">+49 89 189 47 41-09</a><br>
E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brain<wbr>s.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
</font></span></blockquote></div><br></div></div>