Keil Logo

Segment Information

The linker creates special symbols (using no program or data space) that contain address and length information for segments used in an application.

Symbol Name Description
_PR_segment-name_S_ The starting address of the segment.
_PR_segment-name_B_ The code bank in which the segment is stored.
_PR_segment-name_L_ The length of the segment in bytes.
_PR_segment-name_E_ The ending address of the segment.
_PR_segment-name_T_ The execution/target address of the segment.

You may create declarations from external variables to access this information. For example, use the following to get information about the length of the main function in the measure module:

extern unsigned char _PR_main_measure_L_;

unsigned main_length = (unsigned int) & _PR_main_measure_L_;

The SROM.H header file contains macro definitions that simplify access to segment information:

#include <srom.h>

SROM_PS(main_measure) // Create external declarations for main_measure

unsigned measure_size   = SROM_PS_LEN(main_measure);
unsigned measure_start  = SROM_PS_SRC(main_measure);
unsigned measure_end    = SROM_PS_END(main_measure);
unsigned measure_target = SROM_PS_TRG(main_measure);
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.