]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
glibcymbols.read_abilist: Add check for duplicate symbols
authorFlorian Weimer <fweimer@redhat.com>
Tue, 16 Mar 2021 14:56:50 +0000 (15:56 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 16 Mar 2021 14:57:16 +0000 (15:57 +0100)
This detects some bogus abilist files.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
scripts/glibcsymbols.py

index e329ead7f24d2a6be5a25e181b6e4984d9dfdb23..1bdd19e51e3bc82c8f2d614382ad53719b79f17f 100644 (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):