1

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?

Halvor Holsten Strand
  • 19,829
  • 17
  • 83
  • 99
Qfelix
  • 43
  • 3
  • Was the example program, and more importantly linker file and makefile, for this particular chip? – XTL Jun 14 '15 at 14:38

1 Answers1

0

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.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • But this applies only to architectures like the MSP430? I read that in linux operating systems the program loader only uses the information of segments (grouped sections) to load the process image. – Qfelix May 22 '15 at 21:39
  • 1
    Well, you tagged the question "msp430". `;-)` There is no operating system, or virtual memory. – CL. May 23 '15 at 07:14