简体   繁体   中英

what is the start point to disassemble MIPS architecture(isa32r2)'s library?

I use some third-party libraries in a project. This project is a embedded system with a MIPS(isa32r2) core. Recently we found a bug in the third-party library(libusb.a), but because of the time there is no technical support anymore. so I try to disassemble the libarary.

$ mips-sde-elf-ar -x libusb.a
$ mips-sde-elf-objdump.exe -Ds -mmips:isa32r2 -EL usbhost_func.o > usbhost_func.s

in file usbhost_func.s I can get some info like:

Disassembly of section .text.usbhost_init:

    00000000 :
       0:   27bdffd8    addiu   sp,sp,-40
       4:   3c020000    lui v0,0x0

looks like a complete disassembly functions of . 看起来像 的完整反汇编函数。 but there is some other info here like:

Disassembly of section .pdr:

    00000000 :
       0:   00000000    nop
       4:   40000000    mfc0    zero,c0_index
       8:   fffffffc    sdc3    $31,-4(ra)
        ...        
      14:   00000008    jr  zero
      18:   0000001e    0x1e
      1c:   0000001f    0x1f
      20:   00000000    nop


    Disassembly of section .gnu.attributes:

    00000000 :
       0:   00000f41    0xf41
       4:   756e6700    jalx    5b99c00 
       8:   00070100    sll zero,a3,0x4
       c:   03040000    0x3040000

so my question is:

  1. What does the secton's mean like ?
  2. Why there is some in ?
  3. What is the srart point to disassemble a mips library?
    Any hint and info are welcome.Tks.
  1. objdump -D will try to deassemble all sections instead of sections which include valid instructions, you should use objdump -d .

  2. .pdr is a debug information section, may not include valid instructions.

  3. For static libraries (.a files), you should extract the object files in these libraries by ar x libfoo.a , and try to deassemble those object files you got by objdump -d .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM