<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 4, 2017 at 9:48 AM, Scott Shawcroft via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>




<div><div><div class="gmail-h5"><div>On Wed, May 3, 2017, at 11:51 AM, Rui Ueyama wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div><div><div>On Wed, May 3, 2017 at 3:52 AM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br></div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span>On 2 May 2017 at 23:59, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br> > That's interesting. Usually your code wouldn't be gc'ed because your entire<br> > code is reachable from _start.<br> <br> </span>Baremetal doesn't need a _start.</div>
<div> <span><br> <br> > Does your program depend on the feature that, if no -e option is given, the<br> > linker sets the beginning of the .text section to the entry point address?<br> <br> </span>I believe that would help, yes. But there may be linker scripts that</div>
<div> can change that, so you need to be careful.<br></div>
</blockquote><div><br></div>
<div>If you want to do GC, you still need to teach linkers GC root symbols in some way, no? Otherwise, linkers cannot determine if a section is live or not.<br></div>
</div>
</div>
</div>
</blockquote><div><br></div>
</div></div><div>Yeah totally. I had marked some sections as used previously but haven't had a chance to look further into it. I'll try to take some time this weekend to poke at it further.<br></div>
<div><br></div>
<div>The project I'm working on is here: <a href="https://github.com/tannewt/circuitpython/tree/clang/atmel-samd" target="_blank">https://github.com/tannewt/<wbr>circuitpython/tree/clang/<wbr>atmel-samd</a> in case you can't wait.<br></div></div></blockquote><div><br></div><div><br></div><div>Staring at the makefile, it seems like -flto is used, which might run into the same "GC" related issue I was describing here about linker script KEEP directives not being factored into the internalization logic with LTO: <a href="http://lists.llvm.org/pipermail/llvm-dev/2017-February/110582.html">http://lists.llvm.org/pipermail/llvm-dev/2017-February/110582.html</a></div><div><br></div><div>I don't think we ever got a reproducer for that issue though. If removing -flto fixes the GC issue (or the __attribute__((used)) workaround I describe in the link works), could you add `--reproduce repro.tar` to your LLD invocation and upload repro.tar in a bug report?</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div></div>
<div>Thanks,<br></div>
<div>Scott<br></div>
</div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>