this repo has no description
1#!/usr/bin/env python
2
3import fileinput
4import subprocess
5import sys, os
6
7devnull = open(os.devnull, 'wb')
8
9for line in fileinput.input():
10 line = line.rstrip()
11 orig_line = line
12 fixed = False
13
14 while True:
15 proc = subprocess.Popen("readelf -Ws /home/lubos/Projects/darling-root/lib32/darling/libstdcxx.so | grep " + line + "@@", shell=True, stdout=devnull, stderr=devnull)
16 proc.wait()
17
18 if proc.returncode != 0:
19 pos = line.rfind('m')
20 if pos == -1:
21 break
22 ll = list(line)
23 ll[pos] = 'j'
24 line = "".join(ll)
25 else:
26 fixed = True
27 break
28
29 if fixed:
30 print orig_line + ' = ' + line + ';'
31 else:
32 sys.stderr.write('Cannot fix ' + orig_line + '\n')
33
34