For context, see https://bugs.llvm.org/show_bug.cgi?id=39862
The use case is embedded / OS programming where the kernel wants
access to its own debug info via mapped dwarf info. I have a proof of
concept of this working, using this linker script snippet:
.rodata : ALIGN(4K) { *(.rodata) __debug_info_start = .; KEEP(*(.debug_info)) __debug_info_end = .; __debug_abbrev_start = .; KEEP(*(.debug_abbrev)) __debug_abbrev_end = .; __debug_str_start = .; KEEP(*(.debug_str)) __debug_str_end = .; __debug_line_start = .; KEEP(*(.debug_line)) __debug_line_end = .; __debug_ranges_start = .; KEEP(*(.debug_ranges)) __debug_ranges_end = .; }
Thanks Rui for writing the test for me.