-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchange_symbols
executable file
·53 lines (37 loc) · 948 Bytes
/
change_symbols
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
ptx=$1
# Strip the _Z prefix
sed -i 's/_Z._/_/g' $ptx
# Change the postfixes
# float - s (f -> s)
sed -i 's/ff(/ss(/g' $ptx
sed -i 's/ff_/ss_/g' $ptx
sed -i 's/f(/s(/g' $ptx
sed -i 's/f_/s_/g' $ptx
# double - d (no change)
# int - i (no change)
# uint - u (j -> u)
sed -i 's/jj(/uu(/g' $ptx
sed -i 's/jj_/uu_/g' $ptx
sed -i 's/j(/u(/g' $ptx
sed -i 's/j_/u_/g' $ptx
# char - j (c -> j)
sed -i 's/cc(/jj(/g' $ptx
sed -i 's/cc_/jj_/g' $ptx
sed -i 's/c(/j(/g' $ptx
sed -i 's/c_/j_/g' $ptx
# uchar - v (h -> v)
sed -i 's/hh(/vv(/g' $ptx
sed -i 's/hh_/vv_/g' $ptx
sed -i 's/h(/v(/g' $ptx
sed -i 's/h_/v_/g' $ptx
# float2 - c (6float2S_ -> c)
sed -i 's/6float2S_/cc/g' $ptx
sed -i 's/6float2/c/g' $ptx
# double2 - z (7double2S_ -> z)
sed -i 's/7double2S_/zz/g' $ptx
sed -i 's/7double2/z/g' $ptx
# Fixing a false positive
sed -i 's/erss/erfs/g' $ptx
# Why did this pop out now?
sed -i 's/_Z12___bit/___bit/g' $ptx