scanelf
SYNOPSIS
scanelf [options] ELFs or directories
DESCRIPTION
scanelf is a user-space utility to quickly scan given ELFs,
directories, or common system paths for different information. This may
include ELF types, their PaX markings, TEXTRELs, etc...
OPTIONS
-A, --archives
Scan archives (.a files)
-a, --all
Print all useful/simple info
-B, --nobanner
Don't display the header
-b, --bind
Print symbol binding information (lazy or now)
-D, --endian
Print ELF endianness (big/little/...)
-E, --etype ETYPE
Print only ELF files matching specified etype (like ET_DYN,
ET_EXEC, etc...)
-e, --header
Print GNU_STACK markings
-F, --format FORMAT
Use specified format for output; see the FORMAT section for more
information
-f, --from FILE
Read input stream from specified filename
-g, --gmatch
Use strncmp to match libraries (use with -N). Or regexp with symbol
matching
-h, --help
Show condensed usage and exit
-I, --osabi
Print OSABI
-i, --interp
Print the interpreter information (.interp/PT_INTERP)
-k, --section SECTION
Find ELFs with the specified section
-N, --lib SONAME
Find ELFs that need the specified SONAME
-n, --needed
Print libraries the ELF is linked against (DT_NEEDED)
-O, --perms PERMS
Print only ELF files with matching specified octal bits (like 755)
-o, --file FILE
Write output stream to specified filename
-p, --path
Scan all directories in PATH environment
-q, --quiet
Only output 'bad' things
-R, --recursive
Scan directories recursively
-r, --rpath
Print runpaths encoded in the ELF (DT_RPATH/DT_RUNPATH)
-S, --soname
Print the ELF's shared library name (DT_SONAME)
-s, --symbol SYMBOL
Find the specified symbol; see SYMBOL MATCHING for more info
-T, --textrels
Locate cause of TEXTRELs via objdump
-t, --textrel
Print TEXTREL information
-V, --version
Print version and exit
-v, --verbose
Be verbose (can be used more than once)
-X, --fix
Try and 'fix' bad things (use with -r/-e)
-x, --pax
Print PaX markings
-Y, --eabi
Print EABI (only matters for a few architectures)
-y, --symlink
Don't scan symlinks
# scanelf -BF "file %f needs %n; funky time" /bin/bash
file bash needs libncurses.so.5,libdl.so.2,libc.so.6; funky time
Note that when you use a format string, generally information related
flags should be omitted. In other words, you do not want to try and
request NEEDED output (-n) and try to specify a format output at the
sametime as these operations are mutually exclusive. Each information
related flag has an equivalent conversion specifier, so use those
instead. You can of course continue to use non-information related
flags (such as --verbose).
There are three characters that introduce conversion specifiers.
o % - replace with info
o # - silent boolean match
o + - verbose match
And there are a number of conversion specifiers. We try to match up the
specifier with corresponding option.
o a - machine (EM) type
o b - bind flags
o e - program headers
o D - endian
o I - osabi
o Y - eabi
o F - long filename
o f - short filename
o i - interp
o k - section
o M - EI class
o N - specified needed
o n - needed libraries
o p - filename (minus search)
o o - etype
o O - perms
o r - runpaths
o S - SONAME
o s - symbol
o T - all textrels
o t - textrel status
o x - pax flags
SYMBOL MATCHING
A - prefix will only show undefined references while a + prefix will
only show defined references while no prefix will show both.
ELF ETYPES
You can narrow your search by specifying the ELF object file type
(ETYPE). The commandline option takes the numeric value and or symbolic
type. Multiple values can be passed comma separated. Example -E
ET_EXEC,ET_DYN,1
You can also narrow your search by specifying the ELF bitsize. Again,
specify the numeric value or the symbolic define.
o 32 - ELFCLASS32 - 32bit ELFs
o 64 - ELFCLASS64 - 64bit ELFs
HOMEPAGE
http://hardened.gentoo.org/pax-utils.xml
REPORTING BUGS
Please include as much information as possible (using any available
debugging options) and send bug reports to the maintainers (see the
AUTHORS section). Please use the Gentoo bugzilla at
http://bugs.gentoo.org/ if possible.
SEE ALSO
chpax(1), dumpelf(1), paxctl(1), pspax(1), readelf(1), scanelf(1)
AUTHORS
Ned Ludd <solar@gentoo.org>
Maintainer
Mike Frysinger <vapier@gentoo.org>
Maintainer
Fabian Groffen <grobian@gentoo.org>
Mach-O Maintainer
NOTES
1. http://hardened.gentoo.org/pax-utils.xml
2. http://bugs.gentoo.org/
pax-utils 0.2.3 03/03/2011 SCANELF(1)
Man Pages Copyright Respective Owners. Site Copyright (C) 1994 - 2018
Hurricane Electric.
All Rights Reserved.