最終更新:2019-09-17 (火) 08:36:26 (30d)  

objdump -t はてなブックマークを見る
Top / objdump -t

Display the contents of the symbol table(s)

Linux/シンボル

  • $ objdump -t a.out 
    
    a.out:     file format elf64-x86-64
    
    SYMBOL TABLE:
    0000000000400238 l    d  .interp	0000000000000000              .interp
    0000000000400254 l    d  .note.ABI-tag	0000000000000000              .note.ABI-tag
    0000000000400274 l    d  .note.gnu.build-id	0000000000000000              .note.gnu.build-id
    0000000000400298 l    d  .gnu.hash	0000000000000000              .gnu.hash
    00000000004002b8 l    d  .dynsym	0000000000000000              .dynsym
    0000000000400318 l    d  .dynstr	0000000000000000              .dynstr
    0000000000400356 l    d  .gnu.version	0000000000000000              .gnu.version
    0000000000400360 l    d  .gnu.version_r	0000000000000000              .gnu.version_r
    0000000000400380 l    d  .rela.dyn	0000000000000000              .rela.dyn
    0000000000400398 l    d  .rela.plt	0000000000000000              .rela.plt
    00000000004003c8 l    d  .init	0000000000000000              .init
    00000000004003f0 l    d  .plt	0000000000000000              .plt
    0000000000400420 l    d  .plt.got	0000000000000000              .plt.got
    0000000000400430 l    d  .text	0000000000000000              .text
    00000000004005f4 l    d  .fini	0000000000000000              .fini
    0000000000400600 l    d  .rodata	0000000000000000              .rodata
    0000000000400630 l    d  .eh_frame_hdr	0000000000000000              .eh_frame_hdr
    0000000000400678 l    d  .eh_frame	0000000000000000              .eh_frame
    0000000000600e10 l    d  .init_array	0000000000000000              .init_array
    0000000000600e18 l    d  .fini_array	0000000000000000              .fini_array
    0000000000600e20 l    d  .jcr	0000000000000000              .jcr
    0000000000600e28 l    d  .dynamic	0000000000000000              .dynamic
    0000000000600ff8 l    d  .got	0000000000000000              .got
    0000000000601000 l    d  .got.plt	0000000000000000              .got.plt
    0000000000601028 l    d  .data	0000000000000000              .data
    0000000000601038 l    d  .bss	0000000000000000              .bss
    0000000000000000 l    d  .comment	0000000000000000              .comment
    0000000000000000 l    df *ABS*	0000000000000000              crtstuff.c
    0000000000600e20 l     O .jcr	0000000000000000              __JCR_LIST__
    0000000000400460 l     F .text	0000000000000000              deregister_tm_clones
    00000000004004a0 l     F .text	0000000000000000              register_tm_clones
    00000000004004e0 l     F .text	0000000000000000              __do_global_dtors_aux
    0000000000601038 l     O .bss	0000000000000001              completed.7594
    0000000000600e18 l     O .fini_array	0000000000000000              __do_global_dtors_aux_fini_array_entry
    0000000000400500 l     F .text	0000000000000000              frame_dummy
    0000000000600e10 l     O .init_array	0000000000000000              __frame_dummy_init_array_entry
    0000000000000000 l    df *ABS*	0000000000000000              hello.c
    0000000000400537 l     F .text	0000000000000011              statichoge
    0000000000000000 l    df *ABS*	0000000000000000              crtstuff.c
    00000000004007a8 l     O .eh_frame	0000000000000000              __FRAME_END__
    0000000000600e20 l     O .jcr	0000000000000000              __JCR_END__
    0000000000000000 l    df *ABS*	0000000000000000              
    0000000000600e18 l       .init_array	0000000000000000              __init_array_end
    0000000000600e28 l     O .dynamic	0000000000000000              _DYNAMIC
    0000000000600e10 l       .init_array	0000000000000000              __init_array_start
    0000000000400630 l       .eh_frame_hdr	0000000000000000              __GNU_EH_FRAME_HDR
    0000000000601000 l     O .got.plt	0000000000000000              _GLOBAL_OFFSET_TABLE_
    00000000004005f0 g     F .text	0000000000000002              __libc_csu_fini
    0000000000000000  w      *UND*	0000000000000000              _ITM_deregisterTMCloneTable
    0000000000601028  w      .data	0000000000000000              data_start
    0000000000000000       F *UND*	0000000000000000              puts@@GLIBC_2.2.5
    0000000000601038 g       .data	0000000000000000              _edata
    00000000004005f4 g     F .fini	0000000000000000              _fini
    0000000000000000       F *UND*	0000000000000000              __libc_start_main@@GLIBC_2.2.5
    0000000000601028 g       .data	0000000000000000              __data_start
    0000000000000000  w      *UND*	0000000000000000              __gmon_start__
    0000000000601030 g     O .data	0000000000000000              .hidden __dso_handle
    0000000000400600 g     O .rodata	0000000000000004              _IO_stdin_used
    0000000000400580 g     F .text	0000000000000065              __libc_csu_init
    0000000000601040 g       .bss	0000000000000000              _end
    0000000000400430 g     F .text	000000000000002a              _start
    0000000000601038 g       .bss	0000000000000000              __bss_start
    0000000000400548 g     F .text	0000000000000034              main
    0000000000400526 g     F .text	0000000000000011              hoge
    0000000000000000  w      *UND*	0000000000000000              _Jv_RegisterClasses
    0000000000601038 g     O .data	0000000000000000              .hidden __TMC_END__
    0000000000000000  w      *UND*	0000000000000000              _ITM_registerTMCloneTable
    00000000004003c8 g     F .init	0000000000000000              _init
    

凡例

  •        -t
           --syms
               Print the symbol table entries of the file.  This is similar to the information provided by the nm program, although the display format is different.  The
               format of the output depends upon the format of the file being dumped, but there are two main types.  One looks like this:
    
                       [  4](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .bss
                       [  6](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 fred
    
               where the number inside the square brackets is the number of the entry in the symbol table, the sec number is the section number, the fl value are the
               symbol's flag bits, the ty number is the symbol's type, the scl number is the symbol's storage class and the nx value is the number of auxilary entries
               associated with the symbol.  The last two fields are the symbol's value and its name.
    
               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.
    
               The flag characters are divided into 7 groups as follows:
    
               "l"
               "g"
               "u"
               "!" The symbol is a local (l), global (g), unique global (u), neither global nor local (a space) or both global and local (!).  A symbol can be neither
                   local or global for a variety of reasons, e.g., because it is used for debugging, but it is probably an indication of a bug if it is ever both local
                   and global.  Unique global symbols are a GNU extension to the standard set of ELF symbol bindings.  For such a symbol the dynamic linker will make sure
                   that in the entire process there is just one symbol with this name and type in use.
    
               "w" The symbol is weak (w) or strong (a space).
    
               "C" The symbol denotes a constructor (C) or an ordinary symbol (a space).
    
               "W" The symbol is a warning (W) or a normal symbol (a space).  A warning symbol's name is a message to be displayed if the symbol following the warning
                   symbol is ever referenced.
    
               "I"
               "i" The symbol is an indirect reference to another symbol (I), a function to be evaluated during reloc processing (i) or a normal symbol (a space).
    
               "d"
               "D" The symbol is a debugging symbol (d) or a dynamic symbol (D) or a normal symbol (a space).
    
               "F"
               "f"
               "O" The symbol is the name of a function (F) or a file (f) or an object (O) or just a normal symbol (a space).