[llvm-dev] [EXTERNAL] Re: [LLD] Support DWARF64, debug_info "sorting"

Igor Kudrin via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 16 22:42:09 PST 2020


On 14.11.2020 3:42, Fāng-ruì Sòng wrote:
> For .debug_* in object files:
> 
> DWARF32 -> SHT_PROGBITS (unchanged)
> DWARF64 -> SHT_DWARF64 or SHT_GNU_DWARF64
> 
> In LLD, we will need to allow mixed SHT_PROGBITS and SHT_DWARF64. If
> all input sections are SHT_DWARF64, the output section type probably
> should also be SHT_DWARF64.
> If mixed, SHT_PROGBITS.

I am not really sure that we need a new section type. This gets a small 
simplification in one part of the linker but adds much more burden of 
supporting that to all tools and specs around. And that support would be 
required for a rarely used feature, which certainly results that support 
to be partial and sometimes erroneous.

If we aim for clarity and not ambiguity, I would suggest considering the 
following. The DWARF specs designed so that the data of DWARF32 and 
DWARF64 formats can be intermixed together in one section. What section 
type should be used for that combination? Should it be another new 
section type, something like SHT_DWARF32_DWARF64? Probably not, that 
should be a regular SHT_PROGBITS. That means that DWARF64 data can be 
contained in a SHT_PROGBITS section. Consequently, the section which 
contains DWARF64 data without DWARF32 data should also be SHT_PROGBITS, 
because the latter is just a special case of the former.

> FWIW I started a generic-abi thread
> https://groups.google.com/g/generic-abi/c/i2Xio-47QdQ ("Reserve a
> section type value for DWARF64") to give stakeholders from other ELF
> operating systems a chance to participate in the design. I have paid
> attention to my wording: a new section type is **not decided yet** on
> LLVM/GNU binutils sides. Our discussions on llvm-dev/binutils will
> benefit from agreement/disagreement from generic-abi.

Thank you for conducting all these discussions. I hope we will finally 
find a way to bring the feature alive.

-- 
Best Regards,
Igor Kudrin
C++ Developer, Access Softek, Inc.


More information about the llvm-dev mailing list