avr-objdump is very useful, but sometimes it's necessary to see information about the link that can only be generated by the linker. A map file contains this information. A map file is useful for monitoring the sizes of your code and data. It also shows where modules are loaded and which modules were loaded from libraries. It is yet another view of your application. To get a map file, I usually add -Wl,-Map,demo.map to my link command. Relink the application using the following command to generate demo.map (a portion of which is shown in Example 2-3.
% avr-gcc -g -mmcu=at90s2313 -Wl,-Map,demo.map -o demo.out demo.o
Some points of interest in the map file are:
Example 2-3. Portion of demo map file
.text 0x00000000 0xec *(.init) .init 0x00000000 0x16 /usr/local/avr/lib/crts2313.o *(.progmem.gcc*) *(.progmem*) 0x00000016 .=ALIGN(0x2) *(.text) .text 0x00000016 0x34 /usr/local/avr/lib/crts2313.o 0x00000046 _interrupt1_ 0x00000046 _uart_trans_ 0x00000046 _overflow0_ 0x00000016 _init_ 0x00000046 _uart_data_ 0x00000046 _uart_recv_ 0x00000048 _unexpected_ 0x00000046 _comparator_ 0x00000046 _interrupt0_ 0x00000046 _output_compare1a_ 0x00000046 _input_capture1_ 0x00000016 _real_init_ .text 0x0000004a 0xa2 demo.o 0x0000004a _overflow1_ 0x000000c2 ioinit 0x000000de main 0x000000ec .=ALIGN(0x2) *(.text.*) 0x000000ec .=ALIGN(0x2) *(.fini) 0x000000ec _etext=. .data 0x00800060 0x0 load address 0x000000ec 0x00800060 PROVIDE (__data_start, .) *(.data) *(.gnu.linkonce.d*) 0x00800060 .=ALIGN(0x2) 0x00800060 _edata=. .bss 0x00800060 0x4 0x00800060 PROVIDE (__bss_start, .) *(.bss) .bss 0x00800060 0x2 demo.o *(COMMON) COMMON 0x00800062 0x2 demo.o 0x0 (size before relaxing) 0x00800062 direction 0x00800064 PROVIDE (__bss_end, .) 0x00800064 _end=. .eeprom 0x00810000 0x0 load address 0x000000ec *(.eeprom*) 0x00810000 __eeprom_end=.