<div dir="ltr">I took a quick look at BFD linker's source code and I think that is right. The GNU linker doesn't say anything about text relocations unless "-z text" or "-warn-shared-textrel" is given.<div><br></div><div>So, It think what we should do is this:</div><div><br></div><div> - Add "-z textrel" and treat text relocations as an error only when that option is given, and</div><div> - emit DT_TEXTREL if an output has text relocations.</div><div><br></div><div>We don't need to add -warn-shared-textrel at the moment. (We may want it later, but you want to focus on one thing at a time.)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 22, 2017 at 1:38 PM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</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" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif"><div><div class="h5">
<p><span style="font-size:12pt">>> </span><span style="font-size:12pt;color:rgb(33,33,33)">So I think the answer is that the GNU linker doesn't warn on text relocations at all.</span><br>
</p>
</div></div><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<div><div><div class="h5">
<p><span style="font-size:12pt;color:rgb(33,33,33)">> </span></p>
<p><span style="font-size:12pt;color:rgb(33,33,33)">>Yes, until I add -z text, which I belive exist exactly for that.</span></p>
<p><span style="font-size:12pt;color:rgb(33,33,33)">> </span></p>
<div>>ld.bfd test.o -shared -o out -z text</div>
<div>>ld.bfd: test.o: warning: relocation against `_start' in readonly section `.text'</div>
<div>>ld.bfd: read-only segment has dynamic relocations.</div>
<div>> </div>
<p><span style="font-size:12pt;color:rgb(33,33,33)">>George.</span></p>
<p><span style="font-size:12pt;color:rgb(33,33,33)"><br>
</span></p>
</div></div><p><span style="font-size:12pt;color:rgb(33,33,33)">In addition they have <span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;background-color:rgb(255,255,255)">--warn-shared-<wbr>textrel for emiting warnings</span>:</span></p>
<p><span style="font-size:12pt;color:rgb(33,33,33)"><br>
</span></p>
<div>ld.bfd test.o -shared -o out --warn-shared-textrel</div><span class="">
<div>ld.bfd: test.o: warning: relocation against `_start' in readonly section `.text'</div>
</span><div>ld.bfd: warning: creating a DT_TEXTREL in a shared object.</div><span class="HOEnZb"><font color="#888888">
<div><br>
George.<br>
</div>
</font></span></div>
</div>
</div>

</blockquote></div><br></div>