Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
ELFLS(1)		    General Commands Manual		      ELFLS(1)

NAME
       elfls - display the contents of an ELF file

SYNOPSIS
       elfls [OPTIONS] FILE ...

DESCRIPTION
       elfls examines an ELF file, reads the program header table and the sec-
       tion header table, and displays a synopsis of the contents.

OPTIONS
       -c, --sources
	      Include the listing of the source	files.

       -d, --dependencies
	      Include the listing of the program's dependencies.

       -i, --nostr
	      Don't treat small	entries	specially.  By	default,  program  and
	      section  header  entries whose referenced	contents are mainly or
	      entirely short, null-terminated strings  are  listed  by	simply
	      displaying  the  string  (namely	interpreter, comment, and note
	      sections). Use of	this option causes such	 entries  to  be  dis-
	      played the same as other entries.

       -p, --nopos
	      Suppress display of positions of entries within the file.

       -P, --nophdr
	      Suppress the listing of the program header table.

       -S, --noshdr
	      Suppress the listing of the section header table.

       -w, --width=N
	      Set the maximum width of the lines of the	output to N.  N	can be
	      zero to display each entry on a separate line, with  no  maximum
	      width.

       --help Display help and exit.

       --version
	      Display version information and exit.

PROGRAM	OUTPUT
       The output of the program, for each ELF file given on the command line,
       is as follows:

       file name
       dependencies
       source files
       program header table
       section header table

       The first line of the output shows the name of the file,	and the	archi-
       tecture	it was created for. The	file name will be suffixed with	an as-
       terisk *	if the file is a binary	executable, an ampersand _ if the file
       is  a  shared  library,	or a dollar sign $ if the file is a core file.
       Otherwise, the file is an object	file.  (This is	the only line that  is
       guaranteed to be	output.	The other information is not shown if the data
       is not applicable, not present in the file, or suppressed via the  com-
       mand-line options.)

       After  the  file	name is	shown the list of shared-object	libraries with
       which the file is dynamically linked, if	any.

       Next is shown the list of the source files which	were used to build the
       file, presuming this information	is available.

       The list	of entries in the program header table appears next. See below
       for a detailed description of the output. Binary	executables and	shared
       libraries always	contain	a program header table.

       Finally,	the entries in the section header table	are displayed. See be-
       low for a detailed description of the output. ELF files	almost	always
       contain a section header	table, although	they are only required for ob-
       ject files.

PROGRAM	HEADER TABLE
       The entries in the program header table are displayed in	following for-
       mat:

	   ind T rwx	pos  size address

       ind    The index	number of the entry in the program header table.

       T      A	letter indicating the entry's type. The	possible types are:

	 B    Binary  data:  machine language instructions or data used	by the
	      program proper.

	 P    The program header table.

	 D    The dynamic linking information section.

	 I    The interpreter specification. Typically,	this will be the path-
	      name of the dynamic linker.

	 N    A	note section, the details of which are unspecified.

	 U    Exception	frame stack data, used by the code to unwind stacks.

       rwx    Flags indicating memory permissions for the contents of this en-
	      try.  r indicates	that the contents are to be loaded into	 read-
	      able memory, w indicates that the	memory is to be	writeable, and
	      x	indicates that the memory is to	be executable. An s  can  also
	      appear  in the final position, which additionally	indicates that
	      this section contains the	program's starting point.

       pos    A	hexadecimal number indicating the position within the file  of
	      this entry's contents.

       size   A	 hexadecimal  number  indicating  the size of the entry's con-
	      tents.

       address
	      A	hexadecimal number indicating the memory address at  which  to
	      load this	entry's	contents.

       A  hexadecimal  number  at the end of the entry prefixed	with a + indi-
       cates by	how much the size of this entry	should	be  larger  in	memory
       than  it	is in the file (with the extra bytes at	the end	to be initial-
       ized to zeroes).

       Note that, unless --nostr is specified, interpreter and note entries in
       the  program  header  table are simply displayed	as a string indicating
       their contents.

SECTION	HEADER TABLE
       The entries in the section header table are displayed in	the  following
       format:

	   ind T rwx	pos  size name

       ind    The index	number of the entry in the section header table.

       T      A	letter indicating the entry's type. The	possible types are:

	 B    Program  data:  machine  language	 instructions or data that are
	      part of the program proper.

	 0    Zero-initialized program data: memory  is	 to  be	 allocated  as
	      usual  for  this	entry, but no data is present in the file. The
	      memory is	instead	initialized to all bits	zero.

	 S    A	table of the symbols used in the file.

	 $    A	string table.

	 H    A	hash table of symbols used for dynamic linking.

	 D    The dynamic linking information section.

	 P    A	procedure linking table.

	 O    The global offset	table.

	 I    The interpreter specification. Typically,	this will be the path-
	      name of the dynamic linker.

	 R    A	list of	relocation records.

	 V    A	section	specifying version dependencies	for the	program.

	 G    A	section	providing debug	information.

	 U    An exception header data section,	used when unwinding the	stack.

	 N    A	note section, the contents of which are	unspecified.

	 C    A	 comment section: auxiliary information, typically inserted by
	      the program that created the file.

       rwx    Flags indicating the memory usage	and permission for this	entry.
	      r	 indicates that	the contents are to be loaded into memory dur-
	      ing process execution, w indicates that the contents are	to  be
	      writeable	 during	 process  execution,  and x indicates that the
	      contents contain machine-executable instructions.

       pos    A	hexadecimal number indicating the position within the file  of
	      this entry's contents.

       size   A	 hexadecimal  number  indicating  the size of the entry's con-
	      tents.

       name   The name of this section.	If the section is a list of relocation
	      entries,	then the name will be suffixed with a colon and	a num-
	      ber, the number indicating the index of the section to which the
	      relocation  information  applies.	 Furthermore, several sections
	      types contain information	that refer to strings and/or  symbols,
	      which are	contained in a string table section and/or symbol hash
	      table section. Such sections will	have a number in square	brack-
	      ets  after  the name, indicating the index of this section. An S
	      in square	brackets appearing after the name of  a	 string	 table
	      section  indicates  the  string  table that contains the section
	      names.

       Note that, unless --nostr is specified, interpreter, comment  and  note
       entries	in  the	 program header	table are simply displayed as a	string
       indicating their	contents.

COPYRIGHT
       Copyright (C) 1999,2011 Brian Raiter _breadbox@muppetlabs.com_.

       License GPLv2+: GNU GPL version 2 or later. This	is free	software:  you
       are  free  to  change and redistribute it. There	is NO WARRANTY,	to the
       extent permitted	by law.

SEE ALSO
       objdump(1), readelf(1)

ELF kickers 3.0			   May 2011			      ELFLS(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | PROGRAM OUTPUT | PROGRAM HEADER TABLE | SECTION HEADER TABLE | COPYRIGHT | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=elfls&sektion=1&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help