public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] glibcymbols.read_abilist: Add check for duplicate symbols
@ 2021-03-16 14:57 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2021-03-16 14:57 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3977477d48bc85a5719f3d54040b257cc7e85709

commit 3977477d48bc85a5719f3d54040b257cc7e85709
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Mar 16 15:56:50 2021 +0100

    glibcymbols.read_abilist: Add check for duplicate symbols
    
    This detects some bogus abilist files.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 scripts/glibcsymbols.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/glibcsymbols.py b/scripts/glibcsymbols.py
index e329ead7f2..1bdd19e51e 100644
--- a/scripts/glibcsymbols.py
+++ b/scripts/glibcsymbols.py
@@ -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):


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-16 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 14:57 [glibc] glibcymbols.read_abilist: Add check for duplicate symbols Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).