Create a non-elf pure binary version of the kernel as well.
This commit is contained in:
parent
16638b5585
commit
f5a9ac9ca4
@ -48,6 +48,16 @@ CFLAGS += -mno-apcs-frame
|
||||
|
||||
DDB_ENABLED!= grep DDB opt_ddb.h || true
|
||||
|
||||
SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.static \
|
||||
-warn-common -export-dynamic -dynamic-linker /red/herring -o \
|
||||
${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
|
||||
SYSTEM_LD_TAIL +=; cat ldscript.$M| \
|
||||
sed s/" + SIZEOF_HEADERS"// \
|
||||
>ldscript.$M.noheader; \
|
||||
${SYSTEM_LD_}; \
|
||||
${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \
|
||||
${KERNEL_KO}.bin; \
|
||||
rm ${FULLKERNEL}.noheader
|
||||
.if ${DDB_ENABLED} != ""
|
||||
SYSTEM_LD_TAIL += ;echo "\#define KERNNAME \"${KERNEL_KO}.tmp\"" \
|
||||
>opt_kernname.h ;\
|
||||
@ -55,9 +65,17 @@ SYSTEM_LD_TAIL += ;echo "\#define KERNNAME \"${KERNEL_KO}.tmp\"" \
|
||||
-g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp;\
|
||||
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm \
|
||||
$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp;\
|
||||
rm ${KERNEL_KO}.tmp
|
||||
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm.noheader \
|
||||
$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o \
|
||||
${KERNEL_KO}.tramp.noheader; \
|
||||
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
|
||||
${KERNEL_KO}.tramp.bin; \
|
||||
rm ${KERNEL_KO}.tmp ${KERNEL_KO}.tramp.noheader; \
|
||||
|
||||
.endif
|
||||
|
||||
CLEANFILES += ldscript.$M ldscript.$M.static ${KERNEL_KO}.bin \
|
||||
${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin
|
||||
%BEFORE_DEPEND
|
||||
|
||||
%OBJS
|
||||
|
@ -8,7 +8,20 @@ SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = KERNVIRTADDR + SIZEOF_HEADERS;
|
||||
.interp : { *(.interp) }
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
*(.stub)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
*(.gnu.linkonce.t*)
|
||||
} =0x9090
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.fini : { *(.fini) } =0x9090
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
|
||||
.rodata1 : { *(.rodata1) }
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
@ -43,19 +56,7 @@ SECTIONS
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) } =0x9090
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
*(.stub)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
*(.gnu.linkonce.t*)
|
||||
} =0x9090
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.fini : { *(.fini) } =0x9090
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
|
||||
.rodata1 : { *(.rodata1) }
|
||||
|
||||
/* Adjust the address for the data segment. We want to adjust up to
|
||||
the same address within the page on the next page up. */
|
||||
. = ALIGN(0x1000) + (. & (0x1000 - 1)) ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user