summaryrefslogtreecommitdiffstats
path: root/buildtools/scripts/abi_gen.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:44:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:44:55 +0000
commitbfe2e03d5ecddce1b9666a58a57e66078a737ea1 (patch)
tree4a4130aca118d9aaaf1494e0e6a5015a0aa409b5 /buildtools/scripts/abi_gen.sh
parentInitial commit. (diff)
downloadtevent-bfe2e03d5ecddce1b9666a58a57e66078a737ea1.tar.xz
tevent-bfe2e03d5ecddce1b9666a58a57e66078a737ea1.zip
Adding upstream version 0.14.1.upstream/0.14.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'buildtools/scripts/abi_gen.sh')
-rwxr-xr-xbuildtools/scripts/abi_gen.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/buildtools/scripts/abi_gen.sh b/buildtools/scripts/abi_gen.sh
new file mode 100755
index 0000000..c66a1b8
--- /dev/null
+++ b/buildtools/scripts/abi_gen.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+# generate a set of ABI signatures from a shared library
+
+SHAREDLIB="$1"
+
+GDBSCRIPT="gdb_syms.$$"
+
+(
+ cat <<EOF
+set height 0
+set width 0
+EOF
+
+ # On older linker versions _init|_fini symbols are not hidden.
+ objdump --dynamic-syms "${SHAREDLIB}" |
+ awk '$0 !~ /.hidden/ {if ($2 == "g" && $3 ~ /D(F|O)/ && $4 ~ /(.bss|.rodata|.text)/) print $NF}' |
+ sort |
+ while read -r s; do
+ echo "echo $s: "
+ echo p "${s}"
+ done
+) >$GDBSCRIPT
+
+# forcing the terminal avoids a problem on Fedora12
+TERM=none gdb -n -batch -x $GDBSCRIPT "$SHAREDLIB" </dev/null
+rm -f $GDBSCRIPT