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 Make .bss follows .data to detect size r...



details:   https://anonhg.NetBSD.org/src/rev/288bbfe78475
branches:  trunk
changeset: 1006525:288bbfe78475
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Jan 18 07:09:32 2020 +0000

description:
Make .bss follows .data to detect size restriction easier.
Previously, if text+data exceeds the restricted size, it will conflict
with manually fixed .bss area and ldscript makes it an error.
By this change, ASSERT() can detect it.

diffstat:

 sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript |  2 +-
 sys/arch/x68k/stand/xxboot/xxboot.ldscript     |  3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 5d993c7b8b27 -r 288bbfe78475 sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
--- a/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript    Sat Jan 18 06:44:23 2020 +0000
+++ b/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript    Sat Jan 18 07:09:32 2020 +0000
@@ -35,7 +35,6 @@
     edata  =  .;
     _edata  =  .;
   }
-  . = TEXTADDR + 0x2000;
   .bss :
   {
     __bss_start = .;
@@ -48,3 +47,4 @@
 }
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
+ASSERT(_edata - TEXTADDR <= 8192, "Error: text+data is too large to bootarea");
diff -r 5d993c7b8b27 -r 288bbfe78475 sys/arch/x68k/stand/xxboot/xxboot.ldscript
--- a/sys/arch/x68k/stand/xxboot/xxboot.ldscript        Sat Jan 18 06:44:23 2020 +0000
+++ b/sys/arch/x68k/stand/xxboot/xxboot.ldscript        Sat Jan 18 07:09:32 2020 +0000
@@ -35,7 +35,6 @@
     edata  =  .;
     _edata  =  .;
   }
-  . = TEXTADDR + TEXTDATASIZE;
   .bss :
   {
     __bss_start = .;
@@ -48,3 +47,5 @@
 }
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
+ASSERT(_edata - TEXTADDR <= TEXTDATASIZE,
+    "Error: text+data is too large to bootarea");



Home | Main Index | Thread Index | Old Index