<div dir="ltr"><div>Thanks for the insight. This makes sense in terms of the ELF layout and section information. I see GCC correctly include .text.* sections into .text which is what brought up the question. <br><br>What is interesting is I am seeing strange things happen to the memory allocated/mapped after the _etext symbol that can potentially lead to a vulnerability caused by double mapping physical pages. Some memory after the _etext is mapped RX (e.g., non-writable). However, I am later seeing writes occurring to physical pages of the RX memory. <br><br></div>Anyway, I&#39;m going to open a bug for LLVM to correctly handle the weak symbols.<br><br>Thanks,<br><br>Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 18, 2014 at 9:37 PM, PaX Team <span dir="ltr">&lt;<a href="mailto:pageexec@freemail.hu" target="_blank">pageexec@freemail.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 18 Nov 2014 at 23:23, Renato Golin wrote:<br>
<br>
&gt; The _etext and _edata symbols seem to be implemented in many variants<br>
&gt; of Unix, though I&#39;m not sure that&#39;s in the ELF standard. It may just<br>
&gt; be that Clang never had to deal with that before because it&#39;s only now<br>
&gt; that we&#39;re compiling the kernel... :)<br>
<br>
</span>_etext/_edata are usually defined by the linker script which in turn<br>
means that they&#39;re associated with whatever section they&#39;re defined<br>
after/in. for linux/x86 they&#39;re in arch/x86/kernel/vmlinux.lds.S and<br>
it seems that that llvm emits the weak symbols into different sections<br>
than gcc (e.g., .text.functionname vs. .text) that the linker script<br>
doesn&#39;t seem to take care of. iirc there used to be a catch-all inclusion<br>
of .text.* sections in .text but that was changed some years ago for<br>
supporting i-forget-what feature...<br>
<br>
_______________________________________________<br>
LLVMLinux mailing list<br>
<a href="mailto:LLVMLinux@lists.linuxfoundation.org">LLVMLinux@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Jason Gionta<br>Cyber Defense Lab<br>North Carolina State University<br><a href="mailto:jjgionta@ncsu.edu">jjgionta@ncsu.edu</a></div>
</div>