본문 바로가기

Programming/Linux_Kernel

readelf - 섹션 위치 한눈에 보기


readelf 에는 다음과 같은 기능이 있습니다.
elf의 각 섹션들을 나열해 주고 크기와 속성을 보여줍니다.

> readelf -l core.1455

Elf file type is CORE (Core file)
Entry point 0x0
There are 79 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  NOTE           0x000a14 0x00000000 0x00000000 0x001dc 0x00000     0
  LOAD           0x001000 0x2a000000 0x00000000 0x4d000 0x4d000 R E 0x1000
  LOAD           0x04e000 0x2a055000 0x00000000 0x01000 0x01000 R   0x1000
  LOAD           0x04f000 0x2a056000 0x00000000 0x01000 0x01000 RW  0x1000
  LOAD           0x050000 0x2a057000 0x00000000 0x148000 0x148000 RW  0x1000
  LOAD           0x198000 0x40000000 0x00000000 0x01000 0x1c000 R E 0x1000
  LOAD           0x199000 0x4001c000 0x00000000 0x05000 0x05000 RW  0x1000
  LOAD           0x19e000 0x40022000 0x00000000 0x01000 0x01000 RW  0x1000
  LOAD           0x19f000 0x40023000 0x00000000 0x01000 0x01000 R   0x1000
  LOAD           0x1a0000 0x40024000 0x00000000 0x01000 0x01000 RW  0x1000
  LOAD           0x1a1000 0x40025000 0x00000000 0x01000 0x04000 R E 0x1000

참고로..

RE(x) 는 code
RW 는 data
R 은 전역 변수

영역 이겠지요?