Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108283146
D7409.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D7409.diff
View Options
Index: head/sys/boot/i386/Makefile.inc
===================================================================
--- head/sys/boot/i386/Makefile.inc
+++ head/sys/boot/i386/Makefile.inc
@@ -28,4 +28,9 @@
BTXKERN= ${BTXDIR}/btx/btx
BTXCRT= ${BTXDIR}/lib/crt0.o
+# compact binary with no padding between text, data, bss
+LDSCRIPT= ${SRCTOP}/sys/boot/i386/boot.ldscript
+LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary
+LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections
+
.include "../Makefile.inc"
Index: head/sys/boot/i386/boot.ldscript
===================================================================
--- head/sys/boot/i386/boot.ldscript
+++ head/sys/boot/i386/boot.ldscript
@@ -0,0 +1,11 @@
+/* $FreeBSD$ */
+/* Merge text, data and bss together almost no padding */
+OUTPUT_FORMAT("elf32-i386-freebsd")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SECTIONS {
+ . = 0x08048000 + SIZEOF_HEADERS;
+ .text : { *(.text) } =0x90909090 /* Pad with nops, if needed */
+ .data : { *(.data) } _edata = .;
+ .bss : { *(.bss) } _end = .;
+}
Index: head/sys/boot/i386/boot0/Makefile
===================================================================
--- head/sys/boot/i386/boot0/Makefile
+++ head/sys/boot/i386/boot0/Makefile
@@ -40,6 +40,7 @@
# The base address that we the boot0 code to to run it. Don't change this
# unless you are glutton for punishment.
BOOT_BOOT0_ORG?= 0x600
+ORG=${BOOT_BOOT0_ORG}
# Comm settings for boot0sio.
# Bit(s) Description
@@ -74,7 +75,7 @@
-DTICKS=${BOOT_BOOT0_TICKS} \
-DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED}
-LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/i386/boot2/Makefile
===================================================================
--- head/sys/boot/i386/boot2/Makefile
+++ head/sys/boot/i386/boot2/Makefile
@@ -48,7 +48,7 @@
CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}
-LD_FLAGS=-static -N --gc-sections
+LD_FLAGS=${LD_FLAGS_BIN}
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
Index: head/sys/boot/i386/btx/btx/Makefile
===================================================================
--- head/sys/boot/i386/btx/btx/Makefile
+++ head/sys/boot/i386/btx/btx/Makefile
@@ -25,7 +25,7 @@
ORG= 0x9000
-LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/i386/btx/btxldr/Makefile
===================================================================
--- head/sys/boot/i386/btx/btxldr/Makefile
+++ head/sys/boot/i386/btx/btxldr/Makefile
@@ -12,7 +12,8 @@
CFLAGS+=-DBTXLDR_VERBOSE
.endif
-LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary
+ORG=${LOADER_ADDRESS}
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/i386/cdboot/Makefile
===================================================================
--- head/sys/boot/i386/cdboot/Makefile
+++ head/sys/boot/i386/cdboot/Makefile
@@ -10,7 +10,7 @@
ORG= 0x7c00
-LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/i386/gptboot/Makefile
===================================================================
--- head/sys/boot/i386/gptboot/Makefile
+++ head/sys/boot/i386/gptboot/Makefile
@@ -47,7 +47,7 @@
OPENCRYPTO_XTS= xform_aes_xts.o
.endif
-LD_FLAGS=-static -N --gc-sections
+LD_FLAGS=${LD_FLAGS_BIN}
LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a
Index: head/sys/boot/i386/gptzfsboot/Makefile
===================================================================
--- head/sys/boot/i386/gptzfsboot/Makefile
+++ head/sys/boot/i386/gptzfsboot/Makefile
@@ -46,7 +46,7 @@
CFLAGS.gcc+= --param max-inline-insns-single=100
-LD_FLAGS=-static -N --gc-sections
+LD_FLAGS=${LD_FLAGS_BIN}
LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a
Index: head/sys/boot/i386/mbr/Makefile
===================================================================
--- head/sys/boot/i386/mbr/Makefile
+++ head/sys/boot/i386/mbr/Makefile
@@ -12,6 +12,6 @@
ORG= 0x600
AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS}
-LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/i386/pmbr/Makefile
===================================================================
--- head/sys/boot/i386/pmbr/Makefile
+++ head/sys/boot/i386/pmbr/Makefile
@@ -9,6 +9,6 @@
ORG= 0x600
AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS}
-LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/i386/pxeldr/Makefile
===================================================================
--- head/sys/boot/i386/pxeldr/Makefile
+++ head/sys/boot/i386/pxeldr/Makefile
@@ -34,7 +34,7 @@
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none
rm ${.TARGET}.tmp
-LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS+=${LDFLAGS_BIN}
CLEANFILES+= ${LOADER}
Index: head/sys/boot/i386/zfsboot/Makefile
===================================================================
--- head/sys/boot/i386/zfsboot/Makefile
+++ head/sys/boot/i386/zfsboot/Makefile
@@ -36,7 +36,7 @@
CFLAGS.gcc+= --param max-inline-insns-single=100
-LD_FLAGS=-static -N --gc-sections
+LD_FLAGS=${LD_FLAGS_BIN}
LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a
Index: head/sys/boot/pc98/Makefile.inc
===================================================================
--- head/sys/boot/pc98/Makefile.inc
+++ head/sys/boot/pc98/Makefile.inc
@@ -21,4 +21,9 @@
BTXKERN= ${BTXDIR}/btx/btx
BTXCRT= ${BTXDIR}/lib/crt0.o
+# compact binary with no padding between text, data, bss
+LDSCRIPT= ${SRCTOP}/sys/boot/i386/boot.ldscript
+LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary
+LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections
+
.include "../Makefile.inc"
Index: head/sys/boot/pc98/boot0/Makefile
===================================================================
--- head/sys/boot/pc98/boot0/Makefile
+++ head/sys/boot/pc98/boot0/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PROG= ${BOOT}.out
+PROG= ${BOOT}
INTERNALPROG=
FILES= ${BOOT}
MAN=
@@ -12,10 +12,8 @@
# The base address that we the boot0 code to to run it. Don't change this
# unless you are glutton for punishment.
BOOT_BOOT0_ORG?= 0x0000
+ORG=${BOOT_BOOT0_ORG}
-LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N
-
-${BOOT}: ${BOOT}.out
- ${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET}
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/pc98/boot2/Makefile
===================================================================
--- head/sys/boot/pc98/boot2/Makefile
+++ head/sys/boot/pc98/boot2/Makefile
@@ -52,7 +52,7 @@
CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}
-LD_FLAGS=-static -N --gc-sections
+LD_FLAGS=${LD_FLAGS_BIN}
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
Index: head/sys/boot/pc98/btx/btx/Makefile
===================================================================
--- head/sys/boot/pc98/btx/btx/Makefile
+++ head/sys/boot/pc98/btx/btx/Makefile
@@ -25,7 +25,7 @@
ORG= 0x9000
-LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/pc98/btx/btxldr/Makefile
===================================================================
--- head/sys/boot/pc98/btx/btxldr/Makefile
+++ head/sys/boot/pc98/btx/btxldr/Makefile
@@ -12,7 +12,8 @@
CFLAGS+=-DBTXLDR_VERBOSE
.endif
-LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary
+ORG=${LOADER_ADDRESS}
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
Index: head/sys/boot/pc98/cdboot/Makefile
===================================================================
--- head/sys/boot/pc98/cdboot/Makefile
+++ head/sys/boot/pc98/cdboot/Makefile
@@ -10,7 +10,7 @@
ORG= 0x0000
-LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
+LDFLAGS=${LDFLAGS_BIN}
.include <bsd.prog.mk>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 12:05 PM (19 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16086233
Default Alt Text
D7409.diff (7 KB)
Attached To
Mode
D7409: Move to linker script for building boot images
Attached
Detach File
Event Timeline
Log In to Comment