With dsymutil's -u option, only the accelerator tables should be updated, but with https://reviews.llvm.org/D150554 the -u option will still re-generate the line table. If the line table was empty, that is, it was a dummy line table, with no entries in it, dsymutil will always generate a line table with a DW_LNE_end_sequence, a funky side effect of this is that when the line table is re-generated, it will always emit a DW_LNE_set_address first, which will change the line table total size. This patch addresses this by making sure that if all the line table has in it is a DW_LNE_end_sequence, it is the same as a dummy entry.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/DWARFLinker/DWARFStreamer.cpp | ||
---|---|---|
854–855 ↗ | (On Diff #526170) | Would it make sense to hoist that into the LineTable class and have a method LineTable::empty() that returns exactly this? |
llvm/lib/DWARFLinker/DWARFStreamer.cpp | ||
---|---|---|
854–855 ↗ | (On Diff #526170) | In that case LineTable::empty() would in fact not match with real number of LineTable.Rows(). It looks a bit sloppy. Another alternative might be implementing what described in DWARFLinker.cpp: // FIXME: this only removes the unneeded end_sequence if the // sequences have been inserted in order. Using a global sort like // described in generateLineTableForUnit() and delaying the end_sequene // elimination to emitLineTableForUnit() we can get rid of all of them. Running such cleanup code for no-update and update modes will probably make output equal for both modes. |
llvm/lib/DWARFLinker/DWARFStreamer.cpp | ||
---|---|---|
854–855 ↗ | (On Diff #526170) | Or, if it is not a good moment to implementing such cleanup code then do simple version of it in DWARFLinker.cpp: // Set Line Table Rows. if (Linker.Options.Update) { LineTable.Rows = LT->Rows; if (LineTable.Rows.size() == 1 && LineTable.Rows[0].EndSequence)) LineTable.Rows.clear() |
Comment Actions
clear the line table rows, if the update flag is set, and the line table just has a DW_LNE_end_sequence in DWARFLinker.cpp