diff options
author | cognet <cognet@FreeBSD.org> | 2005-12-20 01:28:17 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2005-12-20 01:28:17 +0000 |
commit | b0632238f9c37cfb4bf07e8c06e24669082f6c43 (patch) | |
tree | 46002a861c058c981b4e8a8da44e96bbb953252c /sys/conf/Makefile.arm | |
parent | 761a5296f91cc098c572f1be56dd44b000486be9 (diff) | |
download | FreeBSD-src-b0632238f9c37cfb4bf07e8c06e24669082f6c43.zip FreeBSD-src-b0632238f9c37cfb4bf07e8c06e24669082f6c43.tar.gz |
Make the elf trampoline disable the MMU, and link it at physical address,
to avoid bad surprises.
Diffstat (limited to 'sys/conf/Makefile.arm')
-rw-r--r-- | sys/conf/Makefile.arm | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm index f240377..a31aea1 100644 --- a/sys/conf/Makefile.arm +++ b/sys/conf/Makefile.arm @@ -52,8 +52,7 @@ DDB_ENABLED!= grep DDB opt_ddb.h || true SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader \ -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"// \ +SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\ >ldscript.$M.noheader; \ ${SYSTEM_LD_}; \ ${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \ @@ -62,33 +61,38 @@ SYSTEM_LD_TAIL +=; cat ldscript.$M| \ .if ${DDB_ENABLED} != "" || defined(BUILD_ELF_TRAMPOLINE) SYSTEM_LD_TAIL += ;echo "\#define KERNNAME \"${KERNEL_KO}.tmp\"" \ >opt_kernname.h ;\ - ${OBJCOPY} ${STRIP_FLAGS} --strip-symbol '$$d' --strip-symbol '$$a' \ + sed s/${KERNVIRTADDR}/${KERNPHYSADDR}/ ldscript.$M > \ + ldscript.$M.tramp; \ + sed s/" + SIZEOF_HEADERS"// ldscript.$M.tramp > \ + ldscript.$M.tramp.noheader; \ + ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \ -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp;\ - ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm \ + ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp \ $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp;\ - ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm.noheader \ + ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp.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; \ - gzip -9 ${KERNEL_KO}.tmp; \ + ${OBJCOPY} ${STRIP_FLAGS} ${KERNEL_KO}.tmp; \ echo "\#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" \ >opt_kernname.h ;\ + gzip -9 ${KERNEL_KO}.tmp; \ eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \ echo "\#define KERNSIZE $$st_size" >>opt_kernname.h;\ - ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm \ - -DKZIP $S/$M/$M/elf_trampoline.c $S/kern/inflate.c $S/$M/$M/inckern.S \ + ${CC} -O2 -DKZIP -I. -c $S/kern/inflate.c -o inflate-tramp.o; \ + ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp \ + -DKZIP $S/$M/$M/elf_trampoline.c inflate-tramp.o $S/$M/$M/inckern.S \ -o ${KERNEL_KO}.gz.tramp;\ - ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm.noheader \ - -DKZIP $S/$M/$M/elf_trampoline.c $S/kern/inflate.c $S/$M/$M/inckern.S \ + ${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \ + -DKZIP $S/$M/$M/elf_trampoline.c inflate-tramp.o $S/$M/$M/inckern.S \ -o ${KERNEL_KO}.tramp.noheader; \ ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ ${KERNEL_KO}.gz.tramp.bin; \ - rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h; + rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \ + inflate-tramp.o; .endif -CLEANFILES += ldscript.$M ldscript.$M.noheader ${KERNEL_KO}.bin \ - ${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin %BEFORE_DEPEND %OBJS @@ -101,8 +105,13 @@ CLEANFILES += ldscript.$M ldscript.$M.noheader ${KERNEL_KO}.bin \ %CLEAN +CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader + .if ${DDB_ENABLED} != "" -CLEAN+= kernel.tramp +CLEAN+= ${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin ldscript.$M.tramp \ + ldscript.$M.tramp.noheader ${KERNEL_KO}.gz.tramp \ + ${KERNEL_KO}.gz.tramp.bin + .endif ldscript.$M: $S/conf/ldscript.$M cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \ |