glibcymbols.read_abilist: Add check for duplicate symbols

This detects some bogus abilist files.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer 2021-03-16 15:56:50 +01:00
parent b9e2903712
commit 3977477d48

View File

@ -63,7 +63,10 @@ def read_abilist(path):
with open(path) as inp:
for line in inp:
version, symbol, flags = line.strip().split(' ', 2)
result[VersionedSymbol(symbol, version)] = flags
versym = VersionedSymbol(symbol, version)
if versym in result:
raise IOError("{}: duplicate symbol {}".format(path, versym))
result[versym] = flags
return result
def abilist_lines(symbols):