-
Notifications
You must be signed in to change notification settings - Fork 99
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
Assembler reported ROM use can go over 100% #619
Comments
Another example without
|
Thanks for the report! I'll try to fix this in the following couple of days... |
Looking at this I guess the issue here is that the assembler doesn't place any of the .SECTIONs and just reports what's in the object/source file. Try to link this example and the linker will tell that "Force section" goes beyond the ROM size... To fix this issue I'd rather just make the assembler to understand that the FORCE .SECTION overflows from the BANK 0 and it should issue an error... |
This issue surely sounds like it's double counting OVERWRITE .SECTIONs - I'll try to fix this as well... |
Just realized that I cannot do the .SECTION sanity check for FORCE and OVERWRITE .SECTIONs in the assembler as their locations can be changed in the linker. |
Also, for OVERWRITE .SECTIONs it's impossible to tell how much other .SECTIONs they'll overwrite after everything has been linked as the assembler doesn't know the final placements of the .SECTIONs, and other .SECTIONs could come from other files. I can improve assembler's verbose output a little, but take that as an isolated reference. Only the linker knows the final truth. |
The latest sources should now handle OVERWRITE and FORCE .SECTIONs a little bit better when writing that report at the end of assembling, but if you stuff a ROM bank with more data in .SECTIONs that it can take it will still report values past 100% which I think should be left as it is as it's informative for letting the user know what has happened... |
With the latest changes I still get this: asm.log |
Aha, found something. In the assembler log:
In the symbol file:
It's in bank $b, not bank 1. The code:
So I guess it's counting superfree sections towards the bank that is active when they are defined, because it has no idea where they'll be placed at link time. Confusing, for sure. Maybe they ought to be counted separately at compile time, under a "no bank assigned yet" heading? |
In an extreme example:
This is in a translation hack using
.background
and a mixture of.unbackground
andoverwrite
sections. Experimenting suggests the former works OK but the latter causes double-counting. Example (where PS1-J.SMS is a 512KB file, you can reduce for a simpler case):Plus:
Produces (edited to remove higher banks info):
I haven't figured out how it manages to get the >200% figure shown at the top, though.
The text was updated successfully, but these errors were encountered: