2002-11-14 04:59:56 +01: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.
|
|
|
|
|
2003-03-27 12:54:09 +01:00
|
|
|
BEGIN {
|
2003-03-28 12:41:52 +01:00
|
|
|
if (combine_fullname)
|
|
|
|
combine = 1;
|
|
|
|
if (combine)
|
|
|
|
parse_names = 1;
|
2003-03-27 12:54:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Per-file header.
|
2003-04-02 06:00:03 +02:00
|
|
|
/[^ :]+\.so\.[0-9.]+:[ ]+.file format .*$/ {
|
2003-03-28 23:25:57 +01:00
|
|
|
emit(0);
|
2003-03-27 12:54:09 +01:00
|
|
|
|
2003-03-31 00:17:05 +02:00
|
|
|
seen_opd = 0;
|
|
|
|
|
2003-03-27 12:54:09 +01:00
|
|
|
sofullname = $1;
|
|
|
|
sub(/:$/, "", sofullname);
|
|
|
|
soname = sofullname;
|
|
|
|
sub(/^.*\//, "", soname);
|
2003-04-02 06:00:03 +02:00
|
|
|
sub(/\.so\.[0-9.]+$/, "", soname);
|
2003-03-27 12:54:09 +01:00
|
|
|
|
2003-03-28 23:25:57 +01:00
|
|
|
suppress = ((filename_regexp != "" && sofullname !~ filename_regexp) \
|
|
|
|
|| (libname_regexp != "" && soname !~ libname_regexp));
|
|
|
|
|
2003-03-27 12:54:09 +01:00
|
|
|
next
|
|
|
|
}
|
|
|
|
|
2003-03-28 23:25:57 +01:00
|
|
|
suppress { next }
|
|
|
|
|
2002-11-14 04:59:56 +01:00
|
|
|
# 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 12:17:18 +01:00
|
|
|
weak = $2;
|
2002-11-14 04:59:56 +01:00
|
|
|
type = $3;
|
2002-11-24 02:54:06 +01:00
|
|
|
size = $5;
|
|
|
|
sub(/^0*/, "", size);
|
2002-12-23 12:17:18 +01:00
|
|
|
size = " 0x" size;
|
2002-11-14 04:59:56 +01:00
|
|
|
version = $6;
|
|
|
|
symbol = $7;
|
|
|
|
gsub(/[()]/, "", version);
|
|
|
|
|
|
|
|
if (version == "GLIBC_PRIVATE") next;
|
|
|
|
|
2003-03-28 12:41:52 +01:00
|
|
|
desc = "";
|
2002-11-14 04:59:56 +01:00
|
|
|
if (type == "D" && $4 == ".tbss") {
|
2002-12-23 12:17:18 +01:00
|
|
|
type = "T";
|
2002-11-14 04:59:56 +01:00
|
|
|
}
|
2002-11-21 04:41:31 +01:00
|
|
|
else if (type == "D" && $4 == ".opd") {
|
2003-03-31 00:17:05 +02:00
|
|
|
type = "F";
|
2002-12-23 12:17:18 +01:00
|
|
|
size = "";
|
2003-03-31 00:17:05 +02:00
|
|
|
if (seen_opd < 0)
|
|
|
|
type = "O";
|
|
|
|
seen_opd = 1;
|
2002-11-21 04:41:31 +01:00
|
|
|
}
|
2003-03-28 12:41:52 +01:00
|
|
|
else if ($4 == "*ABS*") {
|
2002-12-23 12:17:18 +01:00
|
|
|
type = "A";
|
|
|
|
size = "";
|
2002-11-14 04:59:56 +01:00
|
|
|
}
|
|
|
|
else if (type == "DO") {
|
2002-12-23 12:17:18 +01:00
|
|
|
type = "D";
|
2002-11-14 04:59:56 +01:00
|
|
|
}
|
|
|
|
else if (type == "DF") {
|
2003-03-31 00:17:05 +02:00
|
|
|
if (symbol ~ /^\./ && seen_opd >= 0)
|
|
|
|
next;
|
|
|
|
seen_opd = -1;
|
2002-12-23 12:17:18 +01:00
|
|
|
type = "F";
|
|
|
|
size = "";
|
2002-11-14 04:59:56 +01:00
|
|
|
}
|
|
|
|
else {
|
2003-03-28 12:41:52 +01:00
|
|
|
desc = symbol " " version " " weak " ? " type " " $4 " " $5;
|
2002-11-14 04:59:56 +01:00
|
|
|
}
|
2003-03-03 08:11:42 +01:00
|
|
|
if (size == " 0x") {
|
2003-03-28 12:41:52 +01:00
|
|
|
desc = symbol " " version " " weak " ? " type " " $4 " " $5;
|
2003-03-03 08:11:42 +01:00
|
|
|
}
|
2002-11-14 04:59:56 +01:00
|
|
|
|
2003-03-03 03:38:21 +01:00
|
|
|
# Disabled -- weakness should not matter to shared library ABIs any more.
|
|
|
|
#if (weak == "w") type = tolower(type);
|
2003-03-28 12:41:52 +01:00
|
|
|
if (desc == "")
|
|
|
|
desc = " " symbol " " type size;
|
2002-12-23 12:17:18 +01:00
|
|
|
|
2003-03-28 23:25:57 +01:00
|
|
|
if (combine)
|
|
|
|
version = soname " " version (combine_fullname ? " " sofullname : "");
|
|
|
|
|
2002-12-23 12:17:18 +01:00
|
|
|
if (version in versions) {
|
|
|
|
versions[version] = versions[version] "\n" desc;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
versions[version] = desc;
|
|
|
|
}
|
2002-11-14 04:59:56 +01:00
|
|
|
next;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Header crapola.
|
|
|
|
NF == 0 || /DYNAMIC SYMBOL TABLE/ || /file format/ { next }
|
|
|
|
|
|
|
|
{
|
2003-03-28 12:41:52 +01:00
|
|
|
print "Don't grok this line:", $0
|
2002-11-14 04:59:56 +01:00
|
|
|
}
|
2002-12-23 12:17:18 +01:00
|
|
|
|
2003-03-28 23:25:57 +01:00
|
|
|
function emit(end) {
|
2003-04-02 06:00:03 +02:00
|
|
|
if (!end && (combine || ! parse_names || soname == ""))
|
2003-03-28 23:25:57 +01:00
|
|
|
return;
|
2003-04-02 06:00:03 +02:00
|
|
|
tofile = parse_names && !combine;
|
2003-03-28 23:25:57 +01:00
|
|
|
|
2003-03-28 12:41:52 +01:00
|
|
|
nverslist = 0;
|
2002-12-23 12:17:18 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2003-03-27 13:28:49 +01:00
|
|
|
if (tofile) {
|
|
|
|
out = prefix soname ".symlist";
|
|
|
|
if (soname in outfiles)
|
|
|
|
out = out "." ++outfiles[soname];
|
|
|
|
else
|
|
|
|
outfiles[soname] = 1;
|
|
|
|
printf "" > out;
|
|
|
|
}
|
|
|
|
|
2002-12-23 12:17:18 +01:00
|
|
|
split(verslist, order, "\n");
|
|
|
|
for (i = 1; i <= nverslist; ++i) {
|
|
|
|
version = order[i];
|
|
|
|
|
2003-03-27 13:28:49 +01:00
|
|
|
if (tofile) {
|
|
|
|
print version >> out;
|
|
|
|
close(out);
|
|
|
|
outpipe = "sort >> " out;
|
|
|
|
}
|
2003-03-28 12:41:52 +01:00
|
|
|
else {
|
2003-03-28 23:25:57 +01:00
|
|
|
if (combine)
|
|
|
|
print "";
|
|
|
|
print prefix version;
|
2003-03-27 13:28:49 +01:00
|
|
|
outpipe = "sort";
|
2003-03-28 12:41:52 +01:00
|
|
|
}
|
2002-12-23 12:17:18 +01:00
|
|
|
print versions[version] | outpipe;
|
|
|
|
close(outpipe);
|
2003-03-27 12:54:09 +01:00
|
|
|
|
|
|
|
delete versions[version];
|
|
|
|
}
|
2003-03-27 13:28:49 +01:00
|
|
|
for (version in versions)
|
|
|
|
delete versions[version];
|
2003-03-27 12:54:09 +01:00
|
|
|
|
|
|
|
if (tofile)
|
|
|
|
print "wrote", out, "for", sofullname;
|
|
|
|
}
|
|
|
|
|
|
|
|
END {
|
2003-03-28 23:25:57 +01:00
|
|
|
emit(1);
|
2002-12-23 12:17:18 +01:00
|
|
|
}
|