Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2004 13:02:45 -0700
From:      "David O'Brien" <obrien@freebsd.org>
To:        Ryan Sommers <ryans@gamersimpact.com>
Cc:        hackers@freebsd.org
Subject:   Re: Method of compiling boot0
Message-ID:  <20040425200245.GA97921@dragon.nuxi.com>
In-Reply-To: <49216.63.226.178.14.1082755139.squirrel@www2.neuroflux.com>
References:  <49216.63.226.178.14.1082755139.squirrel@www2.neuroflux.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 23, 2004 at 03:18:59PM -0600, Ryan Sommers wrote:
> I was browsing over the boot0 makefiles and source when I was playing with
> some boot sector code of mine and I was wondering why the designers chose
> to use objcopy to output a binary file instead of just using the --oformat
> option when it's run over the linker.

I converted most i386 boot things to use the linker options.  I was
unable to us them on boot2.bin.  Rather using them to produce boot2.bin
produced a different file than what is in CVS right now.  I didn't have
time to track down why, but if you'd like to analyis this I'd appreciate
it.

Index: i386/boot2/Makefile
===================================================================
RCS file: /home/ncvs/src/sys/boot/i386/boot2/Makefile,v
retrieving revision 1.55
diff -u -r1.55 Makefile
--- i386/boot2/Makefile	17 Feb 2004 07:13:03 -0000	1.55
+++ i386/boot2/Makefile	25 Apr 2004 19:53:01 -0000
@@ -53,7 +53,7 @@
 boot1.out: boot1.o
 	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
 
-CLEANFILES+=	boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
+CLEANFILES+=	boot2 boot2.ld boot2.ldr boot2.bin boot2.o \
 		boot2.s boot2.s.tmp boot2.h sio.o
 
 boot2: boot2.ld
@@ -68,11 +68,8 @@
 boot2.ldr:
 	dd if=/dev/zero of=${.TARGET} bs=276 count=1
 
-boot2.bin: boot2.out
-	objcopy -S -O binary boot2.out ${.TARGET}
-
-boot2.out: ${BTXCRT} boot2.o sio.o
-	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
+boot2.bin: ${BTXCRT} boot2.o sio.o
+	${LD} ${LDFLAGS} -Ttext ${ORG2} -S --oformat binary -o ${.TARGET} ${.ALLSRC}
 
 boot2.o: boot2.s
 
-- 
-- David  (obrien@FreeBSD.org)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040425200245.GA97921>