-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[makerom] bss section included in .cia and allocated twice on program load #20
Comments
Hmm, when I make 10MB static arrays static char ARRAY[10*1024*1024] = {0};
printf("arr %s", ARRAY); The CXI is ~10MB. (without compression ofc) I suggest checking your linker script, because makerom just takes ELF segments as described in the ELF program headers. Can you upload one of these offending ELFs, also telling what the BSS size for that ELF should be? |
the exefs shouldn't include the bss section in the first place right ? the fact that the CXI gets that big is the problem. the bss section in the elf is reported correctly, I tested using the standard linker script in devkitarm just to make sure. I can upload an elf if you want, but you can reproduce the problem already. the fact that older makerom doesn't work well with current devkitarm makes this harder to test, ill see if I can find/create an elf file with a huge bss section that works with both old and current makerom so you can see the difference. |
Oh, I see. Well the fix should be easy. I'm just not sure EXEFS has to include the BSS section. But since available memory is reduced by twice the size, it appears, that it doesn't have to include it. |
You are right, checking the old code ripped from the SDK makerom, the segment processing code has this in the loop that calculates the segment size:
|
you found a solution already, cool :D |
Fixed: 8ac78ca |
currently the .bss section seems to be duplicated in the data section, which will cause the issues mentioned in the title.
you can easily test this by creating a 10MB static array (make sure you also reference it in the code because --gc-sections will remove it otherwise). this will greatly increase the size of the generated .cia and will also reduce the available memory at runtime by 20MB, instead of just 10.
The text was updated successfully, but these errors were encountered: