mkst / maspsx

MIT License
5 stars 4 forks source link

Add option for making .lcomm symbols common #83

Closed dezgeg closed 2 months ago

dezgeg commented 2 months ago

This can be convenient with games using -G with older aspsx where static vs. non-static symbols cause different code generation.

Without this, if you run into a function which refers to a symbol that must be marked static to get the code generation correct, the only option is to migrate .sdata/.sbss for the C file containing it.

With the --use-comm-for-lcomm option that isn't necessary and the usual way of putting the address of the variable to symbols.txt still works.

mkst commented 2 months ago

It's funny that you raise this PR - I am having the same issue with ESA (but I'm still using bss/sbss - I need to tell splat to use .common and then this PR will likely solve my issues too!)

dezgeg commented 2 months ago

Yeah, I had this kind of thing as a hack locally since quite a while about it and forgot about it until I was reminded by the commit adding --use-comm-section...