aboutsummaryrefslogtreecommitdiff
path: root/scripts/abilist.awk
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-11-14 03:59:56 +0000
committerRoland McGrath <roland@gnu.org>2002-11-14 03:59:56 +0000
commit6e3d59bc0581399e0d8218f7b7fb10961735a82b (patch)
treecc8ae99aadd6f0b845944b173aa3d7b3102e8686 /scripts/abilist.awk
parentcdedcc7943114bbbcbc2be1a0ef5716b0ef2e862 (diff)
downloadglibc-6e3d59bc0581399e0d8218f7b7fb10961735a82b.tar
glibc-6e3d59bc0581399e0d8218f7b7fb10961735a82b.tar.gz
glibc-6e3d59bc0581399e0d8218f7b7fb10961735a82b.tar.bz2
glibc-6e3d59bc0581399e0d8218f7b7fb10961735a82b.zip
* scripts/abilist.awk: New file.
* Makefile (distribute): Add it. * Makerules ($(objpfx)%.dynsym, $(objpfx)%.symlist): New rules. (tests): Depend on .symlist file for each $(install-lib.so-versioned). [! subdir] (tests): Depend on libc.symlist. (generated): Add those files. * aclocal.m4 (LIBC_PROG_BINUTILS): Check for objdump, set OBJDUMP. * configure: Regenerated. * config.make.in (OBJDUMP): New variable, substituted by configure. * malloc/mcheck.c (struct hdr): New members `block' and `magic2'. (mallochook, reallochook): Set them up. (checkhdr): Check HDR->magic2 value. (freehook): Reset HDR->magic2. (memalignhook): New static function. (old_memalign_hook): New static variable. (mcheck, reallochook): Set __memalign_hook to memalignhook.
Diffstat (limited to 'scripts/abilist.awk')
-rw-r--r--scripts/abilist.awk49
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/abilist.awk b/scripts/abilist.awk
new file mode 100644
index 0000000000..385e85da80
--- /dev/null
+++ b/scripts/abilist.awk
@@ -0,0 +1,49 @@
+# 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 { outpipe = "sort" }
+
+# Normalize columns.
+/^[0-9a-fA-F]+ / { sub(/ /, " - ") }
+
+# Skip undefineds.
+$4 == "*UND*" { next }
+
+# Skip locals.
+$2 == "l" { next }
+
+$2 == "g" || $2 == "w" && NF == 7 {
+ weak = ($2 == "w") ? "weak" : "strong";
+ type = $3;
+ size = strtonum("0x" $5);
+ version = $6;
+ symbol = $7;
+ gsub(/[()]/, "", version);
+
+ if (version == "GLIBC_PRIVATE") next;
+
+ if (type == "D" && $4 == ".tbss") {
+ print symbol, version, weak, "TLS", size | outpipe;
+ }
+ else if (type == "DO" && $4 == "*ABS*") {
+ print symbol, version, weak, "ABS" | outpipe;
+ }
+ else if (type == "DO") {
+ print symbol, version, weak, "DATA", size | outpipe;
+ }
+ else if (type == "DF") {
+ print symbol, version, weak, "FUNC" | outpipe;
+ }
+ else {
+ print symbol, version, weak, "UNEXPECTED", type, $4, $5;
+ }
+
+ next;
+}
+
+# Header crapola.
+NF == 0 || /DYNAMIC SYMBOL TABLE/ || /file format/ { next }
+
+{
+ print "Don't grok this line:", $0
+}