All other singleton instances are accessible globally.
CommonInputSection shouldn't be an exception.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Rui, I wonder why have you removed zero(&Hdr) from CommonInputSection constructor?
The InputSectionBase<ELFT> constructor reads sh_addralign from Hdr to calculate Alignment field, and this can be done incorrectly in case Hdr is not zeroed
Comment Actions
It is guaranteed by the language spec (and by the fact that they are allocated to the .bss section) that global variables are initialized to zeros, no?
Comment Actions
Yes, it is. But it looks like CommonInputSection singleton is actually a stack variable. See Writer.cpp:224