Add option to disable BSS pad symbols#205
Conversation
Co-authored-by: dreamingmoths <252494949+dreamingmoths@users.noreply.github.com> Co-authored-by: Mc-muffin <8714476+Mc-muffin@users.noreply.github.com>
|
Wait @Mc-muffin found a possible bug with this approach related to the padding folding. I'll take a look at it. |
Co-authored-by: dreamingmoths <252494949+dreamingmoths@users.noreply.github.com> Co-authored-by: Mc-muffin <8714476+Mc-muffin@users.noreply.github.com>
|
Fix pushed. @Mc-muffin was right: dropping the pad label also dropped the size boundary, so objdiff showed the previous BSS symbol absorbing the padding. Now it follows the data/rodata-style end marker approach: emit the declared BSS size, close it with
|
|
Funnily I was a bit worried something like this could happen, but you figured out on your own. I was planning on fixing it after the merge. Either way, how does the generated assembly looks like? Hopefully you could show the before and after. |
|
Sure. Before, with autogenerated pad label: dlabel "m_tpcSingleton__27clsSingleton<11clsPfSystem>", weak
/* 006E69B8 */ .space 0x04
/* Automatically generated and unreferenced pad */
dlabel D_006E69BC
/* 006E69BC */ .space 0x04Bad intermediate version: dlabel "m_tpcSingleton__27clsSingleton<11clsPfSystem>", weak
/* 006E69B8 */ .space 0x08Current version: dlabel "m_tpcSingleton__27clsSingleton<11clsPfSystem>", weak
/* 006E69B8 */ .space 0x04
enddlabel "m_tpcSingleton__27clsSingleton<11clsPfSystem>"
/* 006E69BC */ .space 0x04So the dummy |
|
Awesome, that's exactly what I had in mind |
|
Thanks to you! and @Mc-muffin lol |
|
fyi I can't make the new release today but I'll merge the pr either way. I'll probably make the release tomorrow morning |
|
hey @andresj-sanchez i got some time and made the release |

Summary
--create-bss-pads/--no-create-bss-padsoption to control autogenerated BSS/SBSS pad symbols.Thanks to @dreamingmoths and @Mc-muffin for the help.
Context
Spimdisasm already has options for controlling autogenerated data and rodata pad symbols:
BSS currently always creates pad symbols after user-sized symbols. For example, a BSS symbol with declared size
0x4followed by another symbol at+0x8emits an autogenerated pad label for the gap:This creates extra generated labels in BSS/SBSS output and can make objdiff views noisier.
Before:
After:
When those gap labels are not useful, disabling BSS pad creation folds the gap into the preceding BSS symbol instead:
This PR adds the same style of control for BSS/SBSS via
CREATE_BSS_PADS, exposed through the CLI as:When enabled, behavior stays unchanged. When disabled, Spimdisasm stops creating those autogenerated BSS/SBSS pad symbols.
Notes
create_bss_pads.Testing
--no-create-bss-padsdisables autogenerated BSS pad symbols.--create-bss-padspreserves the existing autogenerated pad behavior.