Hallo ich beschäftige mich momentan mit den Linkerskripten von ARMs
Habe momentan ein Problem:
Im Linkerskript aus LPCxpresso für den LPC1788 steht:
1 | MEMORY
|
2 | {
|
3 | /* Define each memory region */
|
4 | MFlash512 (rx) : ORIGIN = 0x0, LENGTH = 0x80000 /* 512K bytes */
|
5 | RamLoc64 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x10000 /* 64K bytes */
|
6 | RamPeriph32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes */
|
7 |
|
8 |
|
9 | }
|
10 | /* Define a symbol for the top of each memory region */
|
11 | __top_MFlash512 = 0x0 + 0x80000;
|
12 | __top_RamLoc64 = 0x10000000 + 0x10000;
|
13 | __top_RamPeriph32 = 0x20000000 + 0x8000;
|
Ist das nicht falsch?
Wenn ich die Top-Adresse haben will muss ich doch eigentlich schreiben:
TOP = START + LENGTH - 1;
dieses -1 fehlt hier. Ist das falsch und stört bloß nicht, da nur ein
Byte?
Zweite Frage:
1 | /* Global Section Table */
|
2 | . = ALIGN(4) ;
|
3 | __section_table_start = .;
|
4 | __data_section_table = .;
|
5 | LONG(LOADADDR(.data));
|
6 | LONG( ADDR(.data));
|
7 | LONG( SIZEOF(.data));
|
8 | LONG(LOADADDR(.data_RAM2));
|
9 | LONG( ADDR(.data_RAM2));
|
10 | LONG( SIZEOF(.data_RAM2));
|
11 | __data_section_table_end = .;
|
12 | __bss_section_table = .;
|
13 | LONG( ADDR(.bss));
|
14 | LONG( SIZEOF(.bss));
|
15 | LONG( ADDR(.bss_RAM2));
|
16 | LONG( SIZEOF(.bss_RAM2));
|
17 | __bss_section_table_end = .;
|
18 | __section_table_end = . ;
|
19 | /* End of Global Section Table */
|
__section_table_start = .; und __data_section_table = .; auf das selbe?
LONG( SIZEOF(.data_RAM2));
__data_section_table_end = .;
__bss_section_table = .;
LONG( ADDR(.bss));
zeigen __data_section_table_end = .;und __bss_section_table = .; nicht
auf das selbe?
Wie verhät es sich mit:
1 | *(section1)
|
2 | var = .;
|
3 | *(section2)
|
wo liegt nun var?
Auf der letzten Adresse von section1?
Auf der ersten von section2?
Oder auf einer dazwischen?
Wäre froh wenn mir jemand diese Dinge kurz erklären kann