summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-03-27 11:54:09 +0000
committerRoland McGrath <roland@gnu.org>2003-03-27 11:54:09 +0000
commit15a686af58c659a0c6c336582b9f1f6514a67137 (patch)
tree93ef3c799c7065ceb7cce4db3f3e5b223516049c /scripts
parentfd54683c976e506e6311d0fc5d59a7a2d1387d42 (diff)
downloadglibc-15a686af58c659a0c6c336582b9f1f6514a67137.tar.gz
glibc-15a686af58c659a0c6c336582b9f1f6514a67137.tar.xz
glibc-15a686af58c659a0c6c336582b9f1f6514a67137.zip
* scripts/abilist.awk: If variable `parse_names' is set, grok the file
	header lines and write out foo.symlist files for each foo.so.NN listed.

	* libio/libioP.h (_IO_wfile_jumps): Remove attribute_hidden.
	This symbol is exported, and we don't want to hide it.
	Add libc_hidden_proto instead.
	(_IO_file_jumps): Add libc_hidden_proto.
	* libio/wfileops.c (_IO_wfile_jumps): Add libc_hidden_data_def.
	Remove INTVARDEF.
	* libio/fileops.c (_IO_file_jumps): Likewise.
	* libio/stdfiles.c: Don't use INTUSE on them.
	* libio/iofdopen.c (_IO_new_fdopen): Likewise.
	* libio/iofopen.c (__fopen_internal): Likewise.
	* libio/freopen.c (freopen): Likewise.
	* libio/freopen64.c (freopen64): Likewise.
	* libio/iovdprintf.c (_IO_vdprintf): Likewise.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/abilist.awk56
1 files changed, 50 insertions, 6 deletions
diff --git a/scripts/abilist.awk b/scripts/abilist.awk
index c25cbc0934..97266496fd 100644
--- a/scripts/abilist.awk
+++ b/scripts/abilist.awk
@@ -1,6 +1,27 @@
 # This awk script processes the output of objdump --dynamic-syms
 # into a simple format that should not change when the ABI is not changing.
 
+BEGIN {
+  if (parse_names)
+    out = "/dev/stderr";
+  else
+    out = "/dev/stdout";
+}
+
+# Per-file header.
+/[^ :]+\.so\.[0-9]+:[ 	]+.file format .*$/ {
+  if (parse_names && soname != "")
+    emit(1);
+
+  sofullname = $1;
+  sub(/:$/, "", sofullname);
+  soname = sofullname;
+  sub(/^.*\//, "", soname);
+  sub(/\.so\.[0-9]+$/, "", soname);
+
+  next
+}
+
 # Normalize columns.
 /^[0-9a-fA-F]+      / { sub(/      /, "  -   ") }
 
@@ -41,11 +62,11 @@ $2 == "g" || $2 == "w" && NF == 7 {
     size = "";
   }
   else {
-    print symbol, version, weak, "?", type, $4, $5;
+    print symbol, version, weak, "?", type, $4, $5 >> out;
     next;
   }
   if (size == " 0x") {
-    print symbol, version, weak, "?", type, $4, $5;
+    print symbol, version, weak, "?", type, $4, $5 >> out;
     next;
   }
 
@@ -66,10 +87,20 @@ $2 == "g" || $2 == "w" && NF == 7 {
 NF == 0 || /DYNAMIC SYMBOL TABLE/ || /file format/ { next }
 
 {
-  print "Don't grok this line:", $0
+  print "Don't grok this line:", $0 >> out
 }
 
-END {
+function emit(tofile) {
+  if (tofile) {
+    out = prefix soname ".symlist";
+    if (soname in outfiles)
+      out = out "." ++outfiles[soname];
+    else
+      outfiles[soname] = 1;
+  }
+  else
+    out = "/dev/stdout";
+
   nverlist = 0;
   for (version in versions) {
     if (nverslist == 0) {
@@ -102,9 +133,22 @@ END {
   for (i = 1; i <= nverslist; ++i) {
     version = order[i];
 
-    print version;
-    outpipe = "sort";
+    print version >> out;
+    outpipe = "sort >> " out;
     print versions[version] | outpipe;
     close(outpipe);
+
+    delete versions[version];
+  }
+
+  if (tofile)
+    print "wrote", out, "for", sofullname;
+}
+
+END {
+  if (! parse_names)
+    emit(0);
+  else if (soname != "") {
+    emit(1);
   }
 }