Understanding map files
This topic describes map files and their formats.
The binder map file is a symbol map in address order format.
Each symbol listed in the map file has a storage class (CL
) and a type (TY
) associated with it.
Storage classes correspond to the XMC_TY variables defined in the syms.h file. Each storage class belongs to one of the following section types:
- .text
- Contains read-only data (instructions).
Addresses listed in this section use the beginning of the .text section as origin. The .text section
can contain one of the following storage class (
CL
) values:- DB
- Debug Table. Identifies a class of sections that has the same characteristics as read only data.
- GL
- Glue Code. Identifies a section that has the same characteristics as a program code. This type of section has code to interface with a routine in another module. Part of the interface code requirement is to maintain the table of contents data structure (TOC) addressability across the call.
- PR
- Program Code. Identifies the sections that provide executable instructions for the module.
- R0
- Read Only Data. Identifies the sections that contain constants that are not modified while the program is running.
- TB
- Reserved for future use.
- TI
- Reserved for future use.
- XO
- Extended Operations code. Identifies a section of code that is to be treated as a pseudo-machine instruction.
- .data
- Contains read-write initialized data. Addresses listed in this
section use the beginning of the .data section
as the origin. The .data section can contain one
of the following storage class (
CL
) value types:- DS
- Descriptor. Identifies a function descriptor. This information is used to describe function pointers in languages such as C and Fortran.
- RW
- Read Write Data. Identifies a section that contains data that is known to require change while the program is running.
- SV
- SVC. Identifies a section of code that is to be treated as a supervisory call.
- T0
- TOC Anchor. Used only by the predefined TOC symbol. Identifies the TOC special symbol that is used only by the TOC header.
- TC
- TOC Entry. Identifies address data that will reside in the TOC.
- TD
- TOC Data Entry. Identifies data that will reside in the TOC.
- UA
- Unclassified. Identifies data that contains data of an unknown storage class.
- .bss
- Contains read-write data that is not initialized. Addresses listed
in this section use the beginning of the .data section
as origin. The .bss section contains one of the
following storage class (
CL
) values:- BS
- BSS class. Identifies a section that contains data that is not initialized.
- UC
- Unnamed Fortran Common. Identifies a section that contains read/write data.
Types correspond to the XTY_TY variables defined in the syms.h file. The type (TY) can be one of the following values:
Item | Description |
---|---|
ER | External Reference |
LD | Label Definition |
SD | Section Definition |
CM | BSS Common Definition |
The following is the map file for the demonstration kernel extension. This file was created because of the -bmap:demokext.map option of the ld command.
1 ADDRESS MAP FOR demokext SOURCE-FILE(OBJECT) or
2 *IE ADDRESS LENGTH AL CL TY Sym# NAME IMPORT-FILE{SHARED-OBJECT}
3 --- -------- ------ -- -- -- ----- --------------------- ---------------------------
4 I ER S1 _system_configuration /lib/syscalls.exp{/unix}
5 I ER S2 fp_open /lib/kernex.exp{/unix}
6 I ER S3 fp_close /lib/kernex.exp{/unix}
7 I ER S4 fp_write /lib/kernex.exp{/unix}
8 I ER S5 sprintf /lib/kernex.exp{/unix}
9 00000000 000360 2 PR SD S6 <> demokext.c(demokext.o)
10 00000000 PR LD S7 .demokext
11 00000210 PR LD S8 .close_log
12 00000264 PR LD S9 .write_log
13 000002F4 PR LD S10 .open_log
14 00000360 000108 5 PR SD S11 .strcpy strcpy.s(/usr/lib/libcsys.a[strcpy.o])
15 00000468 000028 2 GL SD S12 <.sprintf> glink.s(/usr/lib/glink.o)
16 00000468 GL LD S13 .sprintf
17 00000490 000028 2 GL SD S14 <.fp_close> glink.s(/usr/lib/glink.o)
18 00000490 GL LD S15 .fp_close
19 000004C0 0000F8 5 PR SD S16 .strlen strlen.s(/usr/lib/libcsys.a[strlen.o])
20 000005B8 000028 2 GL SD S17 <.fp_write> glink.s(/usr/lib/glink.o)
21 000005B8 GL LD S18 .fp_write
22 000005E0 000028 2 GL SD S19 <.fp_open> glink.s(/usr/lib/glink.o)
23 000005E0 GL LD S20 .fp_open
24 00000000 0000F9 3 RW SD S21 <_$STATIC> demokext.c(demokext.o)
25 E 000000FC 000004 2 RW SD S22 demokext_j demokext.c(demokext.o)
26 * 00000100 00000C 2 DS SD S23 demokext demokext.c(demokext.o)
27 0000010C 000000 2 T0 SD S24 <TOC>
28 0000010C 000004 2 TC SD S25 <_$STATIC>
29 00000110 000004 2 TC SD S26 <_system_configuration>
30 00000114 000004 2 TC SD S27 <demokext_j>
31 00000118 000004 2 TC SD S28 <sprintf>
32 0000011C 000004 2 TC SD S29 <fp_close>
33 00000120 000004 2 TC SD S30 <fp_write>
34 00000124 000004 2 TC SD S31 <fp_open>
In the above map file, the .data section begins at the statement for line 24:
24 00000000 0000F9 3 RW SD S21 <_$STATIC> demokext.c(demokext.o)
The TOC (Table Of Contents) starts at the statement for line 27:
27 0000010C 000000 2 T0 SD S24 <TOC>