Skip to content

Commit c455e4e

Browse files
committed
n64.ld: avoid linking ELF files which are too big for N64 memory
1 parent 24590c1 commit c455e4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

n64.ld

+6
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,9 @@ SECTIONS {
189189
/* Deprecated */
190190
end = .;
191191
}
192+
193+
/* Give an assert for a too huge binary. The maximum allowed size here is 8 MiB,
194+
minus the space for the stack and the initial low memory section.
195+
Notice the exact size doesn't matter much: we want to detect mistakes that
196+
would be much harder to find at runtime when no heap is available... */
197+
ASSERT(end - __text_start <= 8*1024*1024 - 64*1024 - 1024, "ERROR: the generated ELF is too big for N64 memory")

0 commit comments

Comments
 (0)