refactor: decouple i386 specific instruction invocation
[lunaix-os.git] / lunaix-os / link / linker.ld
index 4ea6b4eecb72d755e225800c1bdb59d6bc3753bf..937777b37c523a38f7d7d239db8d4cc67d2e5e28 100644 (file)
@@ -11,23 +11,21 @@ SECTIONS {
     . = 0x100000;
 
     /* 这里是我们的高半核初始化代码段和数据段 */
-
     .hhk_init_text BLOCK(4K) : {
-        * (.multiboot)
-        arch/*.o (.hhk_init)
-        arch/*.o (.text)
+        *(.multiboot)
+        *(.hhk_init_text)
     }
 
     .hhk_init_bss BLOCK(4K) : {
-        arch/*.o (.bss)
+        *(.hhk_init_bss)
     }
 
     .hhk_init_data BLOCK(4K) : {
-        arch/*.o (.data)
+        *(.hhk_init_data)
     }
 
     .hhk_init_rodata BLOCK(4K) : {
-        arch/*.o (.rodata)
+        *(.hhk_init_rodata)
     }
     __init_hhk_end = ALIGN(4K);
 
@@ -37,41 +35,27 @@ SECTIONS {
     /* 好了,我们的内核…… */
     .text BLOCK(4K) : AT ( ADDR(.text) - 0xC0000000 ) {
         __kernel_start = .;
-        kernel/*.o (.text)
-        hal/*.o (.text)
-        debug/*.o (.text)
-        libs/*.o (.text)
-    }
+        PROVIDE(__ktext_start = .);
+        
+        *(.text)
 
-    __usrtext_start = ALIGN(4K);
-    .usrtext BLOCK(4K) : AT ( ADDR(.usrtext) - 0xC0000000 ) {
-        * (.usrtext)
+        PROVIDE(__ktext_end = .);
     }
-    __usrtext_end = ALIGN(4K);
 
     .data BLOCK(4K) : AT ( ADDR(.data) - 0xC0000000 ) {
-        kernel/*.o (.data)
-        hal/*.o (.data)
-        debug/*.o (.data)
-        libs/*.o (.data)
+        *(.data)
     }
 
     .rodata BLOCK(4K) : AT ( ADDR(.rodata) - 0xC0000000 ) {
-        kernel/*.o (.rodata)
-        hal/*.o (.rodata)
-        debug/*.o (.rodata)
-        libs/*.o (.rodata)
+        *(.rodata)
     }
 
     .kpg BLOCK(4K) : AT ( ADDR(.kpg) - 0xC0000000 ) {
-        arch/*.o (.kpg)
+        *(.kpg)
     }
 
     .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) {
-        kernel/*.o (.bss)
-        hal/*.o (.bss)
-        debug/*.o (.bss)
-        libs/*.o (.bss)
+        *(.bss)
     }
 
     __kernel_end = ALIGN(4K);