The intention here is to prune out line sequences addresses referring
outside any known sections. Such line sequences are typically produced
by dead-stripped code, which leaves behind some debug info.
These line sequences were pretty much ignored already -- they would fail
at the LineTable::ConvertEntryAtIndexToLineEntry stage. However, they
still made it into the line table and into the "image dump line-table"
output, which was printing random nonsense as a result.
This avoids putting these sequences into the line table in the first
place, which makes them smaller (some files have a lot of dead line
sequences) and hopefully slightly speeds up code which iterates through
the line table linearly.
It also makes the "image dump line-table" output sane, which means I can
write my test for handling of different linker tombstoning behaviors.
Depends on D84401.
Could you specifically look for/propagate tombstones here, to reduce the risk of large functions overlapping with the valid address range, even when they're tombstoned to zero? (because zero+large function size could still end up overlapping with valid code)
To do that well, I guess it'd have to be implemented at a lower-layer, inside the line table state machine - essentially dropping all lines derived from a "set address" operation that specifies a tombstone.