Skip to content

Linker Implementation#11

Merged
jackwthake merged 12 commits into
mainfrom
feat/c02-ld
Jul 17, 2026
Merged

Linker Implementation#11
jackwthake merged 12 commits into
mainfrom
feat/c02-ld

Conversation

@jackwthake

Copy link
Copy Markdown
Owner

The goal of this branch is to implement a linker that merges compiled ir object files into one ir file that can then be passed to the code generator, c02-as

foo.c02 ─► c02-frontend ─► foo.o ─┬► c02-ld (Ocaml based linker and optimizer) ─► prog.o ─► c02-as ─► prog.bin
bar.c02 ─► c02-frontend ─► bar.o ─┘

I'm choosing to do this in Ocaml because I want to learn it and the strict typing will be useful

@jackwthake jackwthake self-assigned this Jul 15, 2026
@jackwthake jackwthake added the enhancement New feature or request label Jul 15, 2026
@jackwthake

jackwthake commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

Whats left before merge:

  • struct dedup - currently struct decls across multiple modules just concatenate. Need to ensure same layout -> emit 1 else -> error
  • missing main function check - currently checks for redefined mains but not missing main
  • re-serialize linked object for codegen phase
  • add test suite for linker cases

@jackwthake
jackwthake marked this pull request as ready for review July 17, 2026 00:17
@jackwthake

Copy link
Copy Markdown
Owner Author

Great work Jack!

@jackwthake
jackwthake merged commit 6456db7 into main Jul 17, 2026
6 checks passed
@jackwthake
jackwthake deleted the feat/c02-ld branch July 17, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant