As requested: new patch that uses an MAI query to implement either the previous behaviour on Darwin or the new expression structure for ELF.<br><br>Krister<br><br><div class="gmail_quote">On Thu, Aug 26, 2010 at 1:26 PM, Krister Wombell <span dir="ltr"><<a href="mailto:kuwerty@gmail.com">kuwerty@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Some (all binutils?) based ELF assemblers treat expressions like:<br><br> (.Ldebug_ranges + 48) - .Ldebug_ranges<br>
<br>as a constant and won't emit a relocation. When the debug_ranges sections are finally linked then DIE's that have a reference to an offset in the debug_ranges section won't be correct (they'll all point to the first compilation unit encountered by the linker). gdb doesn't like this.<br>



<br>This form of expression is emitted by AsmPrinter::EmitLabelOffsetDifference. It'd be difficult to encode this form of expression in ELF and because the only caller of this function actually called it with the same symbol for the Lo and Hi args it can be represented as 'label + offset' instead.   Replaced the entire function with something called EmitLabelPlusOffset.<br>



<br>Ran make in tests directory, no unexpected failures.<br><br>
</blockquote></div><br>