/[path-sandbox]/trunk/scripts/gen_symbol_version_map.awk
Gentoo

Contents of /trunk/scripts/gen_symbol_version_map.awk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 206 - (show annotations) (download)
Fri Dec 2 12:32:53 2005 UTC (8 years, 9 months ago) by azarah
File size: 1651 byte(s)
Do not re-set VERSIONED_LIBC if already set.
1 BEGIN {
2 split(ENVIRON["SYMBOLS"], SYMBOLS);
3 }
4
5 {
6 for (x in SYMBOLS) {
7 sym_regex = "^" SYMBOLS[x] "(@|$)"
8 if ($8 ~ sym_regex) {
9 split($8, symbol_array, /@|@@/);
10
11 # Don't add local symbols of versioned libc's
12 if (VERSIONED_LIBC && !symbol_array[2])
13 continue;
14
15 # Handle non-versioned libc's like uClibc ...
16 if (!symbol_array[2])
17 symbol_array[2] = "";
18
19 # We have a versioned libc
20 if (symbol_array[2] && !VERSIONED_LIBC)
21 VERSIONED_LIBC = 1;
22
23 ADD = 1;
24 # Check that we do not add duplicates
25 for (x in PROCESSED_SYMBOLS) {
26 if (x == $8) {
27 ADD = 0;
28 break;
29 }
30 }
31
32 if (ADD) {
33 SYMBOL_LIST[symbol_array[2]] = SYMBOL_LIST[symbol_array[2]] " " symbol_array[1];
34 PROCESSED_SYMBOLS[$8] = $8;
35 }
36 }
37 }
38 }
39
40 END {
41 for (sym_version in SYMBOL_LIST) {
42 if (sym_version)
43 VERSIONS = VERSIONS " " sym_version;
44 }
45
46 # We need the symbol versions sorted alphabetically ...
47 if (VERSIONS) {
48 split(VERSIONS, VERSION_LIST);
49 COUNT = asort(VERSION_LIST);
50 } else {
51 # Handle non-versioned libc's like uClibc ...
52 COUNT = 1;
53 }
54
55 for (i = 1; i <= COUNT; i++) {
56 if (VERSION_LIST[i]) {
57 sym_version = VERSION_LIST[i];
58 printf("%s {\n", sym_version);
59 } else {
60 # Handle non-versioned libc's like uClibc ...
61 sym_version = "";
62 printf("{\n");
63 }
64
65 printf(" global:\n");
66
67 split(SYMBOL_LIST[sym_version], sym_names);
68
69 for (x in sym_names)
70 printf(" %s;\n", sym_names[x]);
71
72 if (!old_sym_version) {
73 printf(" local:\n");
74 printf(" *;\n");
75 printf("};\n");
76 } else {
77 printf("} %s;\n", old_sym_version);
78 }
79
80 old_sym_version = sym_version;
81 }
82 }

  ViewVC Help
Powered by ViewVC 1.1.20