oot icon indicating copy to clipboard operation
oot copied to clipboard

Partial linking of spec segments

Open Thar0 opened this issue 3 months ago • 4 comments

The return of partial linking.

This PR updates the build process to partial link (ld -r) each spec segment before final link, which stands to improve incremental build times and eliminates various alignment assumptions we've been forced to make in the past. A key part of this setup is that overlay relocations are generated after partial link for spec segments that have been marked with flags OVERLAY, manually including the relocation object file in the spec is no longer needed. This also removes elf2rom and instead uses objcopy to create the final image from the final elf file.

Special thanks to @glankk for help on the first attempt at partial linking, which was valuable for my understanding. Special thanks to @AngheloAlf for implementing the necessary mapfile-parser features for supporting multiple map files transparently to keep tools working as before.

Thar0 avatar Sep 08 '25 23:09 Thar0

We're so back

glankk avatar Oct 22 '25 16:10 glankk

@AngheloAlf bump to re-review and also bump to anyone else who may want to review but hasnt yet

fig02 avatar Nov 20 '25 03:11 fig02

Don't fully understand the changes myself either, but one thing I'd prefer to see some time in the future is the src/overlays folder removed, as it's kind of awkward to have around.

mzxrules avatar Nov 22 '25 08:11 mzxrules

These changes don't have any bearing on whether there should or shouldn't be an overlays directory

Thar0 avatar Nov 22 '25 23:11 Thar0