forked from OSchip/llvm-project
[ELF] Un-break undef-from-main-dso.test on MSVC 2012.
The result of sizeof(SymbolTable<ELFT>::SymbolEntry) in DynamicSymbolTable <ELFT>::write() was different from the same expression in RelocationTable <ELFT>::write(), although the same template parameters were passed. They were 40 and 32, respectively. As a result, the same vector was treated as a vector of 40 byte values in some places and a vector of 32 values in other places. That caused an weird issue, resulting in collapse of the rela.dyn section. I suspect that this is a padding size calculation bug in MSVC 2012, but I may be wrong. Reordering the fields to eliminate padding seems to fix the issue. llvm-svn: 194349
This commit is contained in:
parent
fed6c220ec
commit
78d1acb3af
|
@ -614,12 +614,12 @@ class SymbolTable : public Section<ELFT> {
|
|||
struct SymbolEntry {
|
||||
SymbolEntry(const Atom *a, const Elf_Sym &sym,
|
||||
const lld::AtomLayout *layout)
|
||||
: _atom(a), _symbol(sym), _atomLayout(layout) {}
|
||||
: _atom(a), _atomLayout(layout), _symbol(sym) {}
|
||||
SymbolEntry() : _atom(nullptr) {}
|
||||
|
||||
const Atom *_atom;
|
||||
Elf_Sym _symbol;
|
||||
const lld::AtomLayout *_atomLayout;
|
||||
Elf_Sym _symbol;
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue