[PATCH] D40950: [ELF] - Fail when multiple .debug_* sections are used in a single object.

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 09:13:47 PST 2017


On 11 December 2017 at 15:14, James Henderson via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Hi,
>
> My colleagues and I have actually been doing quite a bit of investigation in
> the past couple of weeks into what to do about debug data that refers to
> sections that are discarded due to --gc-sections etc. Currently, LLD treats
> the references as address zero, but at least on our platform, address zero
> is a valid address, so we were looking at alternatives.

Just in case this is of any use for the problem of discarded debug sections.

Embedded systems also frequently have valid addresses at 0 so our
embedded toolchain encountered this problem from time to time. The
linker had a custom garbage collection algorithm that cleaned up most
of the debug sections associated with garbage collected sections. It
wasn't always possible to get rid of all of them as the compiler could
sometimes output a single .debug_info section that described more than
one .text section. Our solution for the remaining references was to
set the DW_AT_low_pc and DW_AT_high_pc to the same value (usually 0).
As this gave a zero size range of addresses the debugger could
recognise and ignore it.

Peter


More information about the llvm-commits mailing list