Changes between Version 10 and Version 11 of Archi-1-TP10
- Timestamp:
- Dec 21, 2020, 12:07:52 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Archi-1-TP10
v10 v11 188 188 ''''''''''''''' 189 189 }}} 190 1. ldscript?190 1. Comme nous l'avons vu dans la précédente séance, c'est grâce au fichier ldscript (`kernel.ld` et plus tard `user.ld`) que l'on peut mapper (''placer en mémoire'') les sections produites par le compilateur C. 191 191 {{{#!protected ------------------------------------------------------------------------------------ 192 192 ''''''''''''''' … … 195 195 }}} 196 196 1. En C, vous savez que les variables globales sont toujours initialisées, soit explicitement dans le programme lui-même, soit implicitement à la valeur 0. Les variables globales initialisées sont placées dans la section `.data` (ou plutôt dans l'une des sections data : `.data`, `.sdata`, `.rodata`, etc. Elles sont présentes dans le fichier objet (`.o`) produit pas le compilateur. En revanche, les variables globales non explicitement initialisées ne sont pas présentes dans le fichier objet. effacement des variables globales? 197 {{{#!java 198 1 SECTIONS 199 2 { 200 3 .boot : { 201 4 *(.boot) /* boot code in boot region */ 202 5 } > boot_region 203 6 .ktext : { 204 7 *(.text*) /* code of any object file (except boot) in kernel code region) */ 205 8 } > ktext_region 206 9 .kdata : { 207 10 *(.*data*) /* initialized global variables */ 208 11 . = ALIGN(4); /* move the filling pointer to an word aligned address */ 209 12 __bss_origin = .; /* first byte of uninitialized global variables */ 210 13 *(.*bss*) /* uninitialized global variables */ 211 14 . = ALIGN(4); /* move the filling pointer to an word aligned address */ 212 15 __bss_end = .; /* first byte after the bss section */ 213 16 } > kdata_region 214 17 } 215 }}} 197 216 {{{#!protected ------------------------------------------------------------------------------------ 198 217 '''''''''''''''