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 # If the target uses ST_OTHER, it will be output before the symbol name.
41 $
2 ==
"g" || $
2 ==
"w" && (NF ==
7 || NF ==
8) {
49 gsub(/[()]/, "", version
);
51 if (version ==
"GLIBC_PRIVATE") next;
54 if (type ==
"D" && $
4 ==
".tbss") {
57 else if (type ==
"D" && $
4 ==
".opd") {
64 else if (type ==
"D" && NF ==
8 && $
7 ==
"0x80") {
65 # Alpha functions avoiding plt entry in users
70 else if ($
4 ==
"*ABS*") {
74 else if (type ==
"DO") {
77 else if (type ==
"DF") {
78 if (symbol ~
/^\.
/ && seen_opd
>=
0)
84 else if (type ==
"iD" && ($
4 ==
".text" || $
4 ==
".opd")) {
90 desc = symbol
" " version
" " weak
" ? " type
" " $
4 " " $
5;
93 desc = symbol
" " version
" " weak
" ? " type
" " $
4 " " $
5;
96 # Disabled -- weakness should not matter to shared library ABIs any more.
97 #if (weak == "w") type = tolower(type);
99 desc =
" " symbol
" " type size
;
102 version = soname
" " version
(combine_fullname ?
" " sofullname
: "");
104 if (version in versions
) {
105 versions
[version
] = versions
[version
] "\n" desc
;
108 versions
[version
] = desc
;
114 NF ==
0 || /DYNAMIC SYMBOL TABLE
/ || /file format
/ { next }
117 print "Don't grok this line:", $
0
121 if (!
end && (combine
|| ! parse_names
|| soname ==
""))
123 tofile = parse_names
&& !combine
;
126 for (version in versions
) {
127 if (nverslist ==
0) {
132 split(verslist
, s
, "\n");
133 if (version
< s
[1]) {
135 for (i =
1; i
<= nverslist
; ++i
) {
136 verslist = verslist
"\n" s
[i
];
141 for (i =
2; i
<= nverslist
; ++i
) {
142 if (version
< s
[i
]) break;
143 verslist = verslist
"\n" s
[i
];
145 verslist = verslist
"\n" version
;
146 for (; i
<= nverslist
; ++i
) {
147 verslist = verslist
"\n" s
[i
];
154 out = prefix soname
".symlist";
155 if (soname in outfiles
)
156 out = out
"." ++outfiles
[soname
];
158 outfiles
[soname
] =
1;
162 split(verslist
, order
, "\n");
163 for (i =
1; i
<= nverslist
; ++i
) {
167 print version
>> out
;
169 outpipe =
"sort >> " out
;
174 print prefix version
;
177 print versions
[version
] | outpipe
;
180 delete versions
[version
];
182 for (version in versions
)
183 delete versions
[version
];
186 print "wrote", out
, "for", sofullname
;