[LLD][COFF] Reduce the maximum size of the GHASH table
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 28 May 2021 13:45:31 +0000 (09:45 -0400)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 28 May 2021 13:46:17 +0000 (09:46 -0400)
commit2b9b9652ce27467283ae90a767af57d838a2465b
treef4279b59dac3387ea3d83b8938cd8b42bcb6426c
parenta773b2e430a830852c7b8ae3690ed44950c51c63
[LLD][COFF] Reduce the maximum size of the GHASH table

Before this patch, the maximum size of the GHASH table was 2^31 buckets. However we were storing the bucket index into a TypeIndex which has an input limit of (2^31)-4095 indices, see this link. Any value above that limit will improperly set the TypeIndex's high bit, which is interpreted as DecoratedItemIdMask. This used to cause bad indices on extraction when calling TypeIndex::toArrayIndex().

Differential Revision: https://reviews.llvm.org/D103297
lld/COFF/DebugTypes.cpp