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

Diff of /trunk/scripts/gen_symbol_version_map.awk

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 387 Revision 388
25 continue; 25 continue;
26 26
27 # Handle non-versioned libc's like uClibc ... 27 # Handle non-versioned libc's like uClibc ...
28 if (!symbol_array[2]) 28 if (!symbol_array[2])
29 symbol_array[2] = ""; 29 symbol_array[2] = "";
30 30
31 # We have a versioned libc 31 # We have a versioned libc
32 if (symbol_array[2] && !VERSIONED_LIBC) 32 if (symbol_array[2] && !VERSIONED_LIBC)
33 VERSIONED_LIBC = 1; 33 VERSIONED_LIBC = 1;
34 34
35 ADD = 1; 35 ADD = 1;
38 if (y == $NF) { 38 if (y == $NF) {
39 ADD = 0; 39 ADD = 0;
40 break; 40 break;
41 } 41 }
42 } 42 }
43 43
44 if (ADD) { 44 if (ADD) {
45 SYMBOL_LIST[symbol_array[2]] = SYMBOL_LIST[symbol_array[2]] " " symbol_array[1]; 45 SYMBOL_LIST[symbol_array[2]] = SYMBOL_LIST[symbol_array[2]] " " symbol_array[1];
46 PROCESSED_SYMBOLS[$NF] = $NF; 46 PROCESSED_SYMBOLS[$NF] = $NF;
47 } 47 }
48 } 48 }
49 49
50 sym_regex = "^__" SYMBOLS[x] "(@@|$)"; 50 sym_regex = "^__" SYMBOLS[x] "(@@|$)";
51 if (($5 == "WEAK") && ($NF ~ sym_regex)) { 51 if (($5 == "WEAK") && ($NF ~ sym_regex)) {
52 split($NF, symbol_array, /@@/); 52 split($NF, symbol_array, /@@/);
53 53
54 # Don't add local symbols of versioned libc's 54 # Don't add local symbols of versioned libc's
55 if (VERSIONED_LIBC && !symbol_array[2]) 55 if (VERSIONED_LIBC && !symbol_array[2])
56 continue; 56 continue;
57 57
58 # Blacklist __getcwd on FreeBSD 58 # Blacklist __getcwd on FreeBSD
61 continue; 61 continue;
62 62
63 # Handle non-versioned libc's like uClibc ... 63 # Handle non-versioned libc's like uClibc ...
64 if (!symbol_array[2]) 64 if (!symbol_array[2])
65 symbol_array[2] = ""; 65 symbol_array[2] = "";
66 66
67 # We have a versioned libc 67 # We have a versioned libc
68 if (symbol_array[2] && !VERSIONED_LIBC) 68 if (symbol_array[2] && !VERSIONED_LIBC)
69 VERSIONED_LIBC = 1; 69 VERSIONED_LIBC = 1;
70 70
71 ADD = 1; 71 ADD = 1;
74 if (y == $NF) { 74 if (y == $NF) {
75 ADD = 0; 75 ADD = 0;
76 break; 76 break;
77 } 77 }
78 } 78 }
79 79
80 if (ADD) { 80 if (ADD) {
81 SYMBOL_LIST[symbol_array[2]] = SYMBOL_LIST[symbol_array[2]] " " symbol_array[1]; 81 SYMBOL_LIST[symbol_array[2]] = SYMBOL_LIST[symbol_array[2]] " " symbol_array[1];
82 PROCESSED_SYMBOLS[$NF] = $NF; 82 PROCESSED_SYMBOLS[$NF] = $NF;
83 } 83 }
84 } 84 }
97 COUNT = asort(VERSION_LIST); 97 COUNT = asort(VERSION_LIST);
98 } else { 98 } else {
99 # Handle non-versioned libc's like uClibc ... 99 # Handle non-versioned libc's like uClibc ...
100 COUNT = 1; 100 COUNT = 1;
101 } 101 }
102 102
103 for (i = 1; i <= COUNT; i++) { 103 for (i = 1; i <= COUNT; i++) {
104 if (VERSION_LIST[i]) { 104 if (VERSION_LIST[i]) {
105 sym_version = VERSION_LIST[i]; 105 sym_version = VERSION_LIST[i];
106 printf("%s {\n", sym_version); 106 printf("%s {\n", sym_version);
107 } else { 107 } else {
108 # Handle non-versioned libc's like uClibc ... 108 # Handle non-versioned libc's like uClibc ...
109 sym_version = ""; 109 sym_version = "";
110 printf("{\n"); 110 printf("{\n");
111 } 111 }
112 112
113 printf(" global:\n"); 113 printf(" global:\n");
114 114
115 split(SYMBOL_LIST[sym_version], sym_names); 115 split(SYMBOL_LIST[sym_version], sym_names);
116 116
117 for (x in sym_names) { 117 for (x in sym_names) {
118 printf(" %s;\n", sym_names[x]); 118 printf(" %s;\n", sym_names[x]);
119 } 119 }
120 120
121 if (!old_sym_version) { 121 if (!old_sym_version) {
123 printf(" *;\n"); 123 printf(" *;\n");
124 printf("};\n"); 124 printf("};\n");
125 } else { 125 } else {
126 printf("} %s;\n", old_sym_version); 126 printf("} %s;\n", old_sym_version);
127 } 127 }
128 128
129 old_sym_version = sym_version; 129 old_sym_version = sym_version;
130 } 130 }
131} 131}

Legend:
Removed from v.387  
changed lines
  Added in v.388

  ViewVC Help
Powered by ViewVC 1.1.20