From 93f0a6d23ebed50833f565f949f351c2b80853ac Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Mon, 7 Mar 2022 22:17:50 +0100 Subject: Fix critical ldscript bug and CI, add BIOS setjmp --- libpsn00b/ldscripts/dll.ld | 1 + libpsn00b/ldscripts/exe.ld | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'libpsn00b/ldscripts') diff --git a/libpsn00b/ldscripts/dll.ld b/libpsn00b/ldscripts/dll.ld index a03a504..15158e4 100644 --- a/libpsn00b/ldscripts/dll.ld +++ b/libpsn00b/ldscripts/dll.ld @@ -86,6 +86,7 @@ SECTIONS { * as we don't have to worry about managing .bss separately from the * main DLL blob. */ + . = ALIGN((. != 0) ? 4 : 1); __bss_start = .; *(.bss .bss.* .gnu.linkonce.b.*) diff --git a/libpsn00b/ldscripts/exe.ld b/libpsn00b/ldscripts/exe.ld index c6b9f29..583d76a 100644 --- a/libpsn00b/ldscripts/exe.ld +++ b/libpsn00b/ldscripts/exe.ld @@ -82,6 +82,11 @@ SECTIONS { /* BSS sections, i.e. uninitialized variables */ + /* + * Align all BSS sections to 4 bytes to ensure _start() doesn't perform + * unaligned memory accesses when clearing them. + */ + . = ALIGN((. != 0) ? 4 : 1); __bss_start = .; .sbss (NOLOAD) : { @@ -91,13 +96,9 @@ SECTIONS { .bss (NOLOAD) : { *(.bss .bss.* .gnu.linkonce.b.*) *(COMMON) - - /* - * This crap was in the stock GCC linker script. - */ - . = ALIGN((. != 0) ? 4 : 1); } > APP_RAM + . = ALIGN((. != 0) ? 4 : 1); _end = .; /* Dummy section */ -- cgit v1.2.3