shithub: rgbds

Download patch

ref: bc2f885d29905e2f4336ad042fc31c576823abb6
parent: bd00b9ab59214501e6dbf6a76f3974ce7ac9bbcf
author: Sanqui <[email protected]>
date: Thu Mar 2 18:02:56 EST 2017

Also require ROM0 sections to be fixed when using overlay

--- a/src/link/assign.c
+++ b/src/link/assign.c
@@ -259,8 +259,9 @@
 		SLONG org;
 
 		if ((org = area_AllocAnyBank(pSection->nByteSize, pSection->nAlign, type)) != -1) {
-			if (pSection->Type == SECT_ROMX && options & OPT_OVERLAY) {
-				errx(1, "All ROMX sections must be fixed when using overlay");
+			if (options & OPT_OVERLAY && 
+			    (pSection->Type == SECT_ROMX || pSection->Type == SECT_ROM0)) {
+				errx(1, "All ROM sections must be fixed when using overlay");
 			}
 			pSection->nOrg = org & 0xFFFF;
 			pSection->nBank = org >> 16;
@@ -405,8 +406,9 @@
 	while (pSection) {
 		if (pSection->oAssigned == 0
 			&& pSection->nOrg != -1 && pSection->nBank == -1) {
-			if (pSection->Type == SECT_ROMX && options & OPT_OVERLAY) {
-				errx(1, "All ROMX sections must be fixed when using overlay");
+			if (options & OPT_OVERLAY && 
+			    (pSection->Type == SECT_ROMX || pSection->Type == SECT_ROM0)) {
+				errx(1, "All ROM sections must be fixed when using overlay");
 			}
 			switch (pSection->Type) {
 			case SECT_ROMX: