From f03411fa9c4c8d47ba8ec1d200f57b6a10612852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Str=C3=B6mb=C3=A4ck?= Date: Tue, 24 May 2016 21:14:21 +0200 Subject: Fixed sc-bad-write once again... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/lib/user/user.lds | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/user') 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) } -- cgit v1.2.1