Fix multiple GLIBC versions

This commit is contained in:
blackle 2020-08-24 13:27:42 -04:00
parent 8d85d3d4b3
commit 181c80984b
2 changed files with 4 additions and 4 deletions

View File

@ -169,7 +169,7 @@ def list_symbols(readelf_bin, lib):
if vis != "DEFAULT" or ndx == "UND":
continue
# strip away GNU versions
# strip away GLIBC versions
symbol = re.sub(r"@@.*$", "", symbol)
symbols.append(symbol)
@ -182,7 +182,7 @@ def build_symbol_map(readelf_bin, libraries):
symbols = list_symbols(readelf_bin, lib)
for symbol in symbols:
if symbol not in symbol_map:
symbol_map[symbol] = []
symbol_map[symbol] = set()
soname = lib.split("/")[-1]
symbol_map[symbol].append(soname)
symbol_map[symbol].add(soname)
return symbol_map

View File

@ -177,7 +177,7 @@ def main():
libs_for_symbol = libs_symbol_map[symbol]
if len(libs_for_symbol) > 1:
error("E: the symbol '" + symbol + "' is provided by more than one library: " + str(libs_for_symbol))
library = libs_for_symbol[0]
library = libs_for_symbol.pop()
symbols.setdefault(library, [])
symbols[library].append((symbol, reloc))