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

Krister Wombell kuwerty at gmail.com
Wed Aug 25 22:26:05 PDT 2010


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


More information about the llvm-commits mailing list