アーカイブ・ファイル(ライブラリ)のダンプ

AVR32 StudioでAVR32 C Project from templateからStandalone版のアプリケーションを指定すると、以下のライブラリがソースに追加される。

src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr1-speed_opt.a

ロード・モジュール(.elf)やオブジェクトファイル(.o)はELFフォーマットなので、該当ファイルのアイコンをダブル・クリックすれば、AVR32 Studioが自動的にリストを表示してくれる。
しかし、ライブラリ・ファイルはアーカイブ・ファイル(.a)であり、ELFファイルの集まりなので、ダブル・クリックしても同様に表示してくれない(バイナリをテキストとして無理矢理表示してくれる...)。



ELFファイルからシンボルや逆アセンブル・リストを取り出すのはコマンドavr32-objdumpであるが、これ自身はアーカイブ・ファイルが対象でも動作する。想像だが、AVR32 Studioがファイル拡張子".a"を認識していないようだ。.elfや.oと同じように扱うよう設定すればいいのだろうが、残念ながらeclipseやCDTに詳しくないので、さっさと断念した。
代わりにテキスト・ファイルにダンプして、そちらを参照することにする。Windowsならコマンドプロンプトから以下のようにコマンドを実行する。

"%AVR32_HOME%\bin\avr32-objdump" -x -d 対象アーカイブ・ファイル・パス > 出力テキスト・ファイル・パス

何をどのようにダンプするかオプションで指定する。「-x -d」やその他のオプションは以下参照(--helpによる出力から抜粋)。

sort option long option Meaning
-a --archive-headers Display archive header information
-f --file-headers Display the contents of the overall file header
-p --private-headers Display object format specific file header contents
-h --[section-]headers Display the contents of the section headers
-x --all-headers Display the contents of all headers
-d --disassemble Display assembler contents of executable sections
-D --disassemble-all Display assembler contents of all sections
-S --source Intermix source code with disassembly
-s --full-contents Display the full contents of all sections requested
-g --debugging Display debug information in object file
-e --debugging-tags Display debug information using ctags style
-G --stabs Display (in raw form) any STABS info in the file
-W --dwarf Display DWARF info in the file
-t --syms Display the contents of the symbol table(s)
-T --dynamic-syms Display the contents of the dynamic symbol table
-r --reloc Display the relocation entries in the file
-R --dynamic-reloc Display the dynamic relocation entries in the file
  @ Read options from
-v --version Display this program's version number
-i --info List object formats and architectures supported
-H --help Display this information