aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorFilip Strömbäck <filip.stromback@liu.se>2016-05-24 21:14:21 +0200
committerFilip Strömbäck <filip.stromback@liu.se>2016-05-24 21:14:21 +0200
commitf03411fa9c4c8d47ba8ec1d200f57b6a10612852 (patch)
tree7f5a6c316ad061ee417da0d96525c7dc3bb149fc /src/lib
parent9cb696c142769e29d4bac21475431d2c235a0ad4 (diff)
downloadpintos-rs-f03411fa9c4c8d47ba8ec1d200f57b6a10612852.tar.gz
Fixed sc-bad-write once again...
It seems that the BSS segment got larger than one page for some reason, which caused the test to be useless as the boundary to nonmapped memory were not located where the test thought. Now, it uses some linker script magic to define the symbol _bss_end, the address of which is after the end of the bss segment. This seems to be a fool-proof way of detecting where the real boundary to unmapped memory is. Signed-off-by: Filip Strömbäck <filip.stromback@liu.se>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/user/user.lds6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/user/user.lds b/src/lib/user/user.lds
index cc6d6c0..27ea4be 100644
--- a/src/lib/user/user.lds
+++ b/src/lib/user/user.lds
@@ -16,7 +16,11 @@ SECTIONS
. = DATA_SEGMENT_ALIGN (0x1000, 0x1000);
.data : { *(.data) }
- .bss : { *(.bss) }
+ .bss : {
+ *(.bss)
+ /* Get the end of the bss segment as a symbol linkable from C */
+ _end_bss = .;
+ }
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }