Als Ergänzung zu meiner vorherigen Frage
Beitrag "MIPS ISR verschieben"
Ich möchte alle Funktionen bis auf zwei in einen bestimmten
Speicherbereich schieben. Ich habe das mit dem Linkerskript nicht
richtig hinbekommen und hoffe hier auf Hilfe.
Linkerskript:
1 | INCLUDE procdefs.ld
|
2 | /* ... */
|
3 |
|
4 | SECTIONS
|
5 | {
|
6 | /* ganz viele Definitionen weggelassen */
|
7 |
|
8 | .text :
|
9 | {
|
10 | /* ISR und main sollen als erstes stehen */
|
11 | *(.text.isr)
|
12 | *(.text.main)
|
13 | /* ... */
|
14 | } >startup_region
|
15 |
|
16 | .text :
|
17 | {
|
18 | *(*.text)
|
19 | } >program1
|
20 |
|
21 | /* noch mehr weggelassene Definitionen */
|
22 | }
|
Ausschnitt aus procdefs.gld
1 | MEMORY
|
2 | {
|
3 | /*kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x10000*/
|
4 | startup_region (rx) : ORIGIN = 0x9D000000, LENGTH = 0x01000
|
5 | program1 (rx) : ORIGIN = 0x9D002000, LENGTH = 0x01000
|
6 | program2 (rx) : ORIGIN = 0x9D009000, LENGTH = 0x01000
|
7 | kseg0_boot_mem : ORIGIN = 0x9FC00490, LENGTH = 0x970
|
8 | exception_mem : ORIGIN = 0x9FC01000, LENGTH = 0x1000
|
9 | kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x490
|
10 | debug_exec_mem : ORIGIN = 0xBFC02000, LENGTH = 0xFF0
|
11 | config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4
|
12 | config2 : ORIGIN = 0xBFC02FF4, LENGTH = 0x4
|
13 | config1 : ORIGIN = 0xBFC02FF8, LENGTH = 0x4
|
14 | config0 : ORIGIN = 0xBFC02FFC, LENGTH = 0x4
|
15 | kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x4000
|
16 | sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000
|
17 | configsfrs : ORIGIN = 0xBFC02FF0, LENGTH = 0x10
|
18 | }
|
Ziel ist es, alle Funktionen außer isr() und main() in program1 zu
schieben. program2 soll komplett leer bleiben und wird für ein
zukünftiges Update reserviert. Das geht natürlich auch anders, soll
hier aber so umgesetzt werden.
Das Problem ist, dass das obige Linkerskript alle Funktionen bei
0x9D002000 beginnen lässt und nicht nur die noch nicht anderweitig
platzierten. Ich hab gehofft, dass die Wildcard *(*.text) nur die noch
nicht anderweitig vergebenen Symbole platziert. Damit jede Funktion
Ihre eigene Section bekommt, wird das Projekt mit -ffunction-sections
kompiliert.
Lässt man die Zeilen .text: {/*...*/} >program1 weg, dann liegen isr()
und main() da wo sie sollen, allerdings ist der Rest der Funktionen
nicht da wo ich sie haben möchte.
Kann mir jemand helfen das zu lösen? Ich stehe auf dem Schlauch :(