<div dir="ltr">Detecting is as hard (or as easy) as adding the DT_TEXTREL flag. Adding the flag is just one line of code and other code is to detect it after all. That brings us back to the point that whether this approach is satisfactory or not. Particularly, I think you can still create a binary with relocations to read-only sections with this patch if you use a convoluted linker script. I don't think we want to submit a half-baked logic just to detect some situation.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 4:24 PM, Joerg Sonnenberger via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@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"><span class="">On Thu, Mar 03, 2016 at 01:49:27PM -0800, Rui Ueyama wrote:<br>
> But I still want to defer that until someone comes up with a program that<br>
> they want to link with lld and say that they need this. As Davide pointed<br>
> out, I'm also not entirely sure if this is the right approach, and if we do<br>
> not have to discuss design right now, I want to do this later.<br>
<br>
</span>I think we should at least detect it and bail out. I'm not that attached<br>
to text relocations otherwise, but silently creating bad binaries when<br>
we can reasonable easily detect seems bad. Consider the problems with<br>
MIPS EH frame layout, which is normally only visible due to the<br>
resulting text relocation warnings/errors.<br>
<div class="HOEnZb"><div class="h5"><br>
Joerg<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>