mirror of
https://github.com/rui314/mold.git
synced 2024-11-12 23:48:51 +03:00
[ELF] Fix uninitialized ElfSym paddings
Designated initializer doesn't initialize the padding; make sure we memset them by ourselves. Signed-off-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
This commit is contained in:
parent
f18af9e2f4
commit
0b50ebda47
@ -1535,6 +1535,7 @@ template <typename E>
|
||||
void SharedFile<E>::populate_symtab(Context<E> &ctx) {
|
||||
ElfSym<E> *symtab =
|
||||
(ElfSym<E> *)(ctx.buf + ctx.symtab->shdr.sh_offset) + this->global_symtab_idx;
|
||||
memset(symtab, 0, sizeof(ElfSym<E>) * this->num_global_symtab);
|
||||
|
||||
u8 *strtab = ctx.buf + ctx.strtab->shdr.sh_offset + this->strtab_offset;
|
||||
|
||||
|
@ -508,7 +508,8 @@ static void load_plugin(Context<E> &ctx) {
|
||||
|
||||
template <typename E>
|
||||
static ElfSym<E> to_elf_sym(PluginSymbol &psym) {
|
||||
ElfSym<E> esym = {};
|
||||
ElfSym<E> esym;
|
||||
memset(&esym, 0, sizeof(esym));
|
||||
|
||||
switch (psym.def) {
|
||||
case LDPK_DEF:
|
||||
|
Loading…
Reference in New Issue
Block a user