<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 13, 2016 05:42, "Rafael Avila de Espindola" <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">> Hi Rafael,<br>
><br>
> I found some discussion on the binutils bug tracker and mailing list<br>
> <a href="https://sourceware.org/bugzilla/show_bug.cgi?id=14052" rel="noreferrer" target="_blank">https://sourceware.org/<wbr>bugzilla/show_bug.cgi?id=14052</a><br>
> <a href="https://sourceware.org/ml/binutils/2012-05/msg00023.html" rel="noreferrer" target="_blank">https://sourceware.org/ml/<wbr>binutils/2012-05/msg00023.html</a><br>
><br>
> It looks like the conclusion to be drawn is that BFD's behaviour is wrong.<br>
<br>
</div>Thank you so much. We should deferentially not copy the bug then.<br>
<br>
If we want a way to refer to the image base from linker script I propose<br>
a new magic variable: IMAGE_BASE.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Should this not work for referring to the image base?</div><div dir="auto"><br></div><div dir="auto">ADDR(.interp) - ABSOLUTE(ADDR(.interp))</div><div dir="auto"><br></div><div dir="auto">The advantage is that this avoids creating new syntax so is already somewhat compatible with existing linkers. The downside is that you need to specify a section, but in practice you can usually choose one that is known to exist.</div><div dir="auto"><br></div><div dir="auto">I don't think we currently create a section relative symbol from that, but that's just a bug we can fix.</div><div dir="auto"><br></div><div dir="auto">Peter</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div></div>