summaryrefslogtreecommitdiff
path: root/scripts/objdump-func
blob: 7b15b873d0e2a2227ed3df72c16feb543a3f91f2 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Disassemble a single function.
#
# usage: objdump-func <file> <func> [<func> ...]

set -o errexit
set -o nounset

OBJDUMP="${CROSS_COMPILE:-}objdump"

command -v gawk >/dev/null 2>&1 || die "gawk isn't installed"

usage() {
	echo "usage: objdump-func <file> <func> [<func> ...]" >&2
	exit 1
}

[[ $# -lt 2 ]] && usage

OBJ=$1; shift
FUNCS=("$@")

${OBJDUMP} -wdr $OBJ | gawk -M -v _funcs="${FUNCS[*]}" '
	BEGIN { split(_funcs, funcs); }
	/^$/ { func_match=0; }
	/<.*>:/ {
		f = gensub(/.*<(.*)>:/, "\\1", 1);
		for (i in funcs) {
			# match compiler-added suffixes like ".cold", etc
			if (f ~ "^" funcs[i] "(\\..*)?") {
				func_match = 1;
				base = strtonum("0x" $1);
				break;
			}
		}
	}
	{
		if (func_match) {
			addr = strtonum("0x" $1);
			printf("%04x ", addr - base);
			print;
		}
	}'
/linux-2.6/xfs_linux.h?h=linux-6.12.y&id=ab4a9b04a33c97dd17495f943447f5a15ecf2b51'>[XFS] remove the sema_t from XFS.David Chinner 2008-08-13[XFS] kill vn_to_inodeChristoph Hellwig 2008-08-13[XFS] Kill shouty XFS_ITOV() macroDavid Chinner 2008-07-28[XFS] Pack some shortform dir2 structures for the ARM old ABIEric Sandeen 2008-07-28[XFS] XFS: ASCII case-insensitive supportBarry Naujok 2008-04-30[XFS] Include linux/random.h in all builds, not just debug.David Chinner 2008-04-29[XFS] Fix broken HAVE_SPLICE removal commit.Donald Douwsma 2008-04-18[XFS] Remove the xfs_refcacheDonald Douwsma 2008-02-07[XFS] Remove the BPCSHIFT and NB* based macros from XFS.Tim Shimmin 2008-02-07[XFS] Kill off xfs_statvfs.Christoph Hellwig 2008-02-07[XFS] Remove spin.hEric Sandeen 2007-10-16[XFS] call common xfs vfs-level helpers directly and remove vfs operationsChristoph Hellwig 2007-10-15[XFS] kill move.[ch]Christoph Hellwig 2007-10-15[XFS] move linux/log2.h header to xfs_linux.hEric Sandeen 2007-07-14[XFS] Concurrent Multi-File Data StreamsDavid Chinner 2007-07-10sendfile: remove .sendfile from filesystems that use generic_file_sendfile()Jens Axboe