mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[platformInfo] Hardcode recovery boot address to fix build on GCC 13+
This commit is contained in:
@@ -44,7 +44,7 @@ const bool UserlandHeader::hasUpsilonExtras() const {
|
||||
return m_upsilonExtraMagicHeader == UpsilonExtraMagic && m_upsilonExtraMagicFooter == UpsilonExtraMagic;
|
||||
}
|
||||
|
||||
const uint16_t UserlandHeader::getExtraVersion() const {
|
||||
const uint32_t UserlandHeader::getExtraVersion() const {
|
||||
return m_extraVersion;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,10 +58,8 @@ SECTIONS {
|
||||
} > FLASH
|
||||
|
||||
.recovery_boot : {
|
||||
. = ALIGN(4);
|
||||
_recovery_boot_start = .;
|
||||
. = ORIGIN(FLASH) + USERLAND_OFFSET + 0x100;
|
||||
KEEP(*(.recovery_boot));
|
||||
_recovery_boot_end = .;
|
||||
} >FLASH
|
||||
|
||||
.text : {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
extern char _recovery_boot_start;
|
||||
extern void recovery_start();
|
||||
}
|
||||
namespace Ion {
|
||||
extern char staticStorageArea[];
|
||||
@@ -77,7 +77,16 @@ public:
|
||||
m_osType(OSType),
|
||||
m_upsilonMagicFooter(UpsilonMagic),
|
||||
m_upsilonExtraMagicHeader(UpsilonExtraMagic),
|
||||
m_recoveryAddress(((uint32_t)&_recovery_boot_start) + 1),
|
||||
// FIXME: Since GCC 13, we can't longer store a pointer to a function in the
|
||||
// class initialization. I don't know if it's a problem in GCC or our code,
|
||||
// but it's a bit suspicious as the whole class is blank (0x00) in the
|
||||
// binary with the data available nowhere else (searching for the username
|
||||
// returns nothing).
|
||||
// As a workaround, we fixed the address of recovery_start in flash using
|
||||
// LD script (ion/src/device/bootloader/bootloader_common.ld).
|
||||
// This line works on GCC 12
|
||||
// m_recoveryAddress((uint32_t)recovery_start + 1),
|
||||
m_recoveryAddress(0x90010080 + 1),
|
||||
m_extraVersion(1),
|
||||
m_upsilonExtraMagicFooter(UpsilonExtraMagic) { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user