/[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 205 - (show annotations) (download)
Fri Dec 2 12:31:19 2005 UTC (9 years, 5 months ago) by azarah
File size: 1613 byte(s)
Do not add unversioned symbols if we have a versioned libc.
Do not add duplicates.  This is mostly due to unstripped libc .. bug #114200.

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 else
19 # We have a versioned libc
20 VERSIONED_LIBC = 1;
21
22 ADD = 1;
23 # Check that we do not add duplicates
24 for (x in PROCESSED_SYMBOLS) {
25 if (x == $8) {
26 ADD = 0;
27 break;
28 }
29 }
30
31 if (ADD) {
32 SYMBOL_LIST[symbol_array[2]] = SYMBOL_LIST[symbol_array[2]] " " symbol_array[1];
33 PROCESSED_SYMBOLS[$8] = $8;
34 }
35 }
36 }
37 }
38
39 END {
40 for (sym_version in SYMBOL_LIST) {
41 if (sym_version)
42 VERSIONS = VERSIONS " " sym_version;
43 }
44
45 # We need the symbol versions sorted alphabetically ...
46 if (VERSIONS) {
47 split(VERSIONS, VERSION_LIST);
48 COUNT = asort(VERSION_LIST);
49 } else {
50 # Handle non-versioned libc's like uClibc ...
51 COUNT = 1;
52 }
53
54 for (i = 1; i <= COUNT; i++) {
55 if (VERSION_LIST[i]) {
56 sym_version = VERSION_LIST[i];
57 printf("%s {\n", sym_version);
58 } else {
59 # Handle non-versioned libc's like uClibc ...
60 sym_version = "";
61 printf("{\n");
62 }
63
64 printf(" global:\n");
65
66 split(SYMBOL_LIST[sym_version], sym_names);
67
68 for (x in sym_names)
69 printf(" %s;\n", sym_names[x]);
70
71 if (!old_sym_version) {
72 printf(" local:\n");
73 printf(" *;\n");
74 printf("};\n");
75 } else {
76 printf("} %s;\n", old_sym_version);
77 }
78
79 old_sym_version = sym_version;
80 }
81 }

  ViewVC Help
Powered by ViewVC 1.1.20