1 # This awk script processes the output of objdump --dynamic-syms
2 # into a simple format that should not change when the ABI is not changing.
12 /[^
:]+\.so\.
[0-9.
]+:[ ]+.file format .
*$
/ {
18 sub(/:$
/, "", sofullname
);
20 sub(/^.
*\
//, "", soname
);
21 sub(/\.so\.
[0-9.
]+$
/, "", soname
);
23 suppress =
((filename_regexp
!= "" && sofullname !~ filename_regexp
) \
24 || (libname_regexp
!= "" && soname !~ libname_regexp
));
32 /^
[0-9a
-fA
-F
]+ / { sub(/ /, " - ") }
35 $
4 ==
"*UND*" { next }
40 $
2 ==
"g" || $
2 ==
"w" && NF ==
7 {
48 gsub(/[()]/, "", version
);
50 if (version ==
"GLIBC_PRIVATE") next;
53 if (type ==
"D" && $
4 ==
".tbss") {
56 else if (type ==
"D" && $
4 ==
".opd") {
63 else if ($
4 ==
"*ABS*") {
67 else if (type ==
"DO") {
70 else if (type ==
"DF") {
71 if (symbol ~
/^\.
/ && seen_opd
>=
0)
78 desc = symbol
" " version
" " weak
" ? " type
" " $
4 " " $
5;
81 desc = symbol
" " version
" " weak
" ? " type
" " $
4 " " $
5;
84 # Disabled -- weakness should not matter to shared library ABIs any more.
85 #if (weak == "w") type = tolower(type);
87 desc =
" " symbol
" " type size
;
90 version = soname
" " version
(combine_fullname ?
" " sofullname
: "");
92 if (version in versions
) {
93 versions
[version
] = versions
[version
] "\n" desc
;
96 versions
[version
] = desc
;
102 NF ==
0 || /DYNAMIC SYMBOL TABLE
/ || /file format
/ { next }
105 print "Don't grok this line:", $
0
109 if (!
end && (combine
|| ! parse_names
|| soname ==
""))
111 tofile = parse_names
&& !combine
;
114 for (version in versions
) {
115 if (nverslist ==
0) {
120 split(verslist
, s
, "\n");
121 if (version
< s
[1]) {
123 for (i =
1; i
<= nverslist
; ++i
) {
124 verslist = verslist
"\n" s
[i
];
129 for (i =
2; i
<= nverslist
; ++i
) {
130 if (version
< s
[i
]) break;
131 verslist = verslist
"\n" s
[i
];
133 verslist = verslist
"\n" version
;
134 for (; i
<= nverslist
; ++i
) {
135 verslist = verslist
"\n" s
[i
];
142 out = prefix soname
".symlist";
143 if (soname in outfiles
)
144 out = out
"." ++outfiles
[soname
];
146 outfiles
[soname
] =
1;
150 split(verslist
, order
, "\n");
151 for (i =
1; i
<= nverslist
; ++i
) {
155 print version
>> out
;
157 outpipe =
"sort >> " out
;
162 print prefix version
;
165 print versions
[version
] | outpipe
;
168 delete versions
[version
];
170 for (version in versions
)
171 delete versions
[version
];
174 print "wrote", out
, "for", sofullname
;