[llvm-dev] [DWARFv5] Reading the .debug_str_offsets section

Robinson, Paul via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 6 11:59:52 PDT 2017

Yep, Wolfgang picked up on the one thing I saw too.

This is why I like having people review my stuff.

I think it's a bit of a pity that str_offsets_base can point into the middle of a str_offsets contribution in some ways

Actually I changed my mind after saying that in the review, and in this writeup I concluded that it cannot do that.  str_offsets_base points to the element immediately after the header.  You can have multiple units sharing the (entire) same contribution, but there's no slicing.

I think there'd be some point/benefit to being able to have multiple contributions in a DWO file, but I don't think it's /buggy/ that it's not allowed - just a possible future enhancement.

The trick with having multiple contributions in a DWO is that the .debug_line.dwo section has no way to specify which contribution to use.  I mean, you could identify which CU points to that line table header, and then find the contribution associated with that unit, but it seems less complicated to say the DWO has only one contribution and not have to bother with all that.
I'm also not persuaded that having multiple str_offsets contributions in a normal .o file is all that helpful, or able to save space.  You save a byte, maybe two, per reference; but each unique string costs you 4, plus the header.  You can construct examples where it's a savings but in the general case I'm not so sure.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170706/010a9809/attachment.html>

More information about the llvm-dev mailing list