forked from OSchip/llvm-project
[ELF] --gdb-index: error if constant pool size exceeds UINT32_MAX
If so, the last symbol's name_offset likely exceeds 0xffffffff and is not supported by the format (https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html#Index-Section-Format). I have seen an internal oversized executable with such a corrupted .gdb_index
This commit is contained in:
parent
7a20d6abe4
commit
5e643cd7b7
|
@ -2844,6 +2844,10 @@ createSymbols(
|
|||
sym.nameOff = off;
|
||||
off += sym.name.size() + 1;
|
||||
}
|
||||
// If off overflows, the last symbol's nameOff likely overflows.
|
||||
if (!isUInt<32>(off))
|
||||
errorOrWarn("--gdb-index: constant pool size (" + Twine(off) +
|
||||
") exceeds UINT32_MAX");
|
||||
|
||||
return {ret, off};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue