2002-11-14 11:59:56 +08:00
|
|
|
# This awk script processes the output of objdump --dynamic-syms
|
|
|
|
# into a simple format that should not change when the ABI is not changing.
|
|
|
|
|
|
|
|
# Normalize columns.
|
|
|
|
/^[0-9a-fA-F]+ / { sub(/ /, " - ") }
|
|
|
|
|
|
|
|
# Skip undefineds.
|
|
|
|
$4 == "*UND*" { next }
|
|
|
|
|
|
|
|
# Skip locals.
|
|
|
|
$2 == "l" { next }
|
|
|
|
|
|
|
|
$2 == "g" || $2 == "w" && NF == 7 {
|
2002-12-23 19:17:18 +08:00
|
|
|
weak = $2;
|
2002-11-14 11:59:56 +08:00
|
|
|
type = $3;
|
2002-11-24 09:54:06 +08:00
|
|
|
size = $5;
|
|
|
|
sub(/^0*/, "", size);
|
2002-12-23 19:17:18 +08:00
|
|
|
size = " 0x" size;
|
2002-11-14 11:59:56 +08:00
|
|
|
version = $6;
|
|
|
|
symbol = $7;
|
|
|
|
gsub(/[()]/, "", version);
|
|
|
|
|
|
|
|
if (version == "GLIBC_PRIVATE") next;
|
|
|
|
|
|
|
|
if (type == "D" && $4 == ".tbss") {
|
2002-12-23 19:17:18 +08:00
|
|
|
type = "T";
|
2002-11-14 11:59:56 +08:00
|
|
|
}
|
2002-11-21 11:41:31 +08:00
|
|
|
else if (type == "D" && $4 == ".opd") {
|
2002-12-23 19:17:18 +08:00
|
|
|
type = "O";
|
|
|
|
size = "";
|
2002-11-21 11:41:31 +08:00
|
|
|
}
|
2002-11-14 11:59:56 +08:00
|
|
|
else if (type == "DO" && $4 == "*ABS*") {
|
2002-12-23 19:17:18 +08:00
|
|
|
type = "A";
|
|
|
|
size = "";
|
2002-11-14 11:59:56 +08:00
|
|
|
}
|
|
|
|
else if (type == "DO") {
|
2002-12-23 19:17:18 +08:00
|
|
|
type = "D";
|
2002-11-14 11:59:56 +08:00
|
|
|
}
|
|
|
|
else if (type == "DF") {
|
2002-12-23 19:17:18 +08:00
|
|
|
type = "F";
|
|
|
|
size = "";
|
2002-11-14 11:59:56 +08:00
|
|
|
}
|
|
|
|
else {
|
2002-12-23 19:17:18 +08:00
|
|
|
print symbol, version, weak, "?", type, $4, $5;
|
|
|
|
next;
|
2002-11-14 11:59:56 +08:00
|
|
|
}
|
|
|
|
|
2003-03-03 10:38:21 +08:00
|
|
|
# Disabled -- weakness should not matter to shared library ABIs any more.
|
|
|
|
#if (weak == "w") type = tolower(type);
|
|
|
|
desc = " " symbol " " type size;
|
2002-12-23 19:17:18 +08:00
|
|
|
|
|
|
|
if (version in versions) {
|
|
|
|
versions[version] = versions[version] "\n" desc;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
versions[version] = desc;
|
|
|
|
}
|
2002-11-14 11:59:56 +08:00
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Header crapola.
|
|
|
|
NF == 0 || /DYNAMIC SYMBOL TABLE/ || /file format/ { next }
|
|
|
|
|
|
|
|
{
|
|
|
|
print "Don't grok this line:", $0
|
|
|
|
}
|
2002-12-23 19:17:18 +08:00
|
|
|
|
|
|
|
END {
|
|
|
|
nverlist = 0;
|
|
|
|
for (version in versions) {
|
|
|
|
if (nverslist == 0) {
|
|
|
|
verslist = version;
|
|
|
|
nverslist = 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
split(verslist, s, "\n");
|
|
|
|
if (version < s[1]) {
|
|
|
|
verslist = version;
|
|
|
|
for (i = 1; i <= nverslist; ++i) {
|
|
|
|
verslist = verslist "\n" s[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
verslist = s[1];
|
|
|
|
for (i = 2; i <= nverslist; ++i) {
|
|
|
|
if (version < s[i]) break;
|
|
|
|
verslist = verslist "\n" s[i];
|
|
|
|
}
|
|
|
|
verslist = verslist "\n" version;
|
|
|
|
for (; i <= nverslist; ++i) {
|
|
|
|
verslist = verslist "\n" s[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
++nverslist;
|
|
|
|
}
|
|
|
|
|
|
|
|
split(verslist, order, "\n");
|
|
|
|
for (i = 1; i <= nverslist; ++i) {
|
|
|
|
version = order[i];
|
|
|
|
|
|
|
|
print version;
|
|
|
|
outpipe = "sort";
|
|
|
|
print versions[version] | outpipe;
|
|
|
|
close(outpipe);
|
|
|
|
}
|
|
|
|
}
|