forked from OSchip/llvm-project
[ELF] - Do not hang if broken object has option descriptor in .MIPS.options with size of zero.
Previously lld would hang in infinite loop in this case, patch fixes the issue. Object was found during AFL run. Differential revision: https://reviews.llvm.org/D25229 llvm-svn: 283208
This commit is contained in:
parent
06b7a87298
commit
422e47a9f5
|
@ -694,6 +694,8 @@ MipsOptionsInputSection<ELFT>::MipsOptionsInputSection(elf::ObjectFile<ELFT> *F,
|
|||
error(getName(this) + ": unsupported non-zero ri_gp_value");
|
||||
break;
|
||||
}
|
||||
if (!O->size)
|
||||
fatal(getName(this) + ": zero option descriptor size");
|
||||
D = D.slice(O->size);
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
## mips-invalid-options-descriptor.elf has option descriptor in
|
||||
## .MIPS.options with size of zero.
|
||||
# RUN: not ld.lld %p/Inputs/mips-invalid-options-descriptor.elf -o %t2 2>&1 | \
|
||||
# RUN: FileCheck %s
|
||||
# CHECK: zero option descriptor size
|
Loading…
Reference in New Issue