Allocate .sbss and .common into .bss

GNU ld fragments .bss into .sbss and .common (see man nm(1) for further
reference). However, the linker script used by PSXSDK did not determine where
to put such sections, causing some statically allocated objects to be placed
**after** __bss_end, leading to undefined behaviour.
This commit is contained in:
Xavier Del Campo Romero 2020-11-07 15:43:30 +01:00
parent ad890e56b6
commit 89b059cace
1 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,13 @@ SECTIONS
.bss ALIGN(4) :
{
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
}
__text_start = ADDR(.text);