summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-10 16:11:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-10 16:11:45 +0000
commit9ce6cdf63a71b2154d091006f47548ca9b739d0a (patch)
tree939cab49177e2e1e29f4388057efa3b48ee47d0f /sys/arch/i386
parentff6e6d33c9a903865b0f2b0582985118fb384717 (diff)
link bootblocks with -Z instead of -N, to ensure that the file offset and
addresses line up correctly. Newer i386 gcc4 - for some reason -- is prompting the linker with -N to not do this alignment which it used to do (perhaps because the alignment of all .o's have dropped to very small amounts??). Using -Z wastes around a page of bootblock space which matters even more on the small install media, so this definately needs revisiting. Workaround from toby
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/stand/boot/Makefile4
-rw-r--r--sys/arch/i386/stand/cdboot/Makefile5
-rw-r--r--sys/arch/i386/stand/pxeboot/Makefile4
3 files changed, 7 insertions, 6 deletions
diff --git a/sys/arch/i386/stand/boot/Makefile b/sys/arch/i386/stand/boot/Makefile
index 04f3a5337d7..be54d15c262 100644
--- a/sys/arch/i386/stand/boot/Makefile
+++ b/sys/arch/i386/stand/boot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.34 2007/11/25 18:25:31 deraadt Exp $
+# $OpenBSD: Makefile,v 1.35 2010/07/10 16:11:43 deraadt Exp $
.include "${.CURDIR}/../Makefile.inc"
@@ -15,7 +15,7 @@ LDFLAGS+=-nostdlib -Bstatic
CLEANFILES+= srt0.o
SRCS= crt0.c
.else
-LDFLAGS+=-Ttext $(LINKADDR) -N -x -noinhibit-exec
+LDFLAGS+=-Ttext $(LINKADDR) -Z -x -noinhibit-exec
CLEANFILES+= crt0.o
SRCS= srt0.S
.endif
diff --git a/sys/arch/i386/stand/cdboot/Makefile b/sys/arch/i386/stand/cdboot/Makefile
index f4f98939815..7b3d9400841 100644
--- a/sys/arch/i386/stand/cdboot/Makefile
+++ b/sys/arch/i386/stand/cdboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.6 2007/11/25 18:25:32 deraadt Exp $
+# $OpenBSD: Makefile,v 1.7 2010/07/10 16:11:44 deraadt Exp $
.include "${.CURDIR}/../Makefile.inc"
@@ -11,7 +11,7 @@ SIZE?= size
LDFLAGS+=-nostdlib -Bstatic
INSTALL_STRIP=
-LDFLAGS+=-Ttext $(LINKADDR) -N -x -noinhibit-exec
+LDFLAGS+=-Ttext $(LINKADDR) -Z -x -noinhibit-exec
CLEANFILES+= crt0.o
SRCS= srt0.S
@@ -30,6 +30,7 @@ SRCS+= strlcpy.c moddi3.c divdi3.c qdivrem.c
${PROG}: $(OBJS) $(DPADD)
$(LD) $(LDFLAGS) -o ${PROG} $(OBJS) $(LDADD)
@$(SIZE) ${PROG}
+ cp ${PROG} ${PROG}.whole
if [ -x ${.OBJDIR}/${PROG} ]; then \
objcopy -O binary ${PROG} ${.OBJDIR}/.tmp;\
mv -f ${.OBJDIR}/.tmp ${.OBJDIR}/${PROG}; \
diff --git a/sys/arch/i386/stand/pxeboot/Makefile b/sys/arch/i386/stand/pxeboot/Makefile
index 85a8f2fac03..a4f0933805a 100644
--- a/sys/arch/i386/stand/pxeboot/Makefile
+++ b/sys/arch/i386/stand/pxeboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2007/11/25 18:25:32 deraadt Exp $
+# $OpenBSD: Makefile,v 1.4 2010/07/10 16:11:44 deraadt Exp $
.include "${.CURDIR}/../Makefile.inc"
@@ -11,7 +11,7 @@ SIZE?= size
LDFLAGS+=-nostdlib -Bstatic
INSTALL_STRIP=
-LDFLAGS+=-Ttext $(LINKADDR) -N -x -noinhibit-exec
+LDFLAGS+=-Ttext $(LINKADDR) -Z -x -noinhibit-exec
CLEANFILES+= crt0.o
SRCS= srt0.S