about summary refs log tree commit diff
path: root/Completion/Unix/Command/_elfdump
blob: b3cc77695111e61df50bb8fb6413e54a86d5da34 (plain) (blame)
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
46
47
48
#compdef elfdump

local -a args

args=(
  '-c[dump section header information]'
  '-d[dump .dynamic section]'
  '-e[dump file header]'
  '-G[dump .got (global offset table) section]'
  '-h[dump .hash section]'
  '-i[dump .interp (interpreter) section]'
  '-n[dump .note sections]'
  '(-w)-p[dump program headers]'
  '-r[dump relocation sections]'
  '-s[dump symbol table sections]'
  '(-p)-w[write contents of matched sections to file]:file:_files'
)

case $OSTYPE in
  solaris*)
    args+=(
      '-g[dump .group section]'
      '-H[dump .SUNW_cap (capabilities) section]'
      '-m[dump .SUNW_move section]'
      '-S[dump symbol table sections sorted according to symbol sort sections]'
      '-u[dump stack unwind/exceptions sections]'
      '-v[dump .SUNW_version (versioning) sections]'
      '-y[dump .SUNW_syminfo (symbol bindings) section]'
      '-I[match sections by index]:index or range'
      "-N[match sections by name]:section"
      '-T[match sections by type]:type'
      '-C[demangle C++ symbol names]'
      '-k[calculate ELF checksum]'
      '-l[show long section names without truncation]'
      '-O[specify osabi to apply]:osabi'
      '-P[use alternative section header]'
    )
  ;;
  freebsd*)
    args+=(
      '-a[dump all information]'
      '(-)-E[return success if file is an ELF file and failure if not]'
    )
  ;;
esac

_arguments -s $args \
  "*:elf file:_object_files"