shithub: rgbds

Download patch

ref: 4600f70fef49f070e7fabb2b8f653edb5e0f72b4
parent: 9e33cc998fb889dc057f7a67001761bad085a23d
author: ISSOtm <[email protected]>
date: Fri Oct 11 15:00:57 EDT 2019

Fix address-fixed sections potentially incorrectly assigned
This happened if all space before their fixed location was taken

--- a/src/link/assign.c
+++ b/src/link/assign.c
@@ -166,11 +166,11 @@
 				 * one candidate block per bank; if we already
 				 * reached it, give up.
 				 */
-				if (location->address == section->org)
+				if (location->address < section->org)
+					location->address = section->org;
+				else
 					/* Try again in next bank */
 					space = NULL;
-				else
-					location->address = section->org;
 			} else if (section->isAlignFixed) {
 				/* Move to next aligned location */
 				location->address &= ~section->alignMask;