[PATCH] D25822: [DWARF parsers] - Add a way to get section indices when call DWARFUnit::collectAddressRanges()

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 02:25:21 PDT 2016


grimar added a comment.

In https://reviews.llvm.org/D25822#576954, @clayborg wrote:

> After speaking with some local ELF experts over here, my proposed solution won't work. Would it be possible to encode the section index into the upper bits of any addresses that need to retain know their section?


I think that would be not correct correct solution to mix address and section index in a variable.

If not it seems weird to just be changing a few places that use high and low PC in a few areas of the DWARF parser. It would seem that we would need to change all places that can use addresses over to use some structure like:

>   struct FileAddress {
>       uint64_t vmAddr;
>       uint32_t sectIdx;
>   };
> 
> 
> instead of just a "uint64_t" as a file address.

It may be worth to do, but may be not. Looks generation of .gdb_index section in LLD was the first consumer who faced the absence of this API ? For now in LLD we only need it in this place and that seems to be enough.
So I am not sure we really **need** to change all the places to use this structure. That probably works for consistency, but also probably is just excessive. What the point to do that if nobody going to use it ?


https://reviews.llvm.org/D25822





More information about the llvm-commits mailing list