Skip to content

mcg: fix ha16/lo16 far data, O_CREAT; adjust mcg spills#372

Merged
davidgiven merged 1 commit into
davidgiven:defaultfrom
johnsonjh:johnsonjh/20260716/mips2
Jul 18, 2026
Merged

mcg: fix ha16/lo16 far data, O_CREAT; adjust mcg spills#372
davidgiven merged 1 commit into
davidgiven:defaultfrom
johnsonjh:johnsonjh/20260716/mips2

Conversation

@johnsonjh

Copy link
Copy Markdown
Contributor
  1. Allow ha16/lo16 for locals past 64K via symbol relative relocations with linker handling of module local names.
  2. Define MIPS-compatible O_CREAT correctly.
  3. Fail nicely (i.e., don't crash) in mcg when a stacked spill is still an insn operand.

Closes #371

Allow ha16/lo16 for locals past 64K via symbol relative
relocations with linker handling of module local names.

Define MIPS compatible O_CREAT correctly.

Fail (and don't crash) in mcg when a stacked spill is
still insn operand.

Signed-off-by: Jeffrey H. Johnson <johnsonjh.dev@gmail.com>
@johnsonjh

johnsonjh commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@davidgiven have a chance to review this yet?

It still isn’t “perfect” but its definitely an improvement.

@davidgiven

Copy link
Copy Markdown
Owner

Looks great, thank you! Of course MIPS uses different open() parameters to anything else; being standardised would be convenient...

What's the change to led/relocate.c for?

@davidgiven
davidgiven merged commit 7afa32a into davidgiven:default Jul 18, 2026
1 of 3 checks passed
@johnsonjh
johnsonjh deleted the johnsonjh/20260716/mips2 branch July 18, 2026 16:24
@johnsonjh

Copy link
Copy Markdown
Contributor Author

kind of a workaround to let the new ha16 overflow handling get resolved by the linker (resolving against the section+offset instead of needing to expose these locals globally and then do name mangling or what not)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segfault in MIPS codegen at -O3

2 participants