objdump/nm

 1,objdump -h jprobe_example.o

jprobe_example.o:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         0000002a  00000000  00000000  00000040  2**4
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data         00000044  00000000  00000000  00000080  2**5
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  2 .bss          00000000  00000000  00000000  000000c4  2**2
                  ALLOC
  3 .rodata.str1.1 00000026  00000000  00000000  000000c4  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .exit.text    00000027  00000000  00000000  000000ea  2**0
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  5 .rodata.str1.4 00000096  00000000  00000000  00000114  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .init.text    0000004b  00000000  00000000  000001aa  2**0
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  7 .modinfo      0000000c  00000000  00000000  000001f5  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .comment      00000024  00000000  00000000  00000201  2**0
                  CONTENTS, READONLY
  9 .note.GNU-stack 00000000  00000000  00000000  00000225  2**0

 

2, objdump -t jprobe_example.o

jprobe_example.o:     file format elf32-i386

SYMBOL TABLE:
00000000 l    df *ABS*    00000000 jprobe_example.c
00000000 l    d  .text    00000000 .text
00000000 l    d  .data    00000000 .data
00000000 l    d  .bss    00000000 .bss
00000000 l    d  .rodata.str1.1    00000000 .rodata.str1.1
00000000 l    d  .exit.text    00000000 .exit.text
00000000 l     F .exit.text    00000027 jprobe_exit
00000000 l     O .data    00000044 my_jprobe
00000000 l    d  .rodata.str1.4    00000000 .rodata.str1.4
00000000 l     F .text    0000002a jdo_fork
00000000 l    d  .init.text    00000000 .init.text
00000000 l     F .init.text    0000004b jprobe_init
00000000 l    d  .modinfo    00000000 .modinfo
00000000 l     O .modinfo    0000000c __mod_license68
00000000 l    d  .note.GNU-stack    00000000 .note.GNU-stack
00000000 l    d  .comment    00000000 .comment
00000000         *UND*    00000000 unregister_jprobe
00000000         *UND*    00000000 printk
00000000         *UND*    00000000 jprobe_return
00000000         *UND*    00000000 register_jprobe
00000000 g     F .init.text    0000004b init_module
00000000 g     F .exit.text    00000027 cleanup_module

 

3,objdump -d jprobe_example.o

jprobe_example.o:     file format elf32-i386


Disassembly of section .text:

00000000 :
   0:    55                       push   %ebp
   1:    89 e5                    mov    %esp,%ebp
   3:    83 ec 10                 sub    $0x10,%esp
   6:    8b 55 08                 mov    0x8(%ebp),%edx
   9:    89 4c 24 0c              mov    %ecx,0xc(%esp)
   d:    89 44 24 04              mov    %eax,0x4(%esp)
  11:    c7 04 24 00 00 00 00     movl   $0x0,(%esp)
  18:    89 54 24 08              mov    %edx,0x8(%esp)
  1c:    e8 fc ff ff ff           call   1d
  21:    e8 fc ff ff ff           call   22
  26:    31 c0                    xor    %eax,%eax
  28:    c9                       leave 
  29:    c3                       ret   

Disassembly of section .exit.text:
...

 

objdump [-a|--archive-headers]
               [-b bfdname|--target=bfdname]
               [-C|--demangle[=style] ]
               [-d|--disassemble]
               [-D|--disassemble-all]
               [-z|--disassemble-zeroes]
               [-EB|-EL|--endian={big | little }]
               [-f|--file-headers]
               [-F|--file-offsets]
               [--file-start-context]
               [-g|--debugging]
               [-e|--debugging-tags]
               [-h|--section-headers|--headers]
               [-i|--info]
               [-j section|--section=section]
               [-l|--line-numbers]
               [-S|--source]
               [-m machine|--architecture=machine]
               [-M options|--disassembler-options=options]
               [-p|--private-headers]
               [-r|--reloc]
               [-R|--dynamic-reloc]
               [-s|--full-contents]
               [-W[lLiaprmfFsoR]|
                --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
               [-G|--stabs]
               [-t|--syms]
               [-T|--dynamic-syms]
               [-x|--all-headers]
               [-w|--wide]
               [--start-address=address]
               [--stop-address=address]
               [--prefix-addresses]
               [--[no-]show-raw-insn]
               [--adjust-vma=offset]
               [--special-syms]
               [--prefix=prefix]
               [--prefix-strip=level]
               [--insn-width=width]
               [-V|--version]
               [-H|--help]
               objfile...

 

4, nm jprobe_example.o
00000000 r __mod_license68
00000000 T cleanup_module
00000000 T init_module
00000000 t jdo_fork
00000000 t jprobe_exit
00000000 t jprobe_init
         U jprobe_return
00000000 d my_jprobe
         U printk
         U register_jprobe
         U unregister_jprobe

 

 nm [-a|--debug-syms]
          [-g|--extern-only][--plugin name]
          [-B] [-C|--demangle[=style]] [-D|--dynamic]
          [-S|--print-size] [-s|--print-armap]
          [-A|-o|--print-file-name][--special-syms]
          [-n|-v|--numeric-sort] [-p|--no-sort]
          [-r|--reverse-sort] [--size-sort] [-u|--undefined-only]
          [-t radix|--radix=radix] [-P|--portability]
          [--target=bfdname] [-fformat|--format=format]
          [--defined-only] [-l|--line-numbers] [--no-demangle]
          [-V|--version] [-X 32_64] [--help]  [objfile...]

 

 

你可能感兴趣的:(objdump/nm)