Roland McGrath wrote:
Two things occur to me wrt .debug_aranges validation:
It's not an automatic error if there is no .debug_aranges section (or a
completely empty one). It's a high-level check that the aranges match the
CUs--but you can legitimately have just CUs that don't have any addresses.
I see, so high level will check if there are addresses in CUs that need
covering, and will only issue missing-section warning then. I dropped
the message for now.
You do a connectivity check for the CU pointers. It would also be
to do a "suspicious" check that there aren't multiple separate sets
pointing to the same CU. It is not clearly invalid per se to have
multiples, but it is clearly weird. Our high-level checks probably won't
try to account for multiple sets for a CU being correct.
Done. Should I do similar check for pubnames/pubtypes?
Also, now that I look at your aranges code, I assume you either
tested it yet or haven't pushed the current code. The "Covered length"
parsing is totally bogus. What follows the CU offset are two single bytes
(address_size, segment_size), not another offset-size value that's a
length. What you should check there is that the address_size matches the
address_size in the CU header, and that the segment_size is 0.
That's how it's done. I think you may have been looking at
pubnames/pubtypes validation instead.