Fix multiple GLIBC versions

pull/17/head
blackle 2 years ago
parent 8d85d3d4b3
commit 181c80984b
  1. 6
      smol/parse.py
  2. 2
      smold.py

@ -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

@ -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))

Loading…
Cancel
Save