File: abi_gen.sh

package info (click to toggle)
tevent 0.14.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,836 kB
  • sloc: python: 35,616; ansic: 26,167; xml: 812; sh: 228; makefile: 157
file content (26 lines) | stat: -rwxr-xr-x 579 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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