[llvm-commits] [PATCH] fix debug_ranges for ELF targets

Devang Patel dpatel at apple.com
Thu Sep 2 09:45:13 PDT 2010


On Sep 1, 2010, at 10:05 PM, Krister Wombell wrote:

> As requested: new patch that uses an MAI query to implement either the previous behaviour on Darwin or the new expression structure for ELF.

Looks good. I applied the patch r112830. 

> 
> Krister
> 
> On Thu, Aug 26, 2010 at 1:26 PM, Krister Wombell <kuwerty at gmail.com> wrote:
> Some (all binutils?) based ELF assemblers treat expressions like:
> 
>  (.Ldebug_ranges + 48) - .Ldebug_ranges
> 
> 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.
> 
> 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.
> 
> Ran make in tests directory, no unexpected failures.
> 
> 
> <debug_ranges.patch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100902/503896d8/attachment.html>


More information about the llvm-commits mailing list