Binary, produced by MSP430GCC, has strange start address for text segment

67 views Asked by At

After compiling an exemplary C program with msp430-gcc (LTS 20120406 unpatched) for the MSPG2211 I got the following output using the readelf command:

section header

section image

program header

segment image

The address space of the MSPG2211 microcontroller is structured as follows:

0x0000 - 0x01FF - Peripherals

0x0200 - 0x027F - RAM

0x1000 - 0x10FF - Flash (information memory)

0x1100 - 0xF7FF - ???

0xF800 - 0xFFFF - Flash (code memory + interrupt vectors)

The text section shown in the section header starts at 0xF800 which is the first address of the code memory.

The text segment, including only the text section, is bigger than the text section and starts already at 0xF76C.

As I understood, the loadable segments gets loaded to the shown physical addresses for program execution.

So why the start address of the text segment lies within an undefined memory region?

1

There are 1 answers

2
CL. On BEST ANSWER

Some of the names sections (such as .text) contain data that is actually loaded into the MCU.

The ELF program headers, however, contain only metadata; their address does not matter.