13.2 Contents

The map files produced by the linker consist of the following items.

Table 13-1. Linker Map File Contents
Item Description
Tool Name and Command Path and executable name of the linker, as well as command line options used.
Archive Members The name of any members from archive files that are included in the link.
Memory Usage Report The starting address and length of all output sections in program memory, data memory and dynamic memory.
External Symbol Tables All external symbols in data and program memory.
Memory Configuration All of the memory regions defined for the link.
Linker Script and Memory Map Modules, sections and symbols that are included in the link as specified in the linker script.

Map File

The following is an example of a linker map file for the MPLAB Discover project “DPSK3 Synchronous Buck Converter Voltage Mode Control.” Note that sections have been shortened to save space. The character “:” represents lines removed.

Tool Name and Command

Microchip Technology Inc, v3.00 (B)

Tool Name:
  c:\program files\microchip\xc-dsc\v3.00\bin\bin\..\bin/elf-ld.exe

Command:
  -p33CK256MP505 \
  --mdfp=C:/Users/User/.mchp_packs/Microchip/dsPIC33CK-MP_DFP/1.5.135/xc-dsc \
  -o \
  dist/dpsk3_buck_vmc/production/dpsk_buck_vmc.X.production.elf \
  -Lc:/program files/microchip/xc-dsc/v3.00/bin/bin/.. \
  -LC:/Users/c08227/.mchp_packs/Microchip/dsPIC33CK-MP_DFP/1.5.135/xc-dsc/bin/../support/dsPIC33C/gld \
  -Lc:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib \
  -Lc:/program files/microchip/xc-dsc/v3.00/bin/bin/../../support/dsPIC30F/gld \
  -Lc:/program files/microchip/xc-dsc/v3.00/bin/bin/../../support/dsPIC33C/gld \
  -Lc:/program files/microchip/xc-dsc/v3.00/bin/bin/../../support/dsPIC33E/gld \
  -Lc:/program files/microchip/xc-dsc/v3.00/bin/bin/../../support/dsPIC33F/gld \
  build/dpsk3_buck_vmc/production/sources/common/p33c_pral/p33c_pwm.o \
  build/dpsk3_buck_vmc/production/sources/common/p33c_pral/p33c_gpio.o \
  build/dpsk3_buck_vmc/production/sources/common/p33c_pral/p33c_dsp.o \
    :
  build/dpsk3_buck_vmc/production/sources/push_button/app_push_button.o \
  build/dpsk3_buck_vmc/production/sources/push_button/drivers/drv_push_button.o \
  build/dpsk3_buck_vmc/production/sources/main.o \
  --local-stack \
  --preserve-all \
  --defsym=__MPLAB_BUILD=1 \
  -Tp33CK256MP505.gld.00 \
  --stack=16 \
  --check-sections \
  --data-init \
  --pack-data \
  --handles \
  --isr \
  --gc-sections \
  --fill-upper=0 \
  --stackguard=16 \
  --no-force-link \
  --smart-io \
  -Map=dist/dpsk3_buck_vmc/production/dpsk_buck_vmc.X.production.map \
  --report-mem \
  --memorysummary \
  dist/dpsk3_buck_vmc/production/memoryfile.xml \
  -start-group \
  --library=c99-pic30-elf \
  --library=m-elf \
  --library=c99-elf \
  -end-group \


Optional library libp33CK256MP505.a not found

Archive Members

Archive member included because of file (symbol)

c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(crt0_extendedch.o)
                              (__resetPRI)
c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(data_init_extendedch.o)
                              c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(crt0_extendedch.o) (__data_init_extended)
c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(crt_start_mode_normalch.Meo)
                              (__crt_start_mode_normal)
                                :
                              c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(fixdfsi.CH_o) (__dunpack2exit)
c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(dpropagateNaN.CH_o)
                              c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(dunpack2.CH_o) (__dPropagateNaN)
c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libm-elf.a(floorl.CH_o)
                              c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-elf.a(__fmt_fp.CH_o) (_floorl)

Memory Usage Report

Selected CodeGuard Options:
  FSEC:BWRP:OFF
  FSEC:BSS:DISABLED
  FSEC:BSEN:OFF
  FSEC:GWRP:OFF
  FSEC:GSS:DISABLED
  FSEC:CWRP:OFF
  FSEC:CSS:DISABLED
  FSEC:AIVTDIS:OFF

CodeGuard FLASH Memory:
  boot    (none)
  secure  (none)
  general 0x200 to 0x2befe

CodeGuard RAM Memory:
  general 0x1000 to 0x6fff
  secure  (none)
  boot    (none)


xc-dsc-ld 3.00 (B)

Default Code Model: Small
Default Data Model: Large
Default Scalar Model: Small

"program" Memory  [Origin = 0x200, Length = 0x2bd00]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200              0x2240          0x3360  (13152)
.const                      0x2440                0xe0           0x150  (336)
.text                       0x2520              0x2928          0x3dbc  (15804)
.dinit                      0x4e48               0x1a0           0x270  (624)
.text                       0x4fe8               0xdec          0x14e2  (5346)
.init.delay32               0x5dd4                0x1c            0x2a  (42)
.text                       0x5df0                0x14            0x1e  (30)

                 Total "program" memory used (bytes):         0x8a06  (35334) 13%


"data" Memory  [Origin = 0x1000, Length = 0x6000]

section                    address      alignment gaps    total length  (dec)
-------                    -------      --------------    -------------------
.nbss                       0x1000                   0           0x240  (576)
.ndata                      0x1240                   0            0x92  (146)
.nbss                       0x12d2                   0            0x30  (48)
.ndata                      0x1302                   0            0x2a  (42)
_0000000007F9C78064cc3b02    0x132c                   0            0x24  (36)
.ndata                      0x1350                   0            0x30  (48)
.nbss                       0x1380                   0            0x16  (22)
_00000000078D6F0064cc3b00    0x1396                   0            0x16  (22)
.ndata                      0x13ac                   0             0xe  (14)
.nbss                       0x13ba                   0             0xe  (14)
.ndata                      0x13c8                   0             0xc  (12)
.nbss                       0x13d4                   0             0xa  (10)
.ndata                      0x13de                   0             0x8  (8)
.nbss                       0x13e6                   0            0x12  (18)
.ndata                      0x13f8                   0             0x4  (4)
.nbss                       0x13fc                   0             0xc  (12)
.ndata                      0x1408                   0             0x4  (4)
.nbss                       0x140c                   0             0x4  (4)
.data                       0x1410                   0            0x2e  (46)
.bss                        0x143e                   0             0x2  (2)
.ybss                       0x6fee                   0            0x12  (18)

                 Total "data" memory used (bytes):          0x452  (1106) 4%


Dynamic Memory Usage

region                     address                      maximum length  (dec)
------                     -------                      ---------------------
heap                             0                                   0  (0)
stack                       0x1440                              0x5bae  (23470)

                 Maximum dynamic memory (bytes):         0x5bae  (23470)

External Symbol Tables

External Symbols in Data Memory (by address):

                    0x1000                  __isns_sample_count
                    0x1002                  _buck
                    0x10ec                  _isns_samples
                     :
                    0x140c                  _LOW_PRIORITY_GO
                    0x143e                  ___errno_val
                    0x6fee                  _v_loop_histories

External Symbols in Data Memory (by name):

                    0x13c8                  _BuckConverterRampUpSubStateMachine
                    0x1408                  _BuckConverterSpecialFunctions
                    0x13ac                  _BuckConverterStateMachine
                     :
                    0x12cc                  _v_loop_pre_scaler
                    0x12ce                  _v_loop_pterm_factor
                    0x12d0                  _v_loop_pterm_scaler

External Symbols in Program Memory (by address):

                  0x000200                  __resetPRI
                  0x00023c                  __psv_init
                  0x000248                  __data_init_extended
                     :
                  0x005dd4                  ___delay32
                  0x005df0                  _sysGpio_Initialize
                  0x02bf00                  __FSEC.sec

External Symbols in Program Memory (by name):

                  0x0052a4                  _CurrentSenseOffsetCalibration
                  0x005d3c                  _DefaultTrapHandler
                  0x0058c2                  _SYSTEM_Initialize
                     :
                  0x0050cc                  _v_loop_Precharge
                  0x0050ac                  _v_loop_Reset
                  0x004fe8                  _v_loop_Update

Memory Configuration

Memory Configuration

Name             Origin             Length             Attributes
data             0x001000           0x006000           a !xr
FBOOT            0x801800           0x000002  
reset            0x000000           0x000004  
ivt              0x000004           0x0001fc  
program          0x000200           0x02bd00           xr
FSEC             0x02bf00           0x000002  
FBSLIM           0x02bf10           0x000002  
FSIGN            0x02bf14           0x000002  
FOSCSEL          0x02bf18           0x000002  
FOSC             0x02bf1c           0x000002  
FWDT             0x02bf20           0x000002  
FPOR             0x02bf24           0x000002  
FICD             0x02bf28           0x000002  
FDMTIVTL         0x02bf2c           0x000002  
FDMTIVTH         0x02bf30           0x000002  
FDMTCNTL         0x02bf34           0x000002  
FDMTCNTH         0x02bf38           0x000002  
FDMT             0x02bf3c           0x000002  
FDEVOPT          0x02bf40           0x000002  
FALTREG          0x02bf44           0x000002  
FBTSEQ           0x02bffc           0x000002  
*default*        0x000000           0xffffffff 

Linker Script and Memory Map

Linker script and memory map

LOAD build/dpsk3_buck_vmc/production/sources/common/p33c_pral/p33c_pwm.o
LOAD build/dpsk3_buck_vmc/production/sources/common/p33c_pral/p33c_gpio.o
LOAD build/dpsk3_buck_vmc/production/sources/common/p33c_pral/p33c_dsp.o
  :
LOAD build/dpsk3_buck_vmc/production/sources/main.o
                    0x0001                  __MPLAB_BUILD = 0x1
LOAD p33CK256MP505
LOAD c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libfx-elf.a
                    0x801034                  _iwri1 = 0x801034
                    0x801038                  _iwri2 = 0x801038
                    0x801800                  __FBOOT = 0x801800
                    0x2bf00                  __FSEC = 0x2bf00
                    0x2bf10                  __FBSLIM = 0x2bf10
                    0x2bf14                  __FSIGN = 0x2bf14
                    0x2bf18                  __FOSCSEL = 0x2bf18
                    0x2bf1c                  __FOSC = 0x2bf1c
                    0x2bf20                  __FWDT = 0x2bf20
                    0x2bf24                  __FPOR = 0x2bf24
                    0x2bf28                  __FICD = 0x2bf28
                    0x2bf2c                  __FDMTIVTL = 0x2bf2c
                    0x2bf30                  __FDMTIVTH = 0x2bf30
                    0x2bf34                  __FDMTCNTL = 0x2bf34
                    0x2bf38                  __FDMTCNTH = 0x2bf38
                    0x2bf3c                  __FDMT = 0x2bf3c
                    0x2bf40                  __FDEVOPT = 0x2bf40
                    0x2bf44                  __FALTREG = 0x2bf44
                    0x2bffc                  __FBTSEQ = 0x2bffc
                    0x0200                  __CODE_BASE = 0x200
                    0x2bd00                  __CODE_LENGTH = 0x2bd00
                    0x0004                  __IVT_BASE = 0x4
                    0x1000                  __DATA_BASE = 0x1000
                    0x6000                  __DATA_LENGTH = 0x6000
                    0x5000                  __YDATA_BASE = 0x5000

.reset            0x000000          0x4
                  0x000000          0x2 SHORT 0x200 ABSOLUTE (__reset)
                  0x000001          0x2 SHORT 0x4
                  0x000002          0x2 SHORT 0x0 ((ABSOLUTE (__reset) >> 0x10) & 0x7f)
                  0x000003          0x2 SHORT 0x0

.text             0x000200       0x2240
 *(.init)
 .init            0x000200         0x48 c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(crt0_extendedch.o)
                  0x000200                  __resetPRI
                  0x000200                  __reset
                  0x00023c                  __psv_init
 .init            0x000248         0xb2 c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(data_init_extendedch.o)
                  0x000248                  __data_init
                  0x000248                  __data_init_extended
 *(.user_init)
 *(.handle)
 .handle          0x0002fa         0x50 jump_table
 *(.isr*)
 .isr.text        0x00034a         0xd0 build/dpsk3_buck_vmc/production/sources/fault_handler/drivers/drv_trap_handler.o
                  0x00034a                  __ReservedTrap5
                  0x000364                  __ReservedTrap7
                  0x00037e                  __HardTrapError
                   :
.init.delay32     0x005dd4         0x1c
 .init.delay32    0x005dd4         0x1c c:/program files/microchip/xc-dsc/v3.00/bin/bin/../../lib\libc99-pic30-elf.a(delay32ch.Meo)
                  0x005dd4                  ___delay32

.text             0x005df0         0x14
 .text            0x005df0         0x14 build/dpsk3_buck_vmc/production/sources/config/init/init_gpio.o
                  0x005df0                  _sysGpio_Initialize