]> rtime.felk.cvut.cz Git - jailhouse-test.git/commitdiff
fiasco: bootstrap: Try to link all in one binary. Example.
authorMaxim Baryshnikov <barysmax@fel.cvut.cz>
Fri, 1 Apr 2016 11:02:00 +0000 (13:02 +0200)
committerMaxim Baryshnikov <barysmax@fel.cvut.cz>
Fri, 1 Apr 2016 11:02:00 +0000 (13:02 +0200)
bootstrap-relink/all-linked-try.ld

index 8a1e8a8033da7a457fb62d56db4bec7d21fecb50..343d57bbff520bee037e0628e1cf412d8e60a555 100644 (file)
@@ -1,49 +1,65 @@
 SECTIONS
 {
        . = 0;
-       .startup        : { *(.startup) }
+       .jh.cmdline     : {
+               cmdline = 0xf0000; /* adjust relocation address of variable */
+                header-32-inmate.o (.cmdline)
+               BYTE(0); /* empty string in case no buffer is provided */
+       }
+
+       /* 16-bit sections */
+       .jh.startup     : { header-32-inmate.o (.startup) }
 
        . = 0xfff0;
-       .boot           : {
-               *(.boot)
+       .jh.boot                : {
+               header-32-inmate.o (.boot)
                . = ALIGN(16);
        }
 
+       /* 32/64-bit sections */
        . = 0xe0000;
-
-       _image_start = .;
-       
        stack_top = .;
        bss_start = .;
-       
-       .bss            : {
-               *(.bss .bss.*)
-               /*COMMON may intersect with something from header-32.S*/
-               *(COMMON)
+       .jh.bss         : {
+               header-32-inmate.o (.bss)
                . = ALIGN(8);
        }
-       
-       bss_dwords = SIZEOF(.bss) / 4;
-       bss_qwords = SIZEOF(.bss) / 8;
+       bss_dwords = SIZEOF(.jh.bss) / 4;
+       bss_qwords = SIZEOF(.jh.bss) / 8;
 
-       . = 0xf0000 + SIZEOF(.startup);
-       .text           : AT (ADDR(.text) & 0xffff) {
-               *(.text .text.*)
+       . = 0xf0000 + ADDR(.jh.startup) + SIZEOF( .jh.startup );
+       .jh.text                : AT (ADDR( .jh.text ) & 0xffff) {
+               header-32-inmate.o  ( .text)
        }
 
        . = ALIGN(16);
-       .rodata         : AT (ADDR(.rodata) & 0xffff) {
-               *(.rodata .rodata.*)
+       .jh.rodata              : AT (ADDR(.jh.rodata) & 0xffff) {
+               header-32-inmate.o (.rodata)
        }
 
        . = ALIGN(16);
-       .data           : AT (ADDR(.data) & 0xffff) {
-               *(.data .data.*)
-
+       .jh.data                : AT (ADDR(.jh.data) & 0xffff) {
+               header-32-inmate.o  (.data)
        }
+       
+       /*fiasco section*/
+       . =  0x00100000 - 0xf0000;
+       _image_start = .;
+       .text :
+       {
+       *( EXCLUDE_FILE (header-32-inmate.o) .text .text.*)
+       *( EXCLUDE_FILE (header-32-inmate.o) .rodata .rodata.*)
+       } =0x9090
+
+       .data :
+       {
+       *( EXCLUDE_FILE (header-32-inmate.o) .data .data.*)
+       *( EXCLUDE_FILE (header-32-inmate.o) .bss .bss.*)
+       *( EXCLUDE_FILE (header-32-inmate.o) COMMON)
+       }
        _image_end = .;
 
-       .sixtyfour 0x2d0000 :
+       .sixtyfour 0x2d0000 - 0xf0000 :
        {
                . =  . + 500000;
        }
@@ -56,6 +72,6 @@ SECTIONS
                *(.eh_frame)
        }       
 }
-ENTRY(_reset_entry)
+ENTRY(__reset_entry)