<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 23, 2017 at 2:05 PM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</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"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Tue, Dec 13, 2016 at 9:29 AM, Rafael Avila de Espindola <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"><span>Peter Collingbourne <<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>> writes:<br>
> Should this not work for referring to the image base?<br>
><br>
> ADDR(.interp) - ABSOLUTE(ADDR(.interp))<br>
><br>
> The advantage is that this avoids creating new syntax so is already<br>
> somewhat compatible with existing linkers. The downside is that you need to<br>
> specify a section, but in practice you can usually choose one that is known<br>
> to exist.<br>
><br>
> I don't think we currently create a section relative symbol from that, but<br>
> that's just a bug we can fix.<br>
<br>
</span>Yes, that looks better than having a new magic variable.<br></blockquote><div><br></div></span><div>Today I discovered that both bfd and gold predefine a symbol named __executable_start which resolves to the image base. If we do the same we can simply allow users to use that symbol to refer to the image base (either directly or in a linker script).</div></div></div></div></blockquote><div><br></div><div>My mistake, this is in fact the start of the executable segment, which does not correspond to the image base in non-PIC executables.</div><div><br></div><div></div></div><div class="gmail_extra">Thanks,<br></div><div>-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div></div>