<div dir="ltr"><span style="font-size:12.8px">> DefinedSynthetic is being used to define linker-synthesized symbols that are relative to output sections. _end or _edata are a few examples.</span><br><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Given that SyntheticSection are InputSections, wouldn't it make sense to make DefinedSynthetic to be defined relative to input sections to be consistent?</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 22, 2017 at 6:20 PM, Rui Ueyama 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"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Feb 22, 2017 at 9:43 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">I am looking at <a href="https://bugs.llvm.org/show_bug.cgi?id=32031" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug<wbr>.cgi?id=32031</a> and there<br>
are a couple of ways to interpret it.<br>
<br>
One way is that we are just computing symbol values too early. When we<br>
do it some output sections still don't have their address set and some<br>
input sections still don't know what output section they will be in.<br>
<br>
The other way to look at it is just that our representation of symbol<br>
values in the linker script is wrong. I started experimenting with using<br>
a ExprValue struct that is similar in idea to a MCValue. It is what Expr<br>
returns and it contains a PointerUnion of an input or output section and<br>
the offset. This allows us to avoid having to check the OutSec field<br>
before it is set and solves the problem.<br>
<br>
But that got me thinking, can we remove DefinedSynthetic completely?<br>
With the addition of a few dummy input sections and potentially a couple<br>
more conversions to SyntheticSection I think we can.<br></blockquote><div><br></div></span><div>Regular Defined symbols are defined relative to input sections because they are both read from input files. Regular symbols get their addresses when the associated input sections get addresses.</div><div><br></div><div>DefinedSynthetic is being used to define linker-synthesized symbols that are relative to output sections. _end or _edata are a few examples.</div><div><br></div><div>So, if you remove DefinedSynthetic, how do you represent _end, for example?</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can anyone think of a reason why this would not work?<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></span></div><br></div></div>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>