add wrapasm: i386 tracer using tail call from asm
[ldtrace] / genasm.sh
diff --git a/genasm.sh b/genasm.sh
new file mode 100755 (executable)
index 0000000..95112e1
--- /dev/null
+++ b/genasm.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+awk '
+/dlsym/ {next}
+/__syscall/ {next}
+{
+       a[++n] = $1
+       print ".global " $1
+       print ".type " $1 ",@function"
+       print $1 ":"
+       print " pushl $sym_" $1
+       print " call wrap_help"
+       print " pop %ecx"
+       print " jmp *%eax"
+}
+END{
+       print ".section .rodata"
+       for (i=1;i<=n;i++) {
+               print "sym_" a[i] ":"
+               print " .string \"" a[i] "\""
+       }
+}'