<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jun 28, 2016 at 3:52 AM Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dean Michael Berris via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> writes:<br>
> Just to close this out, I've updated <a href="http://reviews.llvm.org/D19904" rel="noreferrer" target="_blank">http://reviews.llvm.org/D19904</a> to use<br>
> named ELF groups per-function, and have the runtime library use<br>
> __start_xray_instr_map and __stop_xray_instr_map as weak symbols from the<br>
> C++ side.<br>
<br>
In case you're not aware, the __start_/__stop_ trick isn't portable.<br>
You may want to look at compiler-rt/lib/profile/InstrProfilingPlatform*.c.<br>
There, we do the __start_ trick for linux and freebsd, a similar trick<br>
for darwin, and fall back to a static registration scheme elsewhere.<br>
<br></blockquote><div><br></div><div>Thanks Justin -- I assumed it couldn't be portable. :)</div><div><br></div><div>I fully expect to play many different tricks on many different platforms too to make this work.</div><div><br></div><div>Cheers</div></div></div>