-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Implement smart linking, take 3 #1382
base: master
Are you sure you want to change the base?
Conversation
4c242e1
to
7f81f1e
Compare
One of the test cases from #782 currently fails. Note that #782 failed it as well, so that's a TODO.
This is the asm: SECTION "root", ROM0[0]
dw WRAMLabel
; This section should be kept thanks to the reference from the WRAM section
SECTION "A", ROM0
Label:
db $01, $02
.end:
SECTION "wram", WRAM0
WRAMLabel:
ds Label.end - Label
SECTION "UnRef", ROM0
UnRef:
db UnRef |
f67797a
to
64cedb2
Compare
Not sure why that would be a valid test. There is no way to know where section |
RGBASM is able to compute the difference between these two labels itself, and so it does: the Yet, since section |
At a detailed source level, yes, it contains a reference. But at a practical level higher overview, it does not contain a reference. It only contains a reference to the size (which is constant, and thus can be pre-computed before linking) IMHO, it's one of those edge cases that does not require to work as there is no practical usage of this in any way. While fixing it is annoyingly needlessly complicated. |
Before this is merged, I should probably say that specifying the starting sections in the command line isn't the best idea. Of course, this doesn't mean that the command line flag cannot be used, but I'd expect to see a way to specify this in code — which would also function as an escape hatch for the above "should this section be included?" problem. |
IIRC we wanted the linker script to also support designating root sections. |
8fd60eb
to
656b87d
Compare
Proposal: add an (This would be a new expression type so the existing @ISSOtm @daid What do you think? Edit: Oh, y'all discussed the exemplifying test case already. I agree with ISSOtm that using |
fe2d958
to
e9af039
Compare
21a1eba
to
832e561
Compare
2eda5d6
to
75ef1b6
Compare
62da49f
to
e958055
Compare
aa7a745
to
6d6da0d
Compare
ca7ff98
to
b0771cb
Compare
e645325
to
785f338
Compare
785f338
to
4f95655
Compare
fccb25b
to
ca8bcc2
Compare
ca8bcc2
to
529086b
Compare
529086b
to
5a2f161
Compare
Fixes #82.
Replaces #654 and #782. Many thanks to @ISSOtm and @daid for getting smart linking to this point!