Commit 91fc7216 authored by Teng Qin's avatar Teng Qin Committed by Brenden Blanco

Do not load zero-length function symbols

parent 488c119e
......@@ -178,8 +178,10 @@ static int list_in_scn(Elf *e, Elf_Scn *section, size_t stridx, size_t symsize,
if (sym.st_value == 0)
continue;
uint32_t flag = 1 << ELF_ST_TYPE(sym.st_info);
if (!(option->use_symbol_type & flag))
uint32_t st_type = ELF_ST_TYPE(sym.st_info);
if (sym.st_size == 0 && (st_type == STT_FUNC || st_type == STT_GNU_IFUNC))
continue;
if (!(option->use_symbol_type & (1 << st_type)))
continue;
if (callback(name, sym.st_value, sym.st_size, payload) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment