Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x68k/stand/xxboot - Restore display of first_kbyte....



details:   https://anonhg.NetBSD.org/src/rev/691376d18788
branches:  trunk
changeset: 937265:691376d18788
user:      isaki <isaki%NetBSD.org@localhost>
date:      Fri Aug 14 03:25:39 2020 +0000

description:
- Restore display of first_kbyte.  This is helpful for development.
- Check the filesize of resulting file instead of section sizes.
  If there is a gap between sections, the filesize may be exceeded even
  though the section total is not exceeded.  Of course that doesn't
  usually happen but I've experienced this during development.

diffstat:

 sys/arch/x68k/stand/xxboot/Makefile.xxboot |  13 +++++++++++--
 sys/arch/x68k/stand/xxboot/xxboot.ldscript |   2 --
 2 files changed, 11 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r d4b092616f1e -r 691376d18788 sys/arch/x68k/stand/xxboot/Makefile.xxboot
--- a/sys/arch/x68k/stand/xxboot/Makefile.xxboot        Fri Aug 14 02:51:48 2020 +0000
+++ b/sys/arch/x68k/stand/xxboot/Makefile.xxboot        Fri Aug 14 03:25:39 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.xxboot,v 1.13 2020/08/10 07:00:49 rin Exp $
+#      $NetBSD: Makefile.xxboot,v 1.14 2020/08/14 03:25:39 isaki Exp $
 
 NOMAN=         # defined
 
@@ -61,10 +61,19 @@
 
 .include "${.CURDIR}/../../Makefile.booters"
 
+CLEANFILES+=   ${PROG}.map
+
 
 ${PROG}: $(OBJS)
        ${_MKTARGET_LINK}
-       $(LD) $(LINKFLAGS) -o ${PROG} $(OBJS) $(LDLIBS)
+       $(LD) $(LINKFLAGS) -Map=${PROG}.map -o ${PROG} $(OBJS) $(LDLIBS)
+       : Print some addresses for convenience
+       @${TOOL_AWK} '/first_kbyte$$/ { print "\t\t" $$2 "\t" $$1 }' ${PROG}.map
+       @echo "         filesize        "`${TOOL_STAT} -f %z ${PROG}`
+       @if [ `${TOOL_STAT} -f %z ${PROG}` -gt 8192 ]; then \
+           echo "${PROG} filesize exceeds 8192 bytes"; \
+               exit 1; \
+       fi
        ${TOUCHPROG}
 
 .include <bsd.prog.mk>
diff -r d4b092616f1e -r 691376d18788 sys/arch/x68k/stand/xxboot/xxboot.ldscript
--- a/sys/arch/x68k/stand/xxboot/xxboot.ldscript        Fri Aug 14 02:51:48 2020 +0000
+++ b/sys/arch/x68k/stand/xxboot/xxboot.ldscript        Fri Aug 14 03:25:39 2020 +0000
@@ -48,6 +48,4 @@
 }
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
-ASSERT(_edata - TEXTADDR <= TEXTDATASIZE,
-    "Error: text+data is too large to bootarea");
 ASSERT(_end <= BOOT_TEXTADDR, "Error: _end conflicts BOOT_TEXT");



Home | Main Index | Thread Index | Old Index