1 # Script to preprocess Versions.all lists based on "earliest version"
2 # specifications in the shlib-versions file.
5 for (i = 0; i <= NF - 3; ++i)
6 firstversion[$1, i] = $(3 + i);
11 NF == 2 && $2 == "{" { thislib = $1; print; next }
14 if ((thislib, idx[thislib]) in firstversion) {
15 # We haven't seen the stated version, but have produced
16 # others pointing to it, so we synthesize it now.
17 printf " %s\n", firstversion[thislib, idx[thislib]];
24 /GLIBC_PRIVATE/ { print; next }
27 if ((thislib, idx[thislib]) in firstversion) {
28 # XXX relative string comparison loses if we ever have multiple digits
29 # between dots in GLIBC_x.y[.z] names.
30 f = v = firstversion[thislib, idx[thislib]];
32 delete firstversion[thislib, idx[thislib]];
34 if ((thislib, idx[thislib]) in firstversion)
35 v = firstversion[thislib, idx[thislib]];
39 if ($1 == v || $1 == f)
40 # This version was the specified earliest version itself.
43 # This version is older than the specified earliest version.
45 # Record that V has been referred to, so we will be sure to emit it
46 # if we hit a later one without hitting V itself.
47 usedversion[thislib, v] = 1;
50 # This version is newer than the specified earliest version.
51 # We haven't seen that version itself or else we wouldn't be here
52 # because we would have removed it from the firstversion array.
53 # If there were any earlier versions that used that one, emit it now.
54 if ((thislib, v) in usedversion) {