<div dir="ltr">It sounds like reasonable to not submit this until a real need comes up. I don't seems that we have an immediate need because the bug to create relocations to RO sections has been fixed.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 12:03 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is this actually needed?<br>
<br>
It was noticed in freebsd because we were incorrectly creating text<br>
relocations. Short of bugs, is it actually common to have relocations<br>
pointing to text these days?<br>
<br>
Cheers,<br>
Rafael<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 3 March 2016 at 13:27, George Rimar <<a href="mailto:grimar@accesssoftek.com">grimar@accesssoftek.com</a>> wrote:<br>
> grimar created this revision.<br>
> grimar added reviewers: ruiu, rafael.<br>
> grimar added subscribers: llvm-commits, grimar.<br>
><br>
> This patch implements DT_TEXTREL/DF_TEXTREL flags. Actually I am not sure in current implementation and would be happy to know the side opinion about it.<br>
> Problem of that feature is that somehow we should know that relocation should cause a modification of read only segment.<br>
><br>
> To do that I am checking that relocation OKind field is DynamicReloc<ELFT>::Off_Sec. Looks it is safe and correct way to use it for that ?<br>
> Also for simplification I am not iterating through sections in LOADs and just checking the read/write flag of output sections when adding relocations during Writer<ELFT>::scanRelocs().<br>
><br>
> DT_TEXTREL description:<br>
> This member's absence signifies that no relocation entry should cause a modification to a non-writable segment, as specified by the segment permissions in the program header table. If this member is present, one or more relocation entries might request modifications to a non-writable segment, and the dynamic linker can prepare accordingly. This entry is at level 2. Its use has been superseded by the DF_TEXTREL flag.<br>
><br>
> <a href="http://reviews.llvm.org/D17857" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17857</a><br>
><br>
> Files:<br>
>   ELF/OutputSections.cpp<br>
>   ELF/OutputSections.h<br>
>   test/ELF/textrel.s<br>
>   test/ELF/tls-opt-iele-i686-nopic.s<br>
><br>
</div></div></blockquote></div><br></div>