shithub: rgbds

Download patch

ref: ccc666c1e4b38fa2d1608b81d49b0dac253cefca
parent: 17b9838c8fdf8f74edf741ac05a45affe0332089
parent: 38a372f25f3a44b127cad45e5299743a15503f6c
author: Eldred Habert <[email protected]>
date: Mon Sep 9 19:32:30 EDT 2019

Merge pull request #417 from ISSOtm/zero_sections

Allow 0-byte SECTIONs to be fixed anywhere

--- a/src/link/assign.c
+++ b/src/link/assign.c
@@ -155,6 +155,11 @@
 
 int32_t area_doAlloc(struct sFreeArea *pArea, int32_t org, int32_t size)
 {
+	if (size == 0) {
+		/* 0-byte SECTIONs don't take any room, they can go anywhere */
+		return org;
+	}
+
 	if ((org >= pArea->nOrg)
 	    && ((org + size) <= (pArea->nOrg + pArea->nSize))) {