카테고리 없음2025. 12. 28. 11:49


objdump -x vmlinux | grep show_interrupts -A 10

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           AArch64
  Version:                           0x1
  Entry point address:               0xffffffc080000000
  Start of program headers:          64 (bytes into file)
  Start of section headers:          35974344 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         4
  Size of section headers:           64 (bytes)
  Number of section headers:         38
  Section header string table index: 37


readelf -h vmlinux

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           AArch64
  Version:                           0x1
  Entry point address:               0xffffffc080000000
  Start of program headers:          64 (bytes into file)
  Start of section headers:          35974344 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         4
  Size of section headers:           64 (bytes)
  Number of section headers:         38
  Section header string table index: 37


#특정 심볼의 주소 찾기
vi System.map
echo ffffffc0801319a8 //show_interrupts의 심볼 및 start/end address 검색



#특정함수의 어셈블리 보기
aarch64-linux-gnu-objdump --start-address=0xffffffc0801319a8 --stop-address=0xffffffc080131d38 -d vmlinux

 

vmlinux:     file format elf64-littleaarch64


Disassembly of section .text:

ffffffc0801319a8 <show_interrupts>:
ffffffc0801319a8:       d503201f        nop
ffffffc0801319ac:       d503201f        nop
ffffffc0801319b0:       d503233f        paciasp
ffffffc0801319b4:       a9bb7bfd        stp     x29, x30, [sp, #-80]!
ffffffc0801319b8:       9000bba2        adrp    x2, ffffffc0818a5000 <_printk_rb_static_descs+0x17b10>
ffffffc0801319bc:       910003fd        mov     x29, sp
ffffffc0801319c0:       a9025bf5        stp     x21, x22, [sp, #32]
ffffffc0801319c4:       b9492844        ldr     w4, [x2, #2344]
ffffffc0801319c8:       f9400035        ldr     x21, [x1]
ffffffc0801319cc:       6b15009f        cmp     w4, w21
ffffffc0801319d0:       5400156b        b.lt    ffffffc080131c7c <show_interrupts+0x2d4>  // b.tstop
ffffffc0801319d4:       540015e0        b.eq    ffffffc080131c90 <show_interrupts+0x2e8>  // b.none
ffffffc0801319d8:       a90153f3        stp     x19, x20, [sp, #16]
ffffffc0801319dc:       aa0003f3        mov     x19, x0
ffffffc0801319e0:       35000615        cbnz    w21, ffffffc080131aa0 <show_interrupts+0xf8>
ffffffc0801319e4:       a90363f7        stp     x23, x24, [sp, #48]
ffffffc0801319e8:       52800082        mov     w2, #0x4                        // #4
ffffffc0801319ec:       52807d01        mov     w1, #0x3e8                      // #1000
ffffffc0801319f0:       710f9c9f        cmp     w4, #0x3e7
ffffffc0801319f4:       5400164d        b.le    ffffffc080131cbc <show_interrupts+0x314>
ffffffc0801319f8:       0b010821        add     w1, w1, w1, lsl #2
ffffffc0801319fc:       2a0203e3        mov     w3, w2
Posted by easy16