summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2005-11-24 02:25:49 +0000
committercognet <cognet@FreeBSD.org>2005-11-24 02:25:49 +0000
commit2a2203ec202a935c64457164772bd84ca2d2814c (patch)
treef351d6a80ed4b7eb82e302cfe7c9cbd9b0d42f8b /sys/conf
parentcaae9bf0814e6d393e79b98b8b66b456cf281a12 (diff)
downloadFreeBSD-src-2a2203ec202a935c64457164772bd84ca2d2814c.zip
FreeBSD-src-2a2203ec202a935c64457164772bd84ca2d2814c.tar.gz
Create a non-elf pure binary version of the kernel as well.
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/Makefile.arm20
-rw-r--r--sys/conf/ldscript.arm29
2 files changed, 34 insertions, 15 deletions
diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm
index c0e5a12..11495a4 100644
--- a/sys/conf/Makefile.arm
+++ b/sys/conf/Makefile.arm
@@ -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
diff --git a/sys/conf/ldscript.arm b/sys/conf/ldscript.arm
index d43e730..3ccf916 100644
--- a/sys/conf/ldscript.arm
+++ b/sys/conf/ldscript.arm
@@ -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)) ;
OpenPOWER on IntegriCloud