PROGRAMMING

objdump 본문

OS/Linux

objdump

Raccoon2125 2022. 5. 25. 21:49

[ Synopsis ]

objdump [option] objfile...

 

[ Option ]

-b bfdname (--target=bfdname) : object code 형식을 bfdname으로 지정. → "binary"

-d (--disassemble) : 오브젝트 파일의 기계어를 어셈블러로 확인할 수 있도록 disassemble화

-D (--disassemble-all) : 모든 section의 내용을 disassemble화 → 무엇을 실행하려는지 확인 가능.

--[no-]show-raw-insn : 코드의 바이트열(=주소) 출력(no = 제거 후 출력)

--prefix-address : 코드의 주소를 심볼의 상대주소로 표시

-h (--section-headers, --headers) : 목적 파일의 section header로부터 함축 정보 표시.

-i (--info) : 전체 아키텍쳐 및 object format 리스트 표시.

-j name (--section=name) : name section의 정보만 표시

-l (--line-numbers) : 파일과 소스 라인숫자를 display.


-s (--full-contents) : 모든 section의 전체 내용 표시. (ex. objdump -s /bin/ls)

                          ※ 덤프 형식: [메모리 주소] [16진수 덤프 (4바이트 * 4)] [ASCII 표시]


-t (--syms) : 파일의 symbol table entries 표시. ※ (equals to) readelf --symbols exefile

-t FORMAT (1)
[  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

[ NUM] : the number of the entry in the symbol table
(sec NUM) : the number of section
(fl  0xNUM) : fl value are the symbol's flag bits
(ty  NUM) : the symbol's type
(scl  NUM) : symbol's storage class
(nx  NUM) : the number of auxilary entries associated with the symbol
- last two fields
1) the symbol's value
2) the symbol's name
-t FORMAT (2) ELF
00000000 l    d  .bss   00000000 .bss
00000000 g       .text  00000000 fred

first number : the symbol's value (sometimes refered to as its address)
next field : a set of characters and spaces indicating the flag bits that are set of the symbol.
flag character's 7 flag groups
  "l"(local), "g"(global), "u"(unique), "!"(neither global nor local)
  "w"(weak)
  "C"(constructor)
  "W"(warning)
  "I" (indirect ref to another symbol), "i" (function to be evaluated during reloc processing)
  "d"(debugging), "D"(dynamic)
  "F"(function), "f"(file)", "O"(object)

-x (--all-headers) : 헤더 정보, 심볼 테이블, 재배치 엔트리 전체를 표시함. -a -f -h -p -r -t와 같은 명령어.

[--start-address=address] [--stop-address=address] : dump 주소 범위 지정.

 

'OS > Linux' 카테고리의 다른 글

ssh  (0) 2022.05.28
Linux Directory Structure  (0) 2022.05.28
hexdump  (0) 2022.05.26
Comments