<div dir="ltr">Appreciate the response - explanation makes sense. It might be desirable to have something like '-fno-exceptions -fno-unwind-tables' really kill that section but I won't push that argument.  <div><br></div><div>As to the lld issue, I was seeing a crash in 6.0.1.  This was specifically just using: "/DISCARD/ : { *(.ARM.exidx*) }".  I tried this morning with 7.0.0 and it did not reproduce, so call it fixed?  If you want me to post a reproducible case for 6.0.1, I can.</div><div><br></div><div>Thanks again,</div><div>RRM</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 1, 2019 at 5:13 AM Peter Smith <<a href="mailto:peter.smith@linaro.org">peter.smith@linaro.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Rob,<br>
<br>
I'm not aware of any way to suppress the generation of the .ARM.exidx<br>
section with clang. There is some rationale behind this decision as<br>
having a 'cantunwind' makes it possible to mix such code with code<br>
that uses exceptions and still allow exceptions to propagate through<br>
the subset of the program that has been compiled with exceptions. A<br>
linker should be able to compress all the sections down to a single<br>
entry perhaps with a terminating sentinel so it shouldn't be larger<br>
than 16 bytes. I appreciate that in an embedded system every last byte<br>
counts though.<br>
<br>
In LLD we do support discarding the .ARM.exidx, LLD has a --reproduce<br>
option that you could use to file a PR, I'd be happy to take a look at<br>
it. I'd expect /DISCARD/ : { *(.ARM.exidx) *(.ARM.exidx*)<br>
*(.gnu.linkonce.armexidx.*) } to work. LLD hasn't had a lot of<br>
exposure in embedded systems yet, if you do encounter problems please<br>
do raise PRs as we often need real use cases to help guide the<br>
implementation.<br>
<br>
Peter<br>
<br>
On Fri, 1 Mar 2019 at 07:39, Rob via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Is it possible to force llvm/clang to not create a .ARM.exidx section for a bare-metal application that does not use exceptions?  I've tried -fno-exceptions -fno-unwind-tables, but it still generates the section with all functions marked as 'cantunwind'.  As a temporary punt I tried linking (using lld) with /DISCARD/ on the section, but that seemed to crash lld, which is another problem for another day.  Any suggestions?<br>
><br>
> RRM<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>