This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dev:crosscompiler:backend_ppc:linker32 [2015/04/18 07:57] – external edit 127.0.0.1 | dev:crosscompiler:backend_ppc:linker32 [2022/12/20 11:33] (current) – ursgraf | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| * Create system table | * Create system table | ||
| * Create target image | * Create target image | ||
| + | When creating the target image or calculating a crc the endianess of the target platform has to be taken into account. | ||
| ===== Initialization ===== | ===== Initialization ===== | ||
| Line 13: | Line 14: | ||
| ===== Create Constant Block ===== | ===== Create Constant Block ===== | ||
| - | Each class has a constant block. Certain interfaces need a reduced constant block and arrays just need a type descriptor, see [[.: | + | Each class has a constant block. Certain interfaces need a reduced constant block and arrays just need a type descriptor, see [[dev: |
| * Header (base, size, ...) | * Header (base, size, ...) | ||
| * Global pointer list | * Global pointer list | ||
| Line 20: | Line 21: | ||
| * Constant pool | * Constant pool | ||
| * Checksum | * Checksum | ||
| - | [{{ .: | + | [{{ dev: |
| The //const pool// contains values of type //float// and //double// which are not placed directly into the code. After all elements are added the // | The //const pool// contains values of type //float// and //double// which are not placed directly into the code. After all elements are added the // | ||
| - | When the system ist starting up, the [[..: | + | When the system ist starting up, the [[dev: |
| - | In the compiler the constant block is modeled as linked list of '' | + | In the compiler the constant block is modeled as linked list of '' |
| * **'' | * **'' | ||
| * **'' | * **'' | ||
| Line 33: | Line 34: | ||
| ==== Type Descriptor ==== | ==== Type Descriptor ==== | ||
| - | The structure and purpose of the [[Type Descriptor]] is described separately. | + | The structure and purpose of the [[dev: |
| ==== String pool ==== | ==== String pool ==== | ||
| - | The string pool holds the constant strings of a class. They are stored as follows (also see [[strings|Strings]]: | + | The string pool holds the constant strings of a class. They are stored as follows (also see [[dev: |
| [ tag ] | [ tag ] | ||
| [ stringClassAddress ] | [ stringClassAddress ] | ||
| Line 52: | Line 53: | ||
| [401921FB] 6.283185307179586 (double) | [401921FB] 6.283185307179586 (double) | ||
| [54442D18] | [54442D18] | ||
| - | |||
| ===== Calculate Size and Offsets ===== | ===== Calculate Size and Offsets ===== | ||
| - | [{{ | + | [{{ |
| Before the memory map can be fixed, a couple sizes and offsets must be calculated for each class: | Before the memory map can be fixed, a couple sizes and offsets must be calculated for each class: | ||
| * '' | * '' | ||
| Line 61: | Line 61: | ||
| ===== Create System Table ===== | ===== Create System Table ===== | ||
| - | The linker assembles a system table for the whole system. This table must be loaded to a prefixed address in the target system and holds information for the [[..: | + | The linker assembles a system table for the whole system. This table must be loaded to a prefixed address in the target system and holds information for the [[dev: |
| - The system runs from the flash | - The system runs from the flash | ||
| - The system runs from the RAM. | - The system runs from the RAM. | ||
| Line 69: | Line 69: | ||
| The structure of the system table is: | The structure of the system table is: | ||
| - | [{{ .: | + | [{{ dev: |
| First, the class constructor of the class kernel must be found. For this, the class name of the kernel is fetched from the configuration and the method //< | First, the class constructor of the class kernel must be found. For this, the class name of the kernel is fetched from the configuration and the method //< | ||
| - | The references to the constant blocks are assembled as follows. First come the classes with class constructors. These classes are already sorted in correct order as described in [[class_initialization|Initialization]]. Classes without initialization follow afterwards. Arrays and interfaces have no constant block and are not listed. The exception to this rule are interfaces with class constructor, | + | The references to the constant blocks are assembled as follows. First come the classes with class constructors. These classes are already sorted in correct order as described in [[dev: |
| ===== Fix Memory Map ===== | ===== Fix Memory Map ===== | ||
| - | [{{ | + | [{{ |
| In this step the code is placed in the memory, as well as the class variables and the constants. First, each class is assigned a memory segment for the code ('' | In this step the code is placed in the memory, as well as the class variables and the constants. First, each class is assigned a memory segment for the code ('' | ||
| Now, the base address of each used segment can be determined. \\ | Now, the base address of each used segment can be determined. \\ | ||