This is https://bugs.llvm.org/show_bug.cgi?id=38739,
user tries to use LLD as a library and seems faced the old pointer in InX::EhFrame
on non-first call of link(). We should clean the global variables correctly.
Differential D51409
[LLD][ELF] - Do not forget to clean synthetic sections pointers before link(). grimar on Aug 29 2018, 2:38 AM. Authored by
Details
This is https://bugs.llvm.org/show_bug.cgi?id=38739, user tries to use LLD as a library and seems faced the old pointer in InX::EhFrame
Diff Detail Event TimelineComment Actions But we do not have an instance of InX to use memset.
Right. Will you agree to do cleanup for synthetics in createSyntheticSections? Comment Actions Ping. What about this? I honestly think it is not that nice to have 'First', but it is probably better than other solutions I can think of.
Comment Actions Honestly saying, this is a bit strange feature, though I assumed it should work because we already have memset(&Out::First, 0, sizeof(Out)); line. Comment Actions Added David. I guess he might know something about the correctness of approach used. If it is not correct, we already have a bug in LLD then. |
Is it really guaranteed that static data members are adjacent in memory?