Message ID | e27a86392f5056c1b37b3f6f6f5e5dd15804fec5.1615537262.git.fweimer@redhat.com |
---|---|
State | New |
Headers | show |
Series | Merge helper for abilist files | expand |
LGTM, thanks. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> On 12/03/2021 05:23, Florian Weimer via Libc-alpha wrote: > This detects some bogus abilist files. > --- > 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): >
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):