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

Krister Wombell kuwerty at gmail.com
Wed Sep 1 22:05:49 PDT 2010


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

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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100902/d8f6d77f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug_ranges.patch
Type: text/x-patch
Size: 5174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100902/d8f6d77f/attachment.bin>


More information about the llvm-commits mailing list