filter_libc revision b32f58018498ea2225959b0ba11c18f0c433deef
1#! /usr/bin/perl -w
2
3use strict;
4
5while (<>)
6{
7    s/ __getsockname / getsockname /;
8    s/ __sigaction / sigaction /;
9    s/ __GI___/ __/;
10    s/ __([a-z]*)_nocancel / $1 /;
11
12    # "libSystem*" occurs on Darwin.
13    s/\(in \/.*(libc|libSystem).*\)$/(in \/...libc...)/;
14    s/\(within \/.*(libc|libSystem).*\)$/(within \/...libc...)/;
15
16    # Remove the filename -- on some platforms (eg. Linux) it will be in
17    # libc, on some (eg. Darwin) it will be in the main executable.
18    s/\(below main\) \(.+\)$/(below main)/;
19
20    # Merge the different C++ operator variations.
21    s/(at.*)__builtin_new/$1...operator new.../;
22    s/(at.*)operator new\(unsigned(| int| long)\)/$1...operator new.../;
23
24    s/(at.*)__builtin_vec_new/$1...operator new.../;
25    s/(at.*)operator new\[\]\(unsigned(| int| long)\)/$1...operator new[].../;
26
27    s/(at.*)__builtin_delete/$1...operator delete.../;
28    s/(at.*)operator delete\(void\*\)/$1...operator delete.../;
29
30    s/(at.*)__builtin_vec_delete/$1...operator delete[].../;
31    s/(at.*)operator delete\[\]\(void\*\)/$1...operator delete[].../;
32
33    print;
34}
35
36exit 0;
37