<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 11:57 AM, Tim Shen via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="cremed">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>When -fstack-protector is turned on, linker fails to find the symbol "<span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">__stack_chk_guard" because at least for powerpc64le, glibc doesn't provide this symbol. Instead, they put the stack guard into TCB.</span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">x86 fixed this issue by injecting a special address space (which is later translated to TCB register access) and hard code the offset of stack_guard, but I don't see a easy way to handle address spaces in ppc.</span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);line-height:normal;white-space:pre-wrap">A cleaner solution could be adding an IR intrinsic llvm.get_tcb_address() and hard code the offset of stack_guard member, since they aren't supposed to change.</span></div><div><br></div></div></blockquote><div><br></div><div>Can you try to implement the intrinsic for x86 as a proof of concept?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div>Details are in the bug: <a href="https://llvm.org/bugs/show_bug.cgi?id=26226" target="_blank" class="cremed">https://llvm.org/bugs/show_bug.cgi?id=26226</a><br><div><br></div><div>Any ideas?</div><div><br></div><div>Thanks!</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" class="cremed">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="cremed">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>