We can leave it zero size of when CSNameTable is empty. Previously it will write the size(value is zero but it has 1 byte) to this section.
This is for the backward compatibility as extbinary only skip the zero size for the unknown section.
Differential D112465
[llvm-profgen] Avoid writing any data to CSNameTableSection for the empty CSNameTable wlei on Oct 25 2021, 9:56 AM. Authored by
Details
Diff Detail
Event Timeline
|
SampleProfileReaderExtBinaryBase::readCSNameTableSec would still expect to read a zero here, and if we skip writing the zero, the read will get some garbage data? Or did I miss anything?
Also this is inconsistent with how we write other sections - we don't omit zero size.