75
SYMBOL TABLE:
0000000000000000  w      *UND*  0000000000000000              __gmon_start__

I've man objdump but there's no such info.

Anyone know what the 5 columns mean?

Je Rog
  • 5,675
  • 8
  • 39
  • 47

5 Answers5

102

COLUMN ONE: the symbol's value

COLUMN TWO: a set of characters and spaces indicating the flag bits that are set on the symbol. There are seven groupings which are listed below:

group one: (l,g,,!) local, global, neither, both.

group two: (w,) weak or strong symbol.

group three: (C,) symbol denotes a constructor or an ordinary symbol.

group four: (W,) symbol is warning or normal symbol.

group five: (I,) indirect reference to another symbol or normal symbol.

group six: (d,D,) debugging symbol, dynamic symbol or normal symbol.

group seven: (F,f,O,) symbol is the name of function, file, object or normal symbol.

COLUMN THREE: the section in which the symbol lives, ABS means not associated with a certain section

COLUMN FOUR: the symbol's size or alignment.

COLUMN FIVE: the symbol's name.

If you want additional information try you man page ;-) or the following links: https://manpages.ubuntu.com/manpages/kinetic/en/man1/objdump.1.html and https://sourceware.org/binutils/docs/binutils/objdump.html

AJM
  • 1,317
  • 2
  • 15
  • 30
red-E
  • 1,304
  • 1
  • 10
  • 10
  • 2
    Just wondering, for the COLUMN FOUR, what is the size usually expressed as? Are we looking at bytes or bits? – Zhouster Sep 09 '14 at 05:35
  • @Zhouster, In order to accelerate the speed of symbol table loading, I think it is 4-bytes alignment for 32-bits system. – gzh Mar 28 '17 at 07:26
  • @Zhouster. Bytes, always bytes. – antred Mar 08 '20 at 16:55
  • Links in answer now redirect to https://manpages.ubuntu.com/manpages/kinetic/en/man1/objdump.1.html and https://sourceware.org/binutils/docs/binutils/objdump.html - I'll edit to update them later, but the edit queue is full right now. – AJM Jul 27 '22 at 09:10
  • Re my above comment - the queue's not full so I've just submitted that edit. – AJM Sep 05 '22 at 15:24
10

Since none of the previous answers seem to be correct, here's what you are actually looking for:

Here's a snippet from this link that might help:

"The other common output format, usually seen with ELF based files, looks like this:

      00000000 l    d  .bss   00000000 .bss
      00000000 g       .text  00000000 fred

Here the first number is the symbol's value (sometimes refered to as its address). The next field is actually a set of characters and spaces indicating the flag bits that are set on the symbol. These characters are described below. Next is the section with which the symbol is associated or ABS if the section is absolute (ie not connected with any section), or UND if the section is referenced in the file being dumped, but not defined there.

After the section name comes another field, a number, which for common symbols is the alignment and for other symbol is the size. Finally the symbol's name is displayed."

Scranton
  • 339
  • 4
  • 14
7

objdump -t prints the symbol table entries of the file.
The output is similar to the information provided by the nm program.

There are 7 columns in the output:

  • value
  • class
  • type
  • size
  • line
  • section
  • symbol-name

(some columns may be empty for some entries)

objdump prints the symbol-name in left-most column.
nm prints the symbol-name in the right-most column.

TheCodeArtist
  • 21,479
  • 4
  • 69
  • 130
  • "(some columns may be empty for some entries)" That sucks HARD. How did they imagine one could easily parse the symbol table if one can't even be sure if a certain column even has a value, and there is no delimiter character either? :-(( – antred Mar 06 '20 at 16:38
  • Found a way, using this reqex: ^((?xi)[a-f0-9]+)\s+([lgu\!])([w ])([C ])([W ])([Ii ])([dD ])([FfO ])\s+(\S+)\s+((?xi)[a-f0-9]+)\s+(\S+)$ – antred Mar 08 '20 at 17:43
4

http://www.cs.swarthmore.edu/~newhall/unixhelp/compilecycle.html#runtime

$ nm --format sysv simple   # system V format is easier to read than bsd format which is the default

Name                  Value   Class        Type         Size     Line  Section

...
foo                 |080484e6|   T  |              FUNC|0000000c|     |.text
Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
Pragya
  • 61
  • 1
0

From description of option -t in man pages of objdump from man7.org, the format is explained as follows:

The other common output format, usually seen with ELF based files, looks like this:

              00000000 l    d  .bss   00000000 .bss
              00000000 g       .text  00000000 fred
  • Here the first number is the symbol's value (sometimes refered to as its address).
  • The next field is actually a set of characters and spaces indicating the flag bits that are set on the symbol.These characters are described below.
  • Next is the section with which the symbol is associated or *ABS* if the section is absolute (ie not connected with any section), or *UND* if the section is referenced in the file being dumped, but not defined there.
  • After the section name comes another field, a number, which for common symbols is the alignment and for other symbol is the size. Finally the symbol's name is displayed.

You can visit above site for a more detail description.

Jack Wilsdon
  • 6,706
  • 11
  • 44
  • 87
jiaxl
  • 81
  • 1
  • 6