From 8115fb5df93d7e949329299b9c56e1c58aa0ff80 Mon Sep 17 00:00:00 2001 From: Maxim Baryshnikov Date: Fri, 1 Apr 2016 13:02:00 +0200 Subject: [PATCH] fiasco: bootstrap: Try to link all in one binary. Example. --- bootstrap-relink/all-linked-try.ld | 64 +++++++++++++++++++----------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/bootstrap-relink/all-linked-try.ld b/bootstrap-relink/all-linked-try.ld index 8a1e8a8..343d57b 100644 --- a/bootstrap-relink/all-linked-try.ld +++ b/bootstrap-relink/all-linked-try.ld @@ -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) -- 2.39.2