Changes between Version 10 and Version 11 of Archi-1-TP10


Ignore:
Timestamp:
Dec 21, 2020, 12:07:52 PM (4 years ago)
Author:
franck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Archi-1-TP10

    v10 v11  
    188188'''''''''''''''
    189189}}}
    190 1. ldscript?
     1901. 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.
    191191{{{#!protected ------------------------------------------------------------------------------------
    192192'''''''''''''''
     
    195195}}}
    1961961. 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}}}
    197216{{{#!protected ------------------------------------------------------------------------------------
    198217'''''''''''''''