따라쟁이

avrgcc .elf 파일에서 각 심볼의 사이즈 알아보기 본문

AVR

avrgcc .elf 파일에서 각 심볼의 사이즈 알아보기

따라쟁이1 2015. 4. 6. 17:58

winavr을 설치하면 avr-nm 이라는 파일이 있다 

기본 Makefile에서는 심볼 주소만 나오지 사이즈는 주소로 추정해보야한다.

하지만 makefile을 수정하던지 커맨드라인에서 c:\>avr-nm -S xxxx.elf 라고 하게되면 

각변수별 바이트 사이즈를 알아볼수있어 편리하다.

어떤 변수가 메모리를 만이 차지하고 있는지 쉽게 알수있는 법이다.

--size-sort 를 같이 상하면 사이즈별로 소트되어화면에 프린트 된다.


Usage: avr-nm [option(s)] [file(s)]

 List symbols in [file(s)] (a.out by default).

 The options are:

  -a, --debug-syms       Display debugger-only symbols

  -A, --print-file-name  Print name of the input file before every symbol

  -B                     Same as --format=bsd

  -C, --demangle[=STYLE] Decode low-level symbol names into user-level names

                          The STYLE, if specified, can be `auto' (the default),

                          `gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java'

                          or `gnat'

      --no-demangle      Do not demangle low-level symbol names

  -D, --dynamic          Display dynamic symbols instead of normal symbols

      --defined-only     Display only defined symbols

  -e                     (ignored)

  -f, --format=FORMAT    Use the output format FORMAT.  FORMAT can be `bsd',

                           `sysv' or `posix'.  The default is `bsd'

  -g, --extern-only      Display only external symbols

  -l, --line-numbers     Use debugging information to find a filename and

                           line number for each symbol

  -n, --numeric-sort     Sort symbols numerically by address

  -o                     Same as -A

  -p, --no-sort          Do not sort the symbols

  -P, --portability      Same as --format=posix

  -r, --reverse-sort     Reverse the sense of the sort

  -S, --print-size       Print size of defined symbols

  -s, --print-armap      Include index for symbols from archive members

      --size-sort        Sort symbols by size

      --special-syms     Include special symbols in the output

      --synthetic        Display synthetic symbols as well

  -t, --radix=RADIX      Use RADIX for printing symbol values

      --target=BFDNAME   Specify the target object format as BFDNAME

  -u, --undefined-only   Display only undefined symbols

  -X 32_64               (ignored)

  @FILE                  Read options from FILE

  -h, --help             Display this information

  -V, --version          Display this program's version number


avr-nm: supported targets: elf32-avr coff-avr coff-ext-avr elf32-little elf32-bi

g srec symbolsrec tekhex binary ihex

Report bugs to <URL:http://sourceforge.net/tracker/?atid=520074@report_bugs_to@g

roup_id=68108@report_bugs_to@func=browse>.


'AVR' 카테고리의 다른 글

AVR(ATMEL) 가용메모리 알아보는법과 기타  (0) 2015.04.06